Async helpers for prometheus_client.
Project description
prometheus_async adds support for asynchronous frameworks to the official Python client for the Prometheus metrics and monitoring system.
Currently asyncio (Python 3.4, 3.5) and Twisted (Python 2.7, 3.4, 3.5, PyPy) 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 for the time being).
The source code is hosted on GitHub and the documentation on Read The Docs.
Release Information
16.0.0 (2016-05-19)
Changes:
Initial release.
Credits
prometheus_async is written and maintained by Hynek Schlawack.
The development is kindly supported by Variomedia AG.
Other contributors can be found in GitHub’s overview.
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
Built Distribution
File details
Details for the file prometheus_async-16.0.0.tar.gz
.
File metadata
- Download URL: prometheus_async-16.0.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41c8a936ed97a78052160594933985428d6a35e72cedad213a37ab80a0bc7a9d |
|
MD5 | aaddf9900fa65f2a474ba51d9e56f783 |
|
BLAKE2b-256 | a909be3f60851b1a8e7e4617714a21ce93138b8e594598e2f8cafc2544e6eb41 |
File details
Details for the file prometheus_async-16.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: prometheus_async-16.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7727c1b18888eb62656bdd22555073e7bc76a10a2c40dec4154383a9c5d2b98 |
|
MD5 | 4facc732e882bb80850c1df8b968570d |
|
BLAKE2b-256 | ccc1b08da866d8c081d0e3dfd463435b6ec11b67ec732955db8ecae7332dfef3 |