hynek / prometheus-async

Async Python helpers for the official prometheus-client.

Home Page:https://prometheus-async.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it fully async and non-blocking?

stephanecollot opened this issue · comments

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.

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?

oh and see #13!