Repository navigation
Add asynchronous Prometheus client - #336
git-arunjain wants to merge 2 commits into
Conversation
|
Thanks for this @git-arunjain — it's a thorough piece of work, and I appreciate that it comes with real tests and docs. I checked out the branch and ran it locally (Python 3.13 / aiohttp 3.14.5): 30 tests + 12 subtests pass, A few things need fixing before this can go in. The first one is the important one. Blocking1. The default-configured client has every timeout disabled and will hang forever
aiohttp's signature is Since async def blackhole(request):
await asyncio.sleep(3600)
async with AsyncPrometheusConnect(url=str(srv.make_url(""))) as p: # default timeout=None
await asyncio.wait_for(p.custom_query("up"), timeout=4)A consequence worth noting: the In fairness this isn't a regression — kwargs = {}
if request_timeout is not None:
kwargs["timeout"] = aiohttp.ClientTimeout(total=request_timeout)
async with session.request(..., **kwargs) as response:or set it once on the session in Related, same area: 2.
|
Thanks @4n4nd for the detailed review. I've pushed an update addressing the four blocking items:
Extended the lazy-import tests to cover the optional aiohttp dependency. The async tests and lazy-import tests are passing. |
Summary
Testing
Closes #298