Repository navigation
Give Prometheus exemplar trace_id and span_id precedence over filtered attributes - #8959
Merged
jack-berg merged 1 commit intoOct 19, 2026
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-19 19:14 UTC Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8959 +/- ##
=========================================
Coverage 90.40% 90.41%
- Complexity 10898 10901 +3
=========================================
Files 1015 1015
Lines 29843 29842 -1
Branches 3896 3896
=========================================
+ Hits 26981 26982 +1
Misses 1910 1910
+ Partials 952 950 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jack-berg
approved these changes
Oct 19, 2026
Contributor
|
Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8958
Description
Otel2PrometheusConverter.convertAttributes()added exemplartrace_id/span_idwithputIfAbsentafter the filtered attributes, so a filtered attribute with the same label name (trace_id, ortrace.idafter escaping) replaced the span context ids.putinstead so the span context ids win. Scope and resource labels keepputIfAbsent; only exemplar conversion passes additional attributes.trace_id/span_idMUST take precedence over filtered attributes (Prometheus: Stabilize OpenTelemetry Exemplar to Prometheus Exemplar opentelemetry-specification#4964).Testing done
Otel2PrometheusConverterTest#exemplarSpanContextLabelsTakePrecedencewith two cases:trace_id/span_idkeys andtrace.id/span.idkeys.expected: "00000000000000000000000000000001" but was: "bogus"); after the fix both pass../gradlew :exporters:prometheus:checkpassed (221 tests, 0 failures, 3 skipped).