debug-with-traces
Skill1 starsChanged 2 months agoMITView on GitHub
Use traces, metrics, and logs to locate a production problem — start from the symptom in Grafana, find exemplar traces in Tempo, walk the span tree to the slow or failing hop, correlate with logs by trace_id. Use when something is slow or erroring in prod and you have telemetry, or when asked to "check the traces / dashboards" / "why is X slow in prod".
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bigquery-analyticsSkill
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- redis-patternsSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- data-migrationSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-eventSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- rebase-cleanSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- kafkaSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
Files
Debug with traces
The telemetry-first counterpart to incident/investigate-bug (which
assumes local reproduction). Here the mechanism is found in prod data first, then
confirmed.
Order of operations
- Pin the symptom in metrics. Grafana: which endpoint / consumer, since when, what changed at that time (a deploy? traffic shift? a dependency?). Get the RED picture — is it rate, errors, or duration, and at which percentile.
- Get exemplar traces. From the metric (exemplars) or Tempo search: filter by
service + operation +
status=errororduration > p99. Grab a handful of representative bad traces and a good one for comparison. - Walk the span tree. In a bad trace, find where the time goes or where the
error originates:
- one child span eating the wall time → that hop (DB query, downstream call, lock wait, external API).
- a gap between spans → un-instrumented work, or queue/scheduler delay.
- error status deep in the tree → the origin; the outer errors are propagation.
- fan-out (N identical child spans) → N+1 or unbatched loop.
- Correlate with logs. Pull Loki logs for that
trace_id— the log lines around the bad span usually name the specific failure (timeout, constraint, nil, retry storm). - Compare good vs bad. Same trace shape? A bad trace missing a cache-hit span (cache miss path), or with an extra retry loop, tells you the branch.
- Form the hypothesis, state the mechanism, then confirm — reproduce locally if you can, or watch the metric after a targeted change.
Common shapes
- p99 spike, p50 flat → tail latency: a slow replica, GC pauses, a lock, connection-pool exhaustion under burst.
- Error rate step at a deploy time → the deploy; check its diff.
- Latency climbs over hours then resets on restart → a leak (connections, goroutines, timers, a growing cache).
- Downstream span slow → their problem or your call pattern (no timeout, no batching, retrying too hard).
Anti-patterns
- ❌ Staring at one trace without the metric context (is it representative?).
- ❌ Blaming the outermost error span instead of walking to the origin.
- ❌ Not comparing against a healthy trace.
- ❌ Concluding from telemetry without confirming the mechanism.
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
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.

