agentleFS
rkalievrkaliev/eng-kit/skills/observability/SKILL.md

observability

Skill1 starsChanged 13 days agoMITView on GitHub

Use when adding or changing logging, metrics, tracing, alerts, timeouts or health checks, or when investigating production behavior from logs and telemetry

103 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 10 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 5 projects that use this

  • YepAPISkill

    background-jobs

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

    Also in 5 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

  • ffsshhttiikkSkill

    chaos-engineering

    Resilience testing through controlled experiments

    Also in 6 projects that use this

  • jholhewresSkill

    dora-metrics

    Calculate DORA metrics from git + deploy logs

    Also in 3 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 6 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 5

    Distinctive

    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:

    Create or accept a request id at the entry point and return it to the caller (for example x-request-id).

    line 27
  2. Distinctive:

    When a value can't be read, report unknown, never a healthy-looking zero.

    line 36
  3. Distinctive:

    Every wait has a deadline from configuration, and cancellation: database statement and lock timeouts, each outbound call (with an abort …

    line 40
  4. Distinctive:

    Never race a transaction against a timer.

    line 42
  5. Distinctive:

    Read-only. Query a bounded window: service, environment, a time range, and a request or trace id when you have one.

    line 55
  6. Distinctive:

    Never change dashboards, alerts or retention while investigating unless the user asks.

    line 57

“Common” is measured: kept by at least 6 in 10 of the 85 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

Telemetry must answer three questions without a debugger: what happened to request X, which dependency is slow, and what needs a human now. Follow the project's logger, field names and tools; this skill supplies the rules they don't state.

Logs

  • Structured, one event per record. The message is a fixed string ("Payment captured", "Couldn't reach provider"); every variable goes into a field. Fixed messages stay searchable and group correctly in error trackers.
  • Levels:

    • debug: development detail, off in production;
    • info: a business event that completed ("Order paid"), logged after the commit;
    • warn: an expected or recoverable failure ("Couldn't reach provider, retrying");
    • error: needs a human, with the reason;
    • fatal: only right before an unrecoverable exit.

    A refusal is not a fault: a validation failure, a declined card or a conflict is info (writes) or debug (reads), not error.

  • Fields on every record: event or message, level, UTC timestamp, service, release version. Add request_id, trace_id and job_id when they exist. Bind them once where the request or job enters, not at every call.
  • Never at info or above: secrets, tokens, auth headers, card data, personal data, user content, not even masked or truncated. Errors from a database, provider or transport are reduced to their name and code. For payloads, log the length.
  • Log where you handle the error, once. Rethrow with cause; don't log at every layer. Don't log health probes, successful polls or hot loops.

Correlation

  • Create or accept a request id at the entry point and return it to the caller (for example x-request-id).
  • Propagate trace context across HTTP, queues and jobs (W3C traceparent, OpenTelemetry). A job keeps the id of the request that queued it.
  • Group errors by a stable identity (operation + error class + code), not by message text, so that one fault is one issue.

Metrics

  • RED for request paths (rate, errors, duration) and USE for resources (utilization, saturation, errors). Names carry units (_seconds, _bytes, _total).
  • Labels come only from small, fixed sets defined in code: never ids, URLs, e-mails, error messages or anything a user controls. Write down each label's bound.
  • Durations are histograms, and percentiles come from summed buckets, never from averaging percentiles. Counters are read as a rate.
  • When a value can't be read, report unknown, never a healthy-looking zero.

Deadlines

  • Every wait has a deadline from configuration, and cancellation: database statement and lock timeouts, each outbound call (with an abort signal), queue receives, and UI waits.
  • A slow path is fixed, not hidden: raising a timeout to silence an alert is a defect.
  • Never race a transaction against a timer. The timer can't cancel a commit, so the result is a double write. Use the database's own timeouts.

Alerts

  • Alert on symptoms a user feels (error rate, latency, a stuck queue), each with a window, a recovery condition and a runbook link.
  • Alert when telemetry itself stops (no scrape, no logs, a blind collector): missing data must never read as zero errors.

Clients: mobile, desktop and POS

Crash reporting with release and device version; breadcrumbs without personal data; a local log buffer that survives offline and uploads later; device health (queue length, last sync, peripheral errors). See mobile-development and pos-systems.

Investigating from telemetry

  • Read-only. Query a bounded window: service, environment, a time range, and a request or trace id when you have one. Start narrow and widen.
  • Show the exact query and quote only the fields you need, so someone else can repeat it.
  • Never change dashboards, alerts or retention while investigating unless the user asks.

Naming, cardinality budgets, SLI and alert templates and query recipes are in references/metrics-and-alerts.md.

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.