Agent skill
request-tracing
Instrument HTTP/gRPC endpoints with distributed tracing and RED metrics
Install this agent skill to your Project
npx add-skill https://github.com/nexus-labs-automation/backend-observability/tree/main/skills/request-tracing
SKILL.md
Request Tracing
Every request needs: a span, RED metrics, and trace context propagation.
Required Attributes
| Attribute | Example | Note |
|---|---|---|
http.method |
GET, POST | Required |
http.route |
/api/orders/:id | Template, not actual path! |
http.status_code |
200, 500 | Required |
user.tier |
premium | Recommended (not user_id!) |
RED Metrics
Rate: http.requests.count{method, route, status}
Errors: http.requests.errors{method, route, error_type}
Duration: http.request.duration{method, route} (histogram p50/p95/p99)
Middleware Flow
Request → Extract trace context (W3C traceparent)
→ Start span (method + route)
→ Start timer
→ Call handler
→ Set status_code
→ Record duration histogram
→ If 4xx/5xx: increment error counter
→ End span
→ Inject trace context into response
Context Propagation
Critical: Always propagate to downstream services:
// Outgoing request
propagator.inject(ctx, headers)
Common Mistakes
- Using actual path →
/api/orders/12345creates millions of unique values - Missing propagation → Traces break at service boundaries
- Only tracking success → Must track errors with
error_type
References
references/methodology/red-methodology.mdreferences/platforms/{platform}/http.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
slo-alerting
Define SLIs, SLOs, and implement burn-rate alerting
health-checks
Implement liveness, readiness, and dependency health checks
cache-observability
Track cache hit rates, latency, and detect cache-related issues
error-handling
Capture errors with rich context for debugging and alerting
database-observability
Instrument database queries, connection pools, and detect N+1 queries
instrumentation-planning
Plan backend observability using RED + USE + 4 Golden Signals + JTBD
Didn't find tool you were looking for?