opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Prometheus exporter handles instrumentation scope and prevents collisions

Open dashpole opened this issue 2 years ago • 2 comments

Now that https://github.com/open-telemetry/opentelemetry-specification/pull/2703 is released, we can update the prometheus exporter to make use of OpenTelemetry scope, particularly for reducing collisions between metrics with the same name.

Describe the solution you'd like

There are a few components:

  • Add otel_scope_name and otel_scope_version attributes to all metrics based on the instrumentation scope name and version.
  • Add an otel_scope_info metric following https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1.
  • Prevent collisions between TYPE, HELP, and UNIT comments following https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#metric-metadata-1

Note that the exporter SHOULD do the above by default, but may allow disabling the behavior.

dashpole avatar Dec 05 '22 18:12 dashpole

This issue was marked as stale due to lack of activity.

github-actions[bot] avatar Feb 04 '23 01:02 github-actions[bot]

I'll work on this one, if thats alright

dashpole avatar Sep 01 '23 19:09 dashpole