prometheus-async
Async helpers for prometheus_client.
What it is and what it does
prometheus-async bridges the official Prometheus Python client and async frameworks by providing decorators and helpers that work with asyncio and Twisted. It lets you instrument async code paths with Prometheus metrics—timers, histograms, counters—using the same metric objects from prometheus-client, but with async-aware wrappers that don't block event loops.
The package is most useful for async web services and event-driven applications where you need to collect metrics without introducing synchronous bottlenecks. For synchronous applications, it also offers helper functions to expose metrics in separate threads. It depends on prometheus-client for the core metric types, typing-extensions for type hints, and wrapt for function wrapping.
Use it for:
- Instrument async HTTP handlers in aiohttp or FastAPI with request timing and error counters.
- Collect metrics from Twisted async applications without blocking the reactor.
- Expose Prometheus metrics endpoints in async web services using thread-safe helpers.
- Decorate async functions to automatically record execution time and call counts.
- Monitor async task queues and background job systems in event-driven architectures.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds async/await support to Prometheus metrics collection for asyncio and Twisted applications, wrapping the official prometheus-client library.
Yes, if you run async applications and need Prometheus metrics. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real gap in the official client's async support. Skip it if you only use synchronous code or don't need Prometheus integration.
Install
prometheus-async on PyPI
pip
pip install prometheus-asyncuv
uv add prometheus-asyncpoetry
poetry add prometheus-asyncInstalling prometheus-async
Before you install
Low install friction with three straightforward runtime dependencies. Actively maintained with a recent release and ongoing commits; marked Production/Stable and supports current Python versions.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install prometheus-async
from prometheus_client import Histogram
from prometheus_async.aio import time
import asyncio
REQ_TIME = Histogram("req_time_seconds", "time spent in requests")
@time(REQ_TIME)
async def my_handler():
await asyncio.sleep(1)
return "done"
Requires Python 3.9 or later; asyncio support requires an async runtime (asyncio or Twisted).
Verify before relying
- Whether the package's metric exposure methods for synchronous applications offer concrete advantages over prometheus-client's built-in methods beyond thread-based execution.
- Performance characteristics and overhead of the async wrapper compared to direct prometheus-client usage.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — prometheus-client, typing-extensions, wrapt |
| Maintenance | actively maintained — 143 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 253,190/month — #8,524 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: prometheus_async-26.1.0-py3-none-any.whl
Keywords: async, asyncio, metrics, prometheus, twisted
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
prometheus-clientInstruments Python applications to expose…
permissive · top 1,000 on PyPI
prometheus-client-python-speedupsProvides optional C/Rust-compiled speedups for…
unclear · top 15,000 on PyPI
py-grpc-prometheusAdds Prometheus metrics collection to gRPC…
unclear · top 5,000 on PyPI
treqtreq is a high-level HTTP client library for…
permissive · top 15,000 on PyPI
django-prometheusExports Django application metrics (requests,…
permissive · top 5,000 on PyPI
prometheus-flask-exporterExports HTTP request metrics from Flask…
permissive · top 5,000 on PyPI
aioprometheusA Prometheus client library for asyncio…
permissive · top 15,000 on PyPI
prometheus-api-clientConnects to Prometheus monitoring systems and…
permissive · top 5,000 on PyPI
prometheus-fastapi-instrumentatorAdds Prometheus metrics collection and exposure…
permissive · top 5,000 on PyPI
starlette-exporterCollects and exports Prometheus metrics for…
permissive · top 5,000 on PyPI