Skip to content
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

hypercorn with several workers #89

Open
ninanomenon opened this issue Jun 7, 2023 · 4 comments
Open

hypercorn with several workers #89

ninanomenon opened this issue Jun 7, 2023 · 4 comments

Comments

@ninanomenon
Copy link

I would like to start my quart application with several workers, but this is not so easy in connection with aioprometheus, because each worker has its own state.

In the official prometheus client library this can be solved like this: https://github.com/prometheus/client_python#multiprocess-mode-eg-gunicorn

How can I solve this?

@claws
Copy link
Owner

claws commented Jun 11, 2023

I think I understand the problem you are trying to solve. The aioprometheus package does not support using it like how you point out the official prometheus client library (which I think looks pretty complicated) accommodates this problem. I've simply exposed the metrics from each worker when I've run a FastAPI server with uvicorn (similar to what you are doing with Quart and Hypercorn). Like you noticed, they each have their own state.

@ninanomenon
Copy link
Author

But doesn't it make the metrics unstable because so another worker keeps responding?

@rroque6428
Copy link

Any news on this? I agree with @L1F. State should be unique across all workers, since the scraping will hit once to collect all metrics in a consolidate way.

@gonzaloetjo
Copy link

gonzaloetjo commented Jun 6, 2024

Also waiting for an update on this. Not sure if you found a way @L1F

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants