-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics disappear when setting PROMETHEUS_MULTIPROC_DIR #282
Comments
Any updates, I am facing the same issue as well. |
How did you set the environment variable? If you added it in the code using |
I'm running into a similar issue. In my case the PROMETHEUS_MULTIPROC_DIR is set in the environment that FastAPI is started from. My instrumentator setup is pretty simple:
and then in the api startup I run The process metrics were working before setting PROMETHEUS_MULTIPROC_DIR but I need to set that as I've got multiple workers running which was messing with the metrics scraping |
Hello, I'm facing the same issue.
|
I'm serving my FastApi application using more than one worker. For this, I had to set
PROMETHEUS_MULTIPROC_DIR
and make sure it points to a proper directory, so that all workers can read/write metrics there.However, I noticed that the resulting
/metrics
endpoint exposes way less metrics than if I don't do this. For instance, metrics related to the garbage collector, the process information (CPU, GPU utilization), python version, etc, are not exposed anymore. All I see now are metrics related to the HTTP requests and responses.Any ideas why? Am I doing something wrong?
These are the metrics I get when running with more than one worker:
These are the ones I get when running only with one worker (and thus, not using
PROMETHEUS_MULTIPROC_DIR
):This is the code I'm using to register the instrumentator:
The text was updated successfully, but these errors were encountered: