Prometheus exporter does not work with multiprocessing

Open Beginner friendly
#3,747 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
prometheus, python

Research direction

Start in the Prometheus exporter documentation under exporter/opentelemetry-exporter-prometheus and review the linked prometheus_client multiprocess documentation. Document that multiprocess mode does not work with custom collectors and can cause metrics to be missing from the endpoint. Done means the limitation is clearly explained for users configuring multiprocessing.

Written by the indexing model from the issue text.

Description

bug doc help wanted

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.

Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
5d 29m
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from open-telemetry/opentelemetry-python

All issues in open-telemetry/opentelemetry-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.