open-telemetry / open-telemetry/opentelemetry-python
Prometheus exporter handles instrumentation scope and prevents collisions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
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_nameandotel_scope_versionattributes to all metrics based on the instrumentation scope name and version. - Add an
otel_scope_infometric 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Prometheus exporter in the opentelemetry-python repository and read the linked OpenTelemetry compatibility sections on instrumentation scope and metric metadata. Verify how instrumentation scope is currently represented, then implement the requested scope attributes, otel_scope_info metric, and collision prevention. Done means all three behaviors follow the specification by default, with any disabling option documented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- prometheus, python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100