-
Notifications
You must be signed in to change notification settings - Fork 805
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
OS: Ubuntu
Python version: Python 3.12.7
Package version: 1.38.0/0.59b0
An app instrumented with FlaskInstrumentor via auto-instrumentation.
What happened?
If exemplars are enabled (by setting exemplar filter), some metrics generated by some instrumentors export incomplete exemplars that have timestamps and values, but are missing trace ID and span ID (not very useful). Specific metrics affected include semconv-defined http.server.request.duration and http.server.duration from FlaskInstrumentor histogram record calls.
Steps to Reproduce
- Follow the example and provide MeterProvider with
exemplar_filter=AlwaysOnExemplarFilter. - Run an otel-collector locally with
debugmetrics export. - Auto-instrument and run a Flask app, with a route that responds after about 500ms.
- Make requests to that route and check exported metrics.
Expected Result
otel-collector-1 | Exemplars:
otel-collector-1 | Exemplar #0
otel-collector-1 | -> Trace ID: <a_valid_trace_id>
otel-collector-1 | -> Span ID: <a_valid_span_id>
otel-collector-1 | -> Timestamp: 2025-10-31 22:30:24.370148763 +0000 UTC
otel-collector-1 | -> Value: 500
Actual Result
Trace ID and Span ID are empty:
otel-collector-1 | Exemplars:
otel-collector-1 | Exemplar #0
otel-collector-1 | -> Trace ID:
otel-collector-1 | -> Span ID:
otel-collector-1 | -> Timestamp: 2025-10-31 22:30:24.370148763 +0000 UTC
otel-collector-1 | -> Value: 500
Additional context
Related to
- Metrics: Add support for exemplars opentelemetry-python#2407
- Add exemplar support to all WSGI based instrumentations #2158
- Fix exemplar support #3031
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
cheempz
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working