agentleFS
qyndexqyndex/claude-init/.claude/skills/prod-observability/SKILL.md

prod-observability

Skill2 starsChanged 5 months agoMITView on GitHub

Scaffold the PRODUCTION observability + alerting + notification stack into a shipped app — OTEL collector, Sloth SLO burn-rate rules, synthetic monitor, Alertmanager routing, Sentry release tracking. Distinct from the `observability` skill (which emits telemetry in app code) — this gives that telemetry a destination + makes SLOs fire alerts. Round 12 A.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Read the spec's ## SLOs + ## Rollout sections + slo.yml.

    line 28
  2. Very specific:

    Run slo-gen.sh → commit deploy/prometheus-slo-rules.yaml (this is the #1 thing — turns SLO doc into enforcement).

    line 30
  3. Very specific:

    Add the @synthetic tag to the read-only critical journey in e2e/.

    line 33
  4. Distinctive:

    Verify: a deliberate test breach (raise error rate in staging) → SLO rule fires → Alertmanager pages + dispatches → hotfix pipeline opens …

    line 34
  5. Very specific:

    SLO must be enforced, not documented: If slo-gen.sh didn't run, the SLO is vapor.

    line 46
  6. Distinctive:

    Synthetic journeys are read-only: Never mutate prod data in a monitor.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Production Observability

Mandate

The observability skill makes the app EMIT logs/metrics/traces. This skill gives them a HOME and makes the SLO actually fire. The gap it closes: slo.yml declares burn-rate thresholds that, without this, nothing evaluates at runtime.

What it scaffolds (from templates/observability/)

TemplateDrops toPurpose
otel-collector.yamldeploy/otel-collector.yamlapp OTLP → collector → Tempo/Prometheus/Loki (swappable)
slo-gen.sh (script)runs at ship timecompiles slo.yml → Prometheus multi-burn-rate rules (Sloth)
synthetic-monitor.yml.github/workflows/Playwright critical journey vs PROD every 5 min
alertmanager.yamldeploy/alertmanager.yamlseverity routing → PagerDuty (page) + Slack + hotfix dispatch
sentry-release.shscripts/release tag + source maps → error maps to commit/PR

Procedure

  1. Read the spec's ## SLOs + ## Rollout sections + slo.yml.
  2. Copy the 5 templates into the shipped repo (substitute service, PROD_URL, backend endpoints).
  3. Run slo-gen.sh → commit deploy/prometheus-slo-rules.yaml (this is the #1 thing — turns SLO doc into enforcement).
  4. Wire the app SDK: OTEL_EXPORTER_OTLP_ENDPOINT → collector; Sentry init with release + environment + spec.id tag.
  5. Set repo variables: PROD_URL, PROM_URL, PROM_REMOTE_WRITE, TEMPO_ENDPOINT, LOKI_ENDPOINT, PUSHGATEWAY_URL; secrets: PAGERDUTY_ROUTING_KEY, SLACK_WEBHOOK_URL, SENTRY_AUTH_TOKEN, GH_DISPATCH_PAT.
  6. Add the @synthetic tag to the read-only critical journey in e2e/.
  7. Verify: a deliberate test breach (raise error rate in staging) → SLO rule fires → Alertmanager pages + dispatches → hotfix pipeline opens an issue.

The correlation chain (Round 12 D)

trace_id (W3C traceparent) → service spans → log lines (shared trace_id) → release=<SHA> (Sentry tag + OTEL service.version) → commit (Sentry suspect-commits) → spec (spec.id OTEL resource attr + github_issue). Click a prod error → land on the introducing PR.

How it feeds the hotfix pipeline

Alertmanager severity:page → webhook → GitHub repository_dispatch: prod-alert → hotfix-ingest.yml → hotfix-to-task.sh → top-of-queue task + hotfix issue → autonomous fix → PR. This skill creates the alert source the hotfix loop consumes.

Hard rules

  • SLO must be enforced, not documented. If slo-gen.sh didn't run, the SLO is vapor.
  • Synthetic journeys are read-only. Never mutate prod data in a monitor.
  • Page only on severity:page. SEV3/4 → Slack ticket, not a wake-up.
  • Backend is swappable. App emits OTLP; only the collector's exporter block changes per backend.
  • Source maps + release tags are non-negotiable for prod JS/TS — without them, errors are unreadable minified stacks.

References

Done means

  • deploy/prometheus-slo-rules.yaml committed (SLO enforced)
  • Collector + Alertmanager configs in deploy/
  • Synthetic monitor workflow running every 5 min
  • Sentry release tracking in the ship pipeline
  • A test breach demonstrably pages + opens a hotfix

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.