prometheus / prometheus/client_python

Does GCCollector work in multiprocess mode?

Open
#653 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.4k
Forks
876
Avg merge
8d 4h
Merged PRs (30d)
1

Description

Hi all,

First of all sorry if the question is kinda stupid, I would not ask if the answer was evident somewhere to me, but I'm interested to find out does GC reporting works in multiprocess (gunicorn) mode of work. As when I have used this client in multiprocess mode with gunicorn I did not get any metrics about GC at all out of the box, I needed to write my own metric.

I took a look through old issues at this project and managed to find some related to this problem:

And I saw that implementation of GCCollector uses get_stats() from Python module, there is no custom callback in this code (lock is still there to manage files) so I'm somewhat confused does this work or not, because, it seems to me that this gc.get_stats can be used as any other metric where you would report GC metrics per PID (this is little too much of data but still) and just for example set gauge to some value when reporting.

AM I missing something here or?

Thank you :)

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.

Research direction

Start by inspecting the GCCollector implementation and Python's gc.get_stats() behavior in gunicorn multiprocess mode. Compare the findings with the related issue #322 and determine whether GC metrics are expected to work; document the supported behavior or identify the specific change needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.