Skip to content

fix(prometheus): handle metric label key collisions per OpenMetrics specification - #5940

Open
YuvrajLamba01 wants to merge 1 commit into
open-telemetry:mainfrom
YuvrajLamba01:fix/prometheus-label-collisions-3928
Open

YuvrajLamba01 wants to merge 1 commit into
open-telemetry:mainfrom
YuvrajLamba01:fix/prometheus-label-collisions-3928

Conversation

@YuvrajLamba01

@YuvrajLamba01 YuvrajLamba01 commented Nov 15, 2026 •

Copy link
Copy Markdown

Description

Fixes #3928

Per the OpenTelemetry Prometheus/OpenMetrics compatibility specification, when multiple attribute keys sanitize to identical Prometheus label names, their values must be joined with ; ordered lexicographically by original attribute keys rather than overwriting earlier values.

  • Group sanitized label keys in _collect_data_points\ and _create_info_metric.
  • Order colliding pairs by original key and concatenate with ;.
  • Add test coverage for sum, gauge, and target info collisions.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I am a human and not a bot
  • I have run \ ox -e precommit\
  • I have run \ ox -e typecheck\
  • I have run the relevant tests and linting tox environments

@YuvrajLamba01
YuvrajLamba01 requested a review from a team as a code owner November 15, 2026 08:51
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: YuvrajLamba01 / name: Yuvraj Lamba (5217b42)

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-15 11:31 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@YuvrajLamba01

Copy link
Copy Markdown
Author

/dashboard route:reviewers

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

@YuvrajLamba01, this pull request was routed to reviewers. The handoff remains active across pushes until newer actionable human feedback arrives. Top-level feedback through this request will not return; unresolved review threads remain open.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Prometheus exporter should handle metric label key collisions

1 participant