fix(prometheus-exporter): Concatenate metric attributes with Scope during collisions#3549
Merged
Merged
Conversation
Member
Author
|
Do we need a changelog entry if the bug wasn't released 🤔 ? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3549 +/- ##
=======================================
- Coverage 82.9% 82.8% -0.1%
=======================================
Files 130 130
Lines 27350 27510 +160
=======================================
+ Hits 22675 22800 +125
- Misses 4675 4710 +35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cijothomas
reviewed
Jun 10, 2026
| let mut keys_map = BTreeMap::<String, Vec<String>>::new(); | ||
| for (key, value) in kvs { | ||
| let key = utils::sanitize_prom_kv(key.as_str()); | ||
| if extra.iter().any(|label| label.name() == key) { |
Member
There was a problem hiding this comment.
The spec says this must be concatenated, not overridden.
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#metric-attributes
In such cases, the values MUST be concatenated together, separated by ;, and ordered by the lexicographical order of the original keys.
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
6a02bef to
341ef5d
Compare
Merged
via the queue into
open-telemetry:main
with commit Jun 20, 2026
69213f2
29 of 30 checks passed
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.
Follow up from #3503 (comment)
Changes
Small change so
extralabels always have preference over metric attributes inget_attributes. From my understanding, this will make sure Scope Name/Version/SchemaURL and attributes will always superseed metric attributesMerge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes