agentleFS
atuljha23atuljha23/holocron/skills/observability-checklist/SKILL.md

observability-checklist

Skill2 starsChanged 7 months agoMITView on GitHub

What good observability looks like — structured logs, trace spans, metrics, correlation ids, and the instrumentation rules that turn logs into answers. Use when adding a feature, reviewing a service, or debugging a prod issue.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Every log has: ts, level, service, request_id, msg, and relevant fields.

    line 14
  2. Distinctive:

    Don't invent new levels.

    line 23
  3. Distinctive:

    Every outbound request carries trace context headers.

    line 51
  4. Distinctive:

    Every background job enqueues with trace context.

    line 52
  5. Distinctive:

    No unbounded tags (user_id, tenant_id, url with params).

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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 checklist

The goal isn't logs — it's answering "what happened" in under five minutes at 2am. Design backward from the question.

Logs

Structured or nothing

  • JSON (or logfmt), not free text.
  • Every log has: ts, level, service, request_id, msg, and relevant fields.
  • Fields are snake_case or camelCase — pick one per service. No mixing.
  • Durations in milliseconds as numbers, not "took 2s" strings.

Levels are a contract

  • error: something failed the user can't recover from. Alert-worthy.
  • warn: something unexpected but handled. Review-worthy.
  • info: the shape of normal traffic. Sampling OK.
  • debug: developer-only. Off in prod.
  • Don't invent new levels.

What to log

  • Request entry (method, path, user, request_id).
  • Outcome (status, duration).
  • Branch decisions that matter (authz check, cache hit/miss, retry).
  • Errors with the full context you need to reproduce.

What NOT to log

  • Secrets, tokens, passwords, PII — scrub before logging.
  • The full request body by default. Specific fields, yes. Everything, no.
  • Stack traces as separate lines — include as a stack field so they stay with the event.

Traces

Span per unit of work

  • HTTP request handler = 1 span.
  • Outbound call = child span.
  • DB query = child span (with db.statement truncated / hashed, not raw if PII risk).
  • Background job step = 1 span.

Mandatory attributes

  • service.name, service.version.
  • For HTTP: http.method, http.route, http.status_code.
  • For DB: db.system, db.operation.
  • For errors: exception.type, exception.message.

Propagation

  • Every outbound request carries trace context headers.
  • Every background job enqueues with trace context.
  • A trace that ends at the HTTP edge and restarts at the worker is useless.

Metrics

RED for services

  • Rate — requests per second, per endpoint.
  • Errors — error rate, per endpoint.
  • Duration — p50/p95/p99, per endpoint.

USE for resources

  • Utilization — % of capacity in use.
  • Saturation — queue depth / wait time.
  • Errors — failed operations.

Cardinality discipline

  • No unbounded tags (user_id, tenant_id, url with params). They explode your TSDB bill.
  • Pre-aggregate cardinal dimensions; keep labels coarse.
  • http.route (the template), not http.url (the instance).

Correlation

  • request_id in: logs, traces (as request.id attr), response headers, error payloads.
  • trace_id in: logs (auto-injected by SDK), response headers for user bug reports.
  • A user reporting "I got a 500" should give you enough to find the request — the request_id is visible and searchable.

Per-language

Node

  • Pino or Winston with JSON transport.
  • OpenTelemetry SDK (@opentelemetry/sdk-node).
  • Prom-client for metrics.

Python

  • structlog with ProcessorFormatter.
  • opentelemetry-sdk + opentelemetry-instrumentation-*.
  • prometheus_client.

Go

  • slog (stdlib, Go 1.21+) with JSON handler.
  • go.opentelemetry.io/otel + auto-instrumentation.
  • prometheus/client_golang.

Rust

  • tracing + tracing-subscriber with JSON formatter.
  • opentelemetry-otlp.
  • prometheus crate.

Anti-patterns

  • "Log everything, we'll figure it out later" — the noise hides the signal you need.
  • Traces without sampling — you'll drown; sample intelligently (head-based at edges, tail-based for errors).
  • Metrics where logs would do — counting "user clicked button" 1M times/day is cheaper as a metric than a log.
  • Logs where metrics would do — "latency: 247ms" as a log line is wasting money; it's a histogram.
  • Alerts on everything — page only on symptoms that hurt users, not causes.

Smells

  • A single log line has more than ~10 fields — probably two events glued together.
  • You use grep to find things — you should have a field + dashboard.
  • Error messages are generic ("an error occurred") — they cost you the 2am minutes.
  • console.log in prod code — belongs in a logger, tagged and leveled.

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.