agentleFS
sohaibdevvsohaibdevv/AI-AGENT-SKILLS/skills/observability-and-monitoring/SKILL.md

observability-and-monitoring

Skill2 starsChanged 6 months agoMITView on GitHub

Design logging, metrics, tracing, and alerting that make systems debuggable in production

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before deploying any new service or significant feature

    line 14
  2. Distinctive:

    When a production issue took more than 30 minutes to diagnose

    line 15
  3. Distinctive:

    When adding a new data flow, user journey, or integration

    line 16
  4. Distinctive:

    Never log PII, passwords, tokens, or credit card numbers

    line 32
  5. Distinctive:

    Add business metrics: active users, signups, payments, key conversions.

    line 42
  6. Distinctive:

    Use OpenTelemetry or compatible SDK

    line 47
  7. Distinctive:

    Check downstream dependencies in readiness probe

    line 54
  8. Distinctive:

    Do NOT alert on:

    line 63
  9. Distinctive:

    Every alert must have a runbook.

    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

Overview

A system you cannot observe is a system you cannot debug. Observability is not a dashboard - it is the ability to answer any question about system behavior using existing data, without deploying new code. This skill implements the three pillars (logs, metrics, traces) and the alerts that page you before users notice.

When to Use

  • Before deploying any new service or significant feature
  • When a production issue took more than 30 minutes to diagnose
  • When adding a new data flow, user journey, or integration
  • As part of the /ship workflow

Process

Step 1: Define the SLIs and SLOs

SLI (Service Level Indicator): what you measure - latency, error rate, availability, throughput. SLO (Service Level Objective): the target - "p99 latency < 500ms," "error rate < 0.1%."

Without SLOs, you don't know when to alert.

Step 2: Structured logging

  • Log in JSON (not freeform text)
  • Include: timestamp, log level, service name, trace ID, user ID (hashed), request ID
  • Log at entry and exit of every significant operation
  • Log errors with: exception type, message, stack trace, context
  • Never log PII, passwords, tokens, or credit card numbers
  • Log what happened, not just that it happened

Step 3: Key metrics

Implement the four golden signals for every service:

  • Latency - p50, p95, p99 response time
  • Traffic - requests per second, events per second
  • Errors - error rate (4xx, 5xx), error count
  • Saturation - CPU, memory, queue depth, connection pool

Add business metrics: active users, signups, payments, key conversions.

Step 4: Distributed tracing

  • Assign a trace ID to every inbound request
  • Propagate the trace ID to all downstream calls (outbound HTTP, database, queue)
  • Use OpenTelemetry or compatible SDK
  • Sample at 100% for errors; sample at 1–10% for success paths

Step 5: Health checks and readiness probes

  • /healthz - is the service alive?
  • /readyz - is the service ready to accept traffic?
  • Health checks must not perform significant work (no database writes)
  • Check downstream dependencies in readiness probe

Step 6: Alerting strategy

Alert on symptoms (user impact), not causes (CPU high):

  • High error rate → alert immediately
  • SLO breach approaching (error budget burn) → alert
  • Latency SLO exceeded at p99 → alert
  • Zero traffic (nothing coming in) → alert (might be upstream failure)

Do NOT alert on:

  • Things that resolve themselves
  • Things you can do nothing about at 3am
  • Things that don't affect users

Every alert must have a runbook.

Step 7: Dashboards

Build one dashboard per service with:

  • The four golden signals
  • Key business metrics
  • Recent deployments as annotations
  • Links to runbooks

Step 8: Runbooks

For each alert: what does it mean, what is the likely cause, what are the first 3 debugging steps, what is the escalation path?

Anti-Rationalizations

"We'll add monitoring after we know what's important to monitor" By the time you know what's important to monitor, you've already had the incident that taught you.

"Logs are enough - we don't need metrics" Logs tell you what happened. Metrics tell you what is happening right now at scale.

Verification Requirements

  • SLIs and SLOs defined
  • Structured JSON logging implemented
  • Four golden signals instrumented
  • Distributed tracing propagated
  • Health and readiness endpoints implemented
  • Alerts exist for SLO breach and high error rate
  • Every alert has a runbook
  • Dashboard built with golden signals + business metrics

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.