Open boatcoder opened 5 months ago
Hi. I had the same issue. I solved it by adding code to gunicorn config file:
from prometheus_client import CollectorRegistry, multiprocess
def when_ready(_):
multiprocess.MultiProcessCollector(CollectorRegistry())
def child_exit(_, worker):
multiprocess.mark_process_dead(worker.pid)
Additionally, an environment variable PROMETHEUS_MULTIPROC_DIR
has to be set to some empty dir. This is used to synchronize between workers.
I'm not sure how to read multiple processes per process. Is this supposed to be multiple threads per process?