Skip to content

Migrating from prometheus client - MultiProcessCollector feature #4524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pavolloffay opened this issue Apr 2, 2025 · 4 comments
Open

Comments

@pavolloffay
Copy link
Member

pavolloffay commented Apr 2, 2025

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:

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

Slack

Would you like to implement a fix?

None

@aabmass
Copy link
Member

aabmass commented Apr 2, 2025

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.

@pavolloffay
Copy link
Member Author

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.

@aabmass
Copy link
Member

aabmass commented Apr 3, 2025

If you're using the Prometheus exporter, it is not supported today #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. #3307.

@pavolloffay
Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants