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

Stabilize Prometheus Exporter: Scope Info

Open johannaojeling opened this issue 7 months ago • 2 comments

As part of the initiative to stabilize the Prometheus Exporter spec, the Python SDK's Prometheus Exporter should introduce support for Scope Info configuration to align with the spec.

The current implementation status is documented in https://github.com/open-telemetry/opentelemetry-specification/issues/4989#issuecomment-4214459250.

johannaojeling avatar Apr 16 '26 08:04 johannaojeling

Hi, I'd like to work on this issue.

The spec (sdk_exporters/prometheus.md) defines a without_scope_info option (MAY, default false) to suppress both the otel_scope_info info metric and the otel_scope_name/otel_scope_version labels on data metrics. The Python exporter already has a without_target_info parameter — I'd implement without_scope_info following the same pattern.

Planned changes:

  • Add without_scope_info: bool = False to PrometheusMetricReader.__init__
  • Propagate it into _CustomCollector to gate both the otel_scope_info metric and scope labels
  • Add tests mirroring the existing without_target_info test cases

Happy to proceed if this approach looks good to maintainers. Note that spec issue #4989 is still in "Discussion Needed" — should I wait for that to land first, or is implementing the current draft wording acceptable?

ravitheja4531-cell avatar Apr 17 '26 21:04 ravitheja4531-cell

Thank you for offering your help @ravitheja4531-cell! It looks like there already is an open PR by @herin049 that will close this issue: https://github.com/open-telemetry/opentelemetry-python/pull/5123.

johannaojeling avatar Apr 20 '26 07:04 johannaojeling