Prometheus exporter: Handle attribute key collisions from sanitization #2290
Labels
bug
Something isn't working
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Is your feature request related to a problem?
From https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#metric-attributes,
Describe the solution you'd like
One solution is to group colliding keys, and then join them with
;
, like the go exporter does:https://github.com/open-telemetry/opentelemetry-go/blob/02616a25c68e674a04df01a1b7ba185a2db8cd5a/exporters/prometheus/exporter.go#L284-L305
Another solution is to sort the keys first, and then check whether it collides with the key from the previous iteration, like i'm working on in java: open-telemetry/opentelemetry-java#5717
The text was updated successfully, but these errors were encountered: