skillfed

aioprometheus

A Prometheus Python client library for asyncio-based applications

aioprometheus v23.12.0 162.3K downloads/30d#10,611 on PyPI190
Permissive license MIT DORMANT released

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 on this page — 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

aioprometheus on PyPI

pip

pip install aioprometheus

uv

uv add aioprometheus

poetry

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 the current Python release (>=3.8.0)
Install friction low — pure-Python wheel
Runtime dependencies 2 — orjson, quantile-python
Maintenance dormant — 961 days since the last release
Last repo commit
First released
Downloads 162,259/month — #10,611 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aioprometheus-23.12.0-py3-none-any.whl

Keywords: prometheus, monitoring, metrics

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: MonitoringTyping :: Typed

Tags

prometheus metrics asyncioasync prometheus clientfastapi prometheus middlewareasyncio monitoring metricsprometheus asgi middlewarestarlette quart metricsprometheus python async
prometheusasyncioasgi-middleware

More Python Modules packages

idna

Converts domain names between Unicode and…

permissive · top 100 on PyPI

setuptools

Setuptools is a Python build backend and…

permissive · top 100 on PyPI

PyYAML

PyYAML parses and emits YAML 1.1 data format,…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

annotated-types

Provides reusable metadata objects for use with…

permissive · top 100 on PyPI

typing-inspection

Provides runtime tools to inspect and…

permissive · top 100 on PyPI

prometheus-api-client

Connects to Prometheus monitoring systems and…

permissive · top 5,000 on PyPI

starlette-exporter

Collects and exports Prometheus metrics for…

permissive · top 5,000 on PyPI

starlette-prometheus

Adds Prometheus metrics collection and exposure…

copyleft · top 15,000 on PyPI

prometheus-fastapi-instrumentator

Adds Prometheus metrics collection and exposure…

permissive · top 5,000 on PyPI

aiodogstatsd

An asyncio-based client for sending metrics to…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-asgi

Provides ASGI middleware for OpenTelemetry that…

permissive · top 1,000 on PyPI

prometheus-async

Adds async/await support to Prometheus metrics…

permissive · top 15,000 on PyPI

aioauth

aioauth implements the OAuth 2.0 protocol for…

permissive · top 15,000 on PyPI

timing-asgi

Timing-asgi is an ASGI middleware that…

unclear · top 15,000 on PyPI

aiohttp-asgi-connector

Provides an AIOHTTP connector that lets you…

permissive · top 15,000 on PyPI