Skip to main content

Async helpers for prometheus_client.

Project description

https://travis-ci.org/hynek/prometheus_async.svg?branch=master https://codecov.io/github/hynek/prometheus_async/coverage.svg?branch=master

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.1.0 (2016-09-23)

Changes:

  • Service discovery deregistration is optional now.

Full changelog.

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


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-16.1.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

prometheus_async-16.1.0-py2.py3-none-any.whl (13.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file prometheus_async-16.1.0.tar.gz.

File metadata

File hashes

Hashes for prometheus_async-16.1.0.tar.gz
Algorithm Hash digest
SHA256 c05cd90492de40d887087cc0d62de7d02e186a9209cb361e305ce07b04404c67
MD5 ce878636cd485281c5633c0e67cbd978
BLAKE2b-256 2c967a8923884c2722cdb6e55fa04ae9b26d809944b2bfed7f13357f8b4ac714

See more details on using hashes here.

File details

Details for the file prometheus_async-16.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for prometheus_async-16.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a120408408db99393dc292728b481aaf03b33bb6566d9bb4368a7b1eb2d4ce65
MD5 4096d63566d8ad726c305e582b08cc81
BLAKE2b-256 f233d992fd920404f00ed8370ba0d90cb05b11ad7247ca5c5e264644436768da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page