Async helpers for prometheus_client.
It works by wrapping the metrics from the official client:
import asyncio from aiohttp import web from prometheus_client import Histogram from prometheus_async.aio import time REQ_TIME = Histogram("req_time_seconds", "time spent in requests") @time(REQ_TIME) async def req(request): await asyncio.sleep(1) return web.Response(body=b"hello")
Even for synchronous applications, the metrics exposure methods can be useful since they are more powerful than the one shipped with the official client. For that, helper functions have been added that run them in separate threads (asyncio-only for the time being).
- Passing a loop argument to prometheus_async.aio.start_http_server() is a no-op and raises a DeprecationWarning now.
- Port to aiohttp’s application runner APIs to avoid those pesky deprecation warnings. As a consequence, the loop argument has been removed from internal APIs and became a no-op in public APIs.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|prometheus_async-18.2.0-py2.py3-none-any.whl (16.5 kB) Copy SHA256 hash SHA256||Wheel||py2.py3||May 29, 2018|
|prometheus_async-18.2.0.tar.gz (27.1 kB) Copy SHA256 hash SHA256||Source||None||May 29, 2018|