--- id: aioprometheus version: "23.12.0" license: MIT license_treatment: permissive maintenance: dormant --- # aioprometheus — A Prometheus Python client library for asyncio-based applications License: permissive · Maintenance: dormant · Downloads: 162.3K/mo ## What it is and what it does aioprometheus is a Prometheus client library designed for Python asyncio applications. It lets you instrument your code by creating metrics (counters, gauges, histograms, etc.) and then expose them to Prometheus or compatible monitoring systems. The library includes a default collector registry and supports both text export and push-gateway modes. For web frameworks, aioprometheus provides ASGI middleware that automatically tracks request counts, response codes, and exceptions in FastAPI, Starlette, and Quart applications. For standalone asyncio services, you can use the HTTP Service to expose metrics on a dedicated endpoint. The core library has minimal dependencies; framework-specific features require optional extras (aiohttp, starlette, quart). Use it for: - Add Prometheus metrics to a FastAPI or Starlette application via ASGI middleware to track HTTP request volume and response codes - Instrument a long-running asyncio service (e.g., worker, daemon) with custom counters and expose them via an HTTP metrics endpoint - Push metrics from a distributed asyncio process to a Prometheus Push Gateway for scrape-less collection - Track application events and performance in asyncio-based microservices without blocking the event loop - Monitor custom business logic (e.g., job counts, queue depth) alongside standard HTTP metrics in async web apps ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Prometheus client library for asyncio applications that collects and exposes metrics via text export or gateway push, with optional ASGI middleware for FastAPI, Starlette, and Quart. Yes, with conditions. aioprometheus is stable and production-ready for asyncio applications that need Prometheus integration. Install it if you are building or maintaining an asyncio-based service (FastAPI, Starlette, Quart, or standalone) and need metrics collection. The dormant maintenance status is not a blocker for stable use, but verify compatibility with your Prometheus server version and Python 3.8+ support meets your needs. No known security vulnerabilities. ## Install pip install aioprometheus uv add aioprometheus poetry add aioprometheus ## Installing aioprometheus Before you install: Low install friction with only two runtime dependencies (orjson and quantile-python). Maintenance is dormant—last release was 961 days ago—but the project remains archived=false with a recent commit (2024-08-21) and is marked Production/Stable. Suitable for stable, long-running deployments where active development is not expected. License in practice: MIT license (permissive) means you can use, modify, and distribute aioprometheus with minimal restrictions, including in commercial applications. No copyleft obligations. Quickstart: pip install aioprometheus from aioprometheus import Counter events_counter = Counter("events_counter", "Total number of events.") events_counter.inc({"kind": "event A"}) Requires Python >=3.8.0. ASGI middleware extras (starlette, quart, aiohttp) are optional but needed for framework-specific features. Verify before relying: - Whether quantile-python and orjson versions are pinned or have known compatibility constraints - Performance characteristics under high-volume metric collection in production asyncio workloads - Whether dormant maintenance status affects compatibility with recent Prometheus server versions ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 162.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags prometheus metrics asyncio, async prometheus client, fastapi prometheus middleware, asyncio monitoring metrics, prometheus asgi middleware, starlette quart metrics, prometheus python async, prometheus, asyncio, asgi-middleware [View on SkillFed](https://skillfed.io/packages/aioprometheus) · [View on PyPI](https://pypi.org/project/aioprometheus/)