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

Prometheus exporter does not work with multiprocessing

Open bastbu opened this issue 1 year ago • 0 comments

Describe your environment

When instrumenting metrics using OpenTelemetry Python 0.44b0 and exporting them using opentelemetry-exporter-prometheus when using multiprocessing, not all metrics are exposed on the metrics endpoint.

I assume that this comes from the underlying limitation from prometheus_client, which states that multiprocess mode does not work with custom collectors. It could be worth mentioning this limitation in the Prometheus exporter docs.

Steps to reproduce

  • Raise metrics in multiprocessing mode when having the Prometheus exporter enabled
  • Not all metrics are exposed on Prometheus endpoint

What is the expected behavior?

All raised metrics are exposed on the Prometheus endpoint.

What is the actual behavior?

Not all metrics are exposed on the Prometheus endpoint.

bastbu avatar Mar 02 '24 07:03 bastbu