Async helpers for prometheus_client.
Project description
prometheus-async
prometheus-async adds support for asynchronous frameworks to the official Python client for the Prometheus metrics and monitoring system.
Currently asyncio and Twisted on Python 3.7 and later are supported.
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).
The source code is hosted on GitHub and the documentation on Read The Docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prometheus-async-22.2.0.tar.gz
(35.3 kB
view hashes)
Built Distribution
Close
Hashes for prometheus_async-22.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cbfa535561342b834c087c4f3f3be0a3cb8785a0b8748111c916f3d68bbc370 |
|
MD5 | 79a9f199ab8beb35de9ef4b61622eb42 |
|
BLAKE2b-256 | 65340d20a85b07fe16ad3423b0f11d37a3345e6967cc7391825d8f3b87f0e704 |