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

Is it fully async and non-blocking? #59

Open
stephanecollot opened this issue Jan 31, 2024 · 2 comments
Open

Is it fully async and non-blocking? #59

stephanecollot opened this issue Jan 31, 2024 · 2 comments

Comments

@stephanecollot
Copy link

Hello,

I'm currently using aioprometheus in a FastAPI Uvicorn app, but the metric exposure is blocking all the routes:
claws/aioprometheus#98

Looking at the official client, it seems that they added async ASGI metric exposure. But I don't know if their metrics update will then be blocking. I didn't try it yet.
See prometheus/client_python#512

So I would like to know if prometheus-async is non-blocking for metrics update and metrics exposure, i.e. these two operations won't block execution of other HTTP requests.

@hynek
Copy link
Owner

hynek commented Jan 31, 2024

What do you understand under "blocking" exactly? In the context of async, we usually call things blocking that block on I/O. Purely computational overhead is not considered blocking.

Without double-checking, I suspect our start_http_server_in_thread should do what you're asking for?

@hynek
Copy link
Owner

hynek commented Feb 5, 2024

oh and see #13!

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

2 participants