oss_18_prometheus_openmetrics_compat - #35
Conversation
|
🔒 Internal (dash0) — not for upstream.
|
|
📣 Public-facing draft — to be used for the upstream PR in Title: Improve Prometheus/OpenMetrics compatibility in the Prometheus exporter WhatBrings the Prometheus exporter closer to the Prometheus and OpenMetrics compatibility specification, matching Go/Java. All changes within
WhyThe exporter previously dropped exemplars, lost attributes on sanitization collisions, could emit invalid exposition when two metrics shared a name with different types, allowed reserved scope labels to be overwritten, and offered no way to disable the Spec
TestsUnit tests for every behavior (merged colliding keys; exemplars on counters and histograms; |
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
Bring the Prometheus exporter closer to the Prometheus and OpenMetrics compatibility specification, matching behaviors already present in the Go and Java implementations: - Merge attributes whose sanitized keys collide instead of overwriting each other; colliding values are semicolon-joined, sorted by the original key. - Emit exemplars on counters and histograms, mapping OpenTelemetry exemplars to prometheus_client exemplars (trace_id/span_id labels, hex-encoded). - Add a without_counter_suffixes option to suppress the _total suffix on counter metrics. - Detect same-name metric families with conflicting Prometheus types, drop the conflicting family, and log a warning. - Skip data point attributes that sanitize to a reserved otel_scope_* label so scope-provided values are not clobbered. Add unit tests covering each behavior and a changelog fragment.
617bf98 to
0885bc1
Compare
Closes #29
Prometheus/OpenMetrics compatibility bundle (Linear OSS-18, findings M5-M9): merge colliding sanitized attribute keys (
;-joined, sorted); emit exemplars on counters/histograms; addwithout_counter_suffixes; drop same-name conflicting-type families with a warning; protect reservedotel_scope_*labels.Validation: scope contained to the prometheus exporter package + changelog; exporter suite 38 passed (31 existing + 7 new).
Linear issue: https://linear.app/dash0/issue/OSS-18/m5-m9-prometheusopenmetrics-compatibility-bundle