agentleFS
stevancrisstevancris/sre-ai-agent/skills/observability/SKILL.md

observability

Skill0 starsChanged 5 months agoMITView on GitHub

Design, review, and improve observability for services: metrics, logs, and distributed traces. Use when instrumenting a new service, investigating gaps in visibility, reviewing dashboards, building alerting, or diagnosing why an incident was hard to detect. Trigger keywords: observability, metrics, logs, tracing, traces, dashboard, alerting, instrumentation, OpenTelemetry, Prometheus, Datadog, Grafana, structured logging, spans, golden signals, USE method, RED method, four golden signals, visibility, monitoring gap, hard to debug, missing metrics, no alerts.

87 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use gitops, background-jobs and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • kcns008Skill

    gitops

    GitOps Agent (Flow) — manages ArgoCD applications, Helm charts, Kustomize overlays, deployment strategies (canary, blue-green, rolling), multi-cluster GitOps, and drift detection for Kubernetes and OpenShift clusters.

    Also in 4 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 4 projects that use this

  • Mushfiqur-Rahman-RobinSkill

    rag-systems

    Best practices for building Retrieval-Augmented Generation systems — chunking, embedding, hybrid retrieval, reranking, indexing, caching, evaluation, observability — plus a catalog of RAG patterns and when each applies.

    Also in 3 projects that use this

  • YepAPISkill

    data-pipelines

    ETL patterns, cron scheduling, queue-based processing, and batch jobs with Inngest/BullMQ.

    Also in 4 projects that use this

  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 5 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 13 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 70 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before loading context files, check if context/CONTEXT.md exists in the current directory.

    line 18
  2. Distinctive:

    Use the answers inline for this session.

    line 30
  3. Very specific:

    Read context/company/tech-stack.md to identify the observability stack (Datadog, Prometheus+Grafana, New Relic, etc.) and primary …

    line 39
  4. Distinctive:

    Every log line must include:

    line 86
  5. Distinctive:

    Never log: passwords, tokens, PII (email, phone, address), credit card numbers.

    line 102
  6. Distinctive:

    Add trace context propagation at all service boundaries (HTTP headers, queue message attributes).

    line 105
  7. Distinctive:

    Create spans for: inbound requests, outbound calls, DB queries, cache operations.

    line 106
  8. Very specific:

    Every alert must have a runbook.

    line 158
  9. Distinctive:

    Do not alert on metrics that do not require human action.

    line 160

“Common” is measured: kept by at least 6 in 10 of the 70 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Observability Skill

Setup Check

Before loading context files, check if context/CONTEXT.md exists in the current directory.

If context/CONTEXT.md exists — read it and proceed normally.

If context/CONTEXT.md does not exist — this skill was installed standalone (e.g. via npx skills add). Ask the user these questions before proceeding:

  1. Role — junior-sre / senior-sre / sre-manager (shapes output depth and tone)
  2. Cloud provider — aws / gcp / azure / on-prem / hybrid
  3. Observability stack — e.g. Datadog, Prometheus+Grafana, New Relic
  4. Company name and primary services affected (if relevant to this task)

Use the answers inline for this session. For persistent setup across all skills, suggest:

pipx install sre-agent
sre-agent init

Instructions

Step 1: Load Context

Read context/company/tech-stack.md to identify the observability stack (Datadog, Prometheus+Grafana, New Relic, etc.) and primary language/framework.

Step 2: Determine the Mode

  • Instrument new service — adding observability to a new or existing service
  • Review coverage — assess gaps in existing observability
  • Build alerting — create alert rules for a service
  • Dashboard design — build or improve a service dashboard
  • Incident visibility gap — why was this incident hard to detect?

Mode: Instrument New Service

The Four Golden Signals (start here for every service)

SignalWhat to measureExample metric name
LatencyRequest duration, broken by success/errorhttp_request_duration_seconds
TrafficRequest rate (RPS / QPS)http_requests_total
ErrorsError rate (5xx, exceptions)http_errors_total
SaturationResource utilization (CPU, memory, queue depth)process_cpu_usage, queue_depth

Instrumentation Checklist

HTTP Services:

  • Request count (by method, path, status code)
  • Request latency histogram (P50, P95, P99)
  • Error rate (4xx and 5xx separately)
  • In-flight requests (saturation)
  • Dependency call latency (DB, cache, downstream APIs)
  • Circuit breaker state (if applicable)

Workers / Background Jobs:

  • Job execution count (success / failure)
  • Job duration histogram
  • Queue depth (consumer lag)
  • Job retry count
  • Dead-letter queue size

Databases:

  • Query latency (by query type)
  • Connection pool utilization
  • Replication lag (for read replicas)
  • Cache hit rate (if applicable)

Structured Logging Standards

Every log line must include:

{
  "timestamp": "ISO8601",
  "level": "INFO|WARN|ERROR",
  "service": "service-name",
  "version": "v1.2.3",
  "trace_id": "abc123",
  "span_id": "def456",
  "request_id": "uuid",
  "user_id": "optional",
  "message": "human readable",
  "error": "error string if applicable"
}

Never log: passwords, tokens, PII (email, phone, address), credit card numbers.

Distributed Tracing

  • Add trace context propagation at all service boundaries (HTTP headers, queue message attributes).
  • Create spans for: inbound requests, outbound calls, DB queries, cache operations.
  • Tag spans with: service name, operation name, status (ok/error), relevant business attributes.

Mode: Review Coverage

Assess against the four golden signals for each service in scope. Flag gaps:

Service: <name>
Golden Signal Coverage:
  Latency:    ✓ histogram available, P99 alert configured
  Traffic:    ✓ RPS metric available
  Errors:     ✗ MISSING — no error rate metric
  Saturation: ⚠ CPU only — memory and queue depth missing

Tracing:      ✓ spans present, but missing DB query spans
Logging:      ⚠ logs exist but unstructured (no trace_id)

Priority gaps:
  1. Add error rate metric (blocks SLO measurement)
  2. Add trace_id to log lines (needed for incident correlation)
  3. Add queue depth metric (saturation blind spot)

Mode: Build Alerting

For each service, build alert rules using the multi-window burn rate approach:

# Example: error rate alert (adapt syntax to your stack)
alert: HighErrorRate
expr: |
  (
    rate(http_errors_total[5m]) / rate(http_requests_total[5m])
  ) > 0.05
for: 2m
labels:
  severity: P1
annotations:
  summary: "Error rate above 5% for {{ $labels.service }}"
  runbook: "<link to runbook>"

Guidelines

  • Alert on symptoms (user-facing impact), not causes (CPU high).
  • Every alert must have a runbook. If no runbook exists, invoke runbook-generator.
  • Dashboards should tell a story from top (user experience) to bottom (infrastructure).
  • Do not alert on metrics that do not require human action.
  • Persona (junior-sre): add "learning note" explaining why each golden signal matters.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.