Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Collision handling uses the generated Info family’s internal name and type rather than its Prometheus text representation, causing incorrect drops and missed collisions.
1 open issue
What changed in this PR
This PR advances #1841 by handling metric-family collisions in the Prometheus exporter, reducing duplicate metadata across instrumentation scopes.
Changes:
- Merge families with matching translated names and types, keeping the first description and warning on differences.
- Drop conflicting metric types and skip empty point collections.
- Add collision regression coverage and a changelog entry.
| File | Description |
|---|---|
| exporters/prometheus/test/exporter_utils_test.cc | Tests cross-scope merging, description retention, and type-conflict dropping. |
| exporters/prometheus/src/exporter_utils.cc | Adds family indexing, collision handling, and an empty-point guard. |
| CHANGELOG.md | Documents the exporter behavior change under Unreleased. |
Review effort: Balanced
dashpole
force-pushed
the
prom-metric-collisions-1841
branch
2 times, most recently
from
October 25, 2026 16:12
2daf2ce to
4cbcfa3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4736 +/- ##
==========================================
+ Coverage 86.69% 86.70% +0.02%
==========================================
Files 527 527
Lines 20902 20916 +14
==========================================
+ Hits 18119 18134 +15
+ Misses 2783 2782 -1
🚀 New features to boost your workflow:
|
dashpole
marked this pull request as ready for review
October 26, 2026 13:48
…nd drop conflicting metric types Update PrometheusExporterUtils::TranslateToPrometheus to conform to the Metric Metadata section of the OpenTelemetry Prometheus and OpenMetrics compatibility specification: - Merge metrics across scopes (or unit/suffix-stripped instruments) that map to the same Prometheus metric name and MetricType into a single MetricFamily, retaining the first HELP description and logging a warning on description mismatch. - Drop metrics that map to an existing Prometheus metric name with a conflicting MetricType and log a warning. Part of open-telemetry#1841
dashpole
force-pushed
the
prom-metric-collisions-1841
branch
from
October 26, 2026 18:17
8f8f295 to
d763e4d
Compare
2 tasks done
This branch has not been deployed
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.

Part of #1841
Changes
Update
PrometheusExporterUtils::TranslateToPrometheusto conform to the Metric Metadata section of the OpenTelemetry Prometheus and OpenMetrics Compatibility Specification:MetricTypeinto a singleMetricFamilyso duplicate# HELPand# TYPEheaders are not emitted. When descriptions differ, retain the firstHELPdescription and log a warning.MetricTypeand log a warning.(Pre-existing bug fixes have been split into #4738.)
For full trivial changes below, please confirm you have:
clang-formatCHANGELOG.mdif applicable