Prompt
How do I troubleshoot missing spans in OpenTelemetry
Latest observation
Troubleshooting missing OpenTelemetry spans usually comes down to one of a few categories: instrumentation not running, spans not being sampled, spans not being exported, or spans being dropped/filtered downstream.
Here’s a practical checklist.
1) Confirm instrumentation is actually enabled
- Make sure the app is using the OpenTelemetry SDK/agent and not just the API.
- Verify auto-instrumentation is loaded if you expect it.
- Check that the tracer provider and exporter are initialized early enough in app startup.
Common issue: spans created before OTel is initialized are never captured.
2) Check sampling
If sampling is enabled, some spans may not appear by design.
- Look at the configured sampler:
AlwaysOn/ParentBased(AlwaysOn)→ most spans should appearTraceIdRatioBased(0.1)→ only ~10% of traces show up
- If parent span is dropped, child spans may also be dropped depending on sampler behavior.
Test: temporarily set sampling to 100% and see if missing spans appear.
3) Verify the exporter is working
If spans are created but not sent, the exporter may be failing.
- Check logs for exporter errors or retries.
- Confirm endpoint/collector address is correct.
- Validate protocol:
- OTLP/gRPC vs OTLP/HTTP
- correct port and path
- Check TLS/auth headers if using a secured collector.
Examples of failures:
- wrong endpoint
- DNS/network connectivity issues
- collector not listening on the expected port
- invalid auth token
4) Look for span flushing/shutdown issues
Spans may never get exported if the app exits too quickly.
- Ensure the SDK is flushed on shutdown.
- Give batch processors time to export before process exit.
- In short-lived jobs, use force flush or shutdown hooks.
Common issue: serverless or CLI apps exit before the batch exporter flushes.
5) Check span limits and drops
The SDK may drop spans if limits are exceeded.
- Max attributes, events, links, or queued spans may be capped.
- Batch span processor queue may overflow under load.
- Inspect SDK metrics/logs for dropped spans.
6) Verify context propagation
Sometimes spans exist, but they’re disconnected or not nested as expected.
- Ensure trace context is propagated across threads, async tasks, queues, HTTP calls, etc.
- Check for missing headers:
traceparenttracestate
- Ensure baggage/context is passed correctly in your framework.
Symptom: spans show up, but as separate traces instead of one trace.
7) Check if spans are filtered or transformed
Something in the pipeline may be dropping them:
- collector processors
- tail sampling
- attribute-based filters
- backend ingestion rules
Inspect your OpenTelemetry Collector config for:
filterprocessorprobabilistic_samplingtail_samplingattributesprocessor that may remove data
8) Compare with debug/logging export
A good way to isolate the problem:
- enable console/debug exporter in addition to your normal exporter
- if spans appear in console but not in backend, the issue is downstream
- if they don’t appear in console either, the issue is in instrumentation or SDK config
9) Check resource attributes and service identity
Sometimes spans are there but hard to find due to incorrect service metadata.
- Confirm
service.name - Confirm environment, version, instance attributes
- Look for data under the wrong service in your backend
10) Examine version compatibility
Mismatch between SDKs, instrumentation libraries, collector, and backend can cause issues.
- Upgrade to compatible versions
- Check OTLP protocol support
- Verify any language-specific auto-instrumentation limitations
Fast debugging sequence
If you want a quick path:
- Set sampling to 100%
- Enable console export
- Verify spans appear locally
- Check exporter endpoint and collector logs
- Confirm shutdown/flush
- Inspect collector filters/sampling
- Check backend ingestion and service name
If you want, I can also help you troubleshoot by language/runtime
For example:
- Java
- Python
- Node.js
- .NET
- Go
- Rust
- OpenTelemetry Collector
If you tell me your language, exporter, and where the spans disappear, I can give you a targeted checklist.