Skip to main content

Async helpers for prometheus_client.

Project description

PyPI Documentation Status CI status Test Coverage

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, 3.6) and Twisted (Python 2.7, 3.4, 3.5, 3.6, 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

17.4.0 (2017-08-14)

Backward-incompatible changes:

none

Deprecations:

none

Changes:

  • Set proper content type header for the root redirection page.

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

Uploaded Source

Built Distribution

prometheus_async-17.4.0-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for prometheus_async-17.4.0.tar.gz
Algorithm Hash digest
SHA256 1b8d063f224aab1cbc71fdcda25d2e8bd72f26e1ff357bb5ec6413ffa56ff9d5
MD5 73ec42c556e024fa4281d8f57b6eb404
BLAKE2b-256 919932e79b21a01bae84da1e44759088887585456ad15437207025c253e21be4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prometheus_async-17.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 028c3b0be8b470f14f42c2d83c25be34559a0c0357cc2c4a4779e1cf20275015
MD5 3da17d9fb69f42f9fb3dea88fd8b6b1b
BLAKE2b-256 a559919c14c72c6a83305ebc2934c5a0cfcdf2163f8c0cd26623f1ac7bd86aa6

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