opentelemetry-python
opentelemetry-python copied to clipboard
Migrating from prometheus client - MultiProcessCollector feature
Is your feature request related to a problem?
Hello, we are considering migrating metrics instrumentation from the prometheus client. However the project depends in MultiProcessCollector:
- https://prometheus.github.io/client_python/multiprocess/
- https://github.com/prometheus/client_python/blob/master/prometheus_client/multiprocess.py#L19C7-L19C28
The feature does not seem to be available in the OpenTelemetry python.
Describe the solution you'd like
Support multi process mode in the OTEL python SDK for metrics
Describe alternatives you've considered
No response
Additional Context
Would you like to implement a fix?
None
Support multi process mode in the OTEL python SDK for metrics
It sounds like you want to continue using Prometheus exporter/being scraped, is that right?
If sending OTLP to the prometheus server is an option for you (push), you can add a unique identifier to the service.instance.id to identify each process.
The use case we solve with the Multiprocess Mode is to avoid reporting duplicated metrics by each process. The registry reports a single metric from multiple processes.
If you're using the Prometheus exporter, it is not supported today https://github.com/open-telemetry/opentelemetry-python/issues/3747
What I mentioned above is your best option today. There are several issues in the backlog already for improving this with push metrics e.g. https://github.com/open-telemetry/opentelemetry-python/issues/3307.
Thanks for the confirmation. We required prometheus exporter.
If sending OTLP to the prometheus server is an option for you (push), you can add a unique identifier to the service.instance.id to identify each process.
In case of OTLP exporter, can the SDK aggregate metrics from multiple processes like the prometheus client multiprocess/ feature?