Prompt
I’m troubleshooting missing spans in OpenTelemetry traces
Latest observation
Oct 20, 2026
OpenAI APIWeb search: off
Got it — “missing spans” in OpenTelemetry usually comes down to one of a few areas: instrumentation, context propagation, sampling, batching/export, or backend-side filtering.
Here’s a practical troubleshooting checklist:
1) Confirm the spans are actually being created
- Enable debug logging for your SDK / auto-instrumentation.
- Look for span start/end events or exporter logs.
- If you create spans manually, verify the code path is reached.
2) Check context propagation
Missing child spans often mean the trace context isn’t flowing correctly.
- Verify propagation across:
- HTTP headers
- gRPC metadata
- async tasks / thread pools
- message queues
- Common issues:
- context lost in new threads
- forgetting to inject/extract headers
- using incompatible propagators
3) Inspect sampling
The spans may exist but be dropped by sampling.
- Check:
- parent-based vs always-on sampling
- head sampling rate
- tail sampling policies in collector/backend
- If the root span is sampled out, children won’t appear.
4) Verify the exporter and collector
- Ensure the SDK exporter can reach the collector/backend.
- Check collector logs for:
- dropped spans
- queue overflows
- timeouts
- auth errors
- Confirm the endpoint, protocol, and port are correct (OTLP gRPC vs HTTP).
5) Look for batch/flush issues
Spans may be created but never exported if the process exits too quickly.
- Use a batch span processor with flush/shutdown handling.
- In short-lived jobs/functions:
- force flush before exit
- wait for exporter completion
6) Check span limits / truncation
Some spans can be dropped or reduced due to limits:
- attribute count limits
- event/link limits
- max span size in backend
- name/attribute filtering
7) Compare expected vs actual topology
Sometimes spans aren’t missing — they’re in a different trace due to broken propagation.
- Search by service name, operation name, or trace ID if available.
- Look for multiple root spans where you expected one trace.
8) Validate instrumentation order
For auto-instrumentation:
- make sure it initializes before libraries are loaded/used
- check whether a framework version is supported
- confirm no conflicting instrumentation packages
If you want, I can help you debug this systematically. Tell me:
- language/runtime
- SDK or auto-instrumentation you’re using
- exporter/collector/backend
- whether the missing spans are parent/child spans or entire traces
- any relevant logs or config snippets
And I can narrow it down quickly.