open-telemetry / opentelemetry-specification

Specifications for OpenTelemetry
https://opentelemetry.io
Apache License 2.0
3.74k stars 888 forks source link

[Prometheus and OpenMetrics] Handle scheme URL and scope attributes as identifying #4223

Open pellared opened 1 month ago

pellared commented 1 month ago

I think this needs updates to some of the compatibility docs (at least prometheus). Currently, Prometheus adds scope name and scope version as labels to ensure we don't end up with duplicate timeseries, and we are able to put scope attributes in a separate otel_scope_info metric. With this change, we will need to update this to instead add the scope name, scope version, and scope attributes to all metrics.

TIL schema_url is also identifying, so that is something we will need to handle in Prometheus export and other "non-OTLP" compatibility documents.

Originally posted by @dashpole in https://github.com/open-telemetry/opentelemetry-specification/issues/4161#issuecomment-2361470786

pellared commented 1 month ago

@dashpole, are you able to take this?

dashpole commented 1 month ago

cc @open-telemetry/wg-prometheus

Yes, I'll take this

pellared commented 1 week ago

The idea is to add otel_scope_[attribute] and otel_scheme_url labels to metrics.

I will do my best to help with this issue.