stephenhillier / starlette_exporter

Prometheus exporter for Starlette and FastAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for multiple gunicorn workers.

kiwimic opened this issue · comments

I just discovered this problem when I was stress testing my fastapi. When I send 1000 requests in logs I get them all, stress test tools shows also 1000 success 200 code, but prometheus shows only around 25% of request in metrics. It's like it scrap only from 1st or random worker. Is this possible to solve this problem with starlette_exporter? Do you have any idea on workaround?

Linking orginal issue on: issue

@kiwimic Can you try the Gunicorn instructions here https://github.com/stephenhillier/starlette_exporter#multiprocess-mode-gunicorn-deployments? There's also more detailed info in the Prometheus python client docs https://github.com/prometheus/client_python#multiprocess-mode-eg-gunicorn.

Let me know how it works, it might be helpful to make this more clear in the docs (if this is actually the issue).