Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Opentelemetry Tracing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-opentelemetry-tracing)
---
description: Instrument distributed services with OpenTelemetry spans, W3C trace propagation, sampling, and low-overhead exporters
profile: standard
tags: observability, tracing, opentelemetry, backend
---
# OpenTelemetry tracing
Use when setting up or extending distributed tracing across APIs, databases, queues, and workers.
## Spans and propagation
- Propagate W3C Trace Context (`traceparent`, `tracestate`) cleanly over HTTP headers and explicitly inject/extract trace headers in queue message envelopes.
- Create custom spans at meaningful service, external call, and workflow boundaries; keep inner tight loops out of per-iteration spans to curb overhead.
- Record errors with `span.recordException(err)` and set `SpanStatusCode.ERROR` while catching exceptions safely.
## Attributes and exporters
- Follow semantic conventions (`http.request.method`, `db.system`, `messaging.system`) and avoid high-cardinality values or secrets in span attributes.
- Use `BatchSpanProcessor` with bounded queues and shutdown flush hooks (`sdk.shutdown()`) so short-lived processes and serverless jobs do not drop final spans.
- Apply head/tail sampling cleanly (`TraceIdRatioBasedSampler` or collector tail sampling for errors/slow requests).
## Verify
Run requests with an in-memory/stdout `SimpleSpanExporter` in tests to assert parent-child span links, attributes, and error statuses.