Duplicated timeseries in CollectorRegistry with Multiprocess Gunicorn
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- docker, prometheus, python
- Domaine
- observability
Piste de recherche
Commencez par l’exemple de métriques multiprocess du README et par la configuration gunicorn.conf.py référencée, puis reproduisez l’échec en utilisant les paramètres du Dockerfile et les commandes Gunicorn indiqués. Le travail est terminé lorsque la cause de l’erreur de timeseries dupliquées est identifiée et que la configuration est documentée ou corrigée afin que /metrics continue de renvoyer des métriques.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I know this is a subject that comes up somewhat frequently but for the love of me I can't figure out what I'm doing wrong.
-
I have a service in Amazon ECS thats running a single task with multiple workers (actually the problem happens in my other service that just has one worker also).
-
I've created the directory and set the
PROMETHEUS_MULTIPROC_DIRin the Dockerfile:
RUN mkdir -p /tmp/prom-metrics
ENV PROMETHEUS_MULTIPROC_DIR /tmp/prom-metrics
- I'm using the sample code in the README to create the registry in the
/metricsrequest and return it:
registry = CollectorRegistry()
if getenv('PROMETHEUS_MULTIPROC_DIR'):
multiprocess.MultiProcessCollector(registry)
data = generate_latest(registry)
status = '200 OK'
response_headers = [
('Content-type', CONTENT_TYPE_LATEST),
('Content-Length', str(len(data))),
]
return Response(data, status, response_headers)
- I've created the
gunicorn.conf.pyfile with the sample from the README and passed it into my gunicorn startup script via-c:
from prometheus_client import multiprocess
def child_exit(server, worker):
multiprocess.mark_process_dead(worker.pid)
In my two services, gunicorn starts them as follows:
# app 1 with workers
gunicorn -c /app/utils/gunicorn.conf.py -b :5000 -t 3600 --keep-alive 60 --threads 8 --workers 3 app:app
# app 2 without workers
gunicorn -c /app/utils/gunicorn.conf.py -b :5000 -t 3600 --keep-alive 60 --threads 8 app:app
The service boots successfully and accepts some metrics which are definitely collected in multiprocess mode, seeing as the HELP line simply displays Multiprocess metric.
This works for a few calls but eventually I get the dreaded Duplicated timeseries in CollectorRegistry error and no additional metrics are populated.
What might I be doing wrong?
- Langage dominant
- Python
- Étoiles
- 4.4k
- Forks
- 876
- Merge moyen
- 8 j 4 h
- PR mergées (30 j)
- 1
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de prometheus/client_python
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
prometheus/client_python#1177 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
prometheus/client_python#1210 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 58/100
prometheus/client_python#1199 · 1 réaction ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
prometheus/client_python#1176 ·
-
WSL and MultiProcessCollectorOuverte
Difficulté 1/5 1-3 heures Accessibilité débutants 52/100
prometheus/client_python#1126 · 2 commentaires ·
Toutes les issues de prometheus/client_python
Issues similaires
-
correction metadata
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
acl-org/acl-anthology#10104 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug status/needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
prowler-cloud/prowler#12885 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed varianceOuvertebug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
selimfirat/pysad#107 ·
Les mainteneurs répondent en général sous 1 jour
-
bug ci-failure high priority
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
vllm-project/vllm-omni#8194 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour