agentleFS
erumkatzwanerumkatzwan/agentic-product-starter/.agents/skills/observability/SKILL.md

observability

Skill5 starsChanged 19 days agoMITView on GitHub

Use when adding a feature that should be measured, when debugging a problem in Dev, SYST or Prod, when connecting Grafana Cloud or Sentry for an environment, or on request ("add metrics", "why is it slow", "set up monitoring"). Covers OpenTelemetry in the backend, the local Grafana stack, dashboards and crash reporting.

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 9 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

  • 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

  • SentrySkill

    feature-flags

    Gate a Sentry feature behind a FlagPole feature flag. Use when adding a feature flag, registering a flag in temporary.py, checking a flag from Python or the frontend, enabling a flag in tests, or asking where FlagPole rollout config lives. Trigger on "add a feature flag", "gate this behind a flag", "register a flag", "features.has", "api_expose", "OrganizationFeature", "ProjectFeature", "FlagPole".

    Also in 9 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Read ADR-0008 and observability/README.md first.

    line 8
  2. Distinctive:

    Ask: "How will we know this feature works and is used?" Then:

    line 21
  3. Very specific:

    Product metric: Add a counter (events) or histogram (durations, sizes) to backend/src/AgenticProduct.Api/Observability/AppMetrics.cs.

    line 23
  4. Very specific:

    Logs: use ILogger with message templates ("Order {OrderId} placed"), never string concatenation, never personal data.

    line 27
  5. Very specific:

    Dashboard: add a panel to observability/grafana/dashboards/api-overview.json (or a new dashboard), filtered with job=~"$service", …

    line 29
  6. Very specific:

    Run the stack, click through the feature, and check the panel shows data.

    line 30
  7. Distinctive:

    Never commit endpoints with tokens, DSNs for Prod, or Grafana API keys.

    line 37

“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

Read ADR-0008 and observability/README.md first.

1. Run the stack locally

docker compose -f observability/docker-compose.yml up -d
cd backend && dotnet run --project src/AgenticProduct.Api --launch-profile Dev

Grafana: http://localhost:3000 (admin / admin). Use Explore → Tempo for a slow or failing request, then jump to its logs.

2. Instrument a new feature

Ask: "How will we know this feature works and is used?" Then:

  1. Product metric. Add a counter (events) or histogram (durations, sizes) to backend/src/AgenticProduct.Api/Observability/AppMetrics.cs.
    • Name: app.<noun>.<verb in past tense> or app.<noun_plural>, lower case with dots and underscores, for example app.orders.placed.
    • Tags: a few low-cardinality values only (result, plan, platform). Never user IDs, emails or free text.
  2. Call it where the event happens (endpoint or service), and cover it with a test that listens with MeterListener (see ObservabilityTests.cs).
  3. Logs: use ILogger with message templates ("Order {OrderId} placed"), never string concatenation, never personal data.
  4. Traces: incoming requests and HttpClient calls are traced already. For a slow internal step, add an ActivitySource span named after the step.
  5. Dashboard: add a panel to observability/grafana/dashboards/api-overview.json (or a new dashboard), filtered with job=~"$service", deployment_environment_name=~"$environment". Prometheus names: dots become underscores and counters end in _total (app_orders_placed_total).
  6. Run the stack, click through the feature, and check the panel shows data. CI's Observability smoke test runs every dashboard query and fails on empty ones, so add traffic for new endpoints to .github/workflows/observability.yml.

3. Connect an environment

  • Backend → Grafana Cloud: set OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf and OTEL_EXPORTER_OTLP_HEADERS as secrets on the host (steps in observability/README.md). Import the dashboards.
  • Apps → Sentry: one Sentry project per app, one DSN per environment, set at build time. No DSN means reporting is off.

Never commit endpoints with tokens, DSNs for Prod, or Grafana API keys.

4. Review checklist

  • New user-facing behaviour has a metric and a dashboard panel
  • No personal data in spans, tags or logs
  • Tag values are low-cardinality
  • Errors are logged once, where they are handled, with the exception attached
  • Observability smoke test is green

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.