prometheus-client
Python client for the Prometheus monitoring system.
Decision gist · record as of 2026-08-14
Yes. This is the canonical, actively maintained Prometheus client for Python with zero runtime dependencies, permissive licensing, and no known vulnerabilities. Install it if you need to expose application metrics to Prometheus; it is the standard choice for this task.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction installation with no runtime dependencies.
- Active maintenance—last commit 2026-08-13, released 21 days ago, 4357 repository stars.
- Supports current Python versions (3.9 through 3.14) and PyPy.
License · maintenance · safety
Apache-2.0 AND BSD-2-Clause (permissive) — Dual-licensed under Apache-2.0 and BSD-2-Clause, both permissive. No restrictions on commercial or proprietary use.
last release 2026-07-24 (21 days) · last repo commit 2026-08-13 · 4,357 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 178,320,226 downloads/mo, #233 on PyPI
Alternatives
Verify before relying
pip install prometheus-client
from prometheus_client import Counter, start_http_server
request_count = Counter('requests_total', 'Total requests')
start_http_server()
request_count.inc()- Whether the package supports custom metric types beyond counters, gauges, histograms, and summaries.
- Whether it handles high-cardinality metrics or has built-in safeguards against cardinality explosion.
- Performance characteristics under heavy instrumentation load.
- Specific HTTP endpoint port and path conventions for metrics exposure.
What it is and what it does
prometheus-client is the official Python client library for Prometheus, the open-source monitoring and alerting system. It provides decorators, context managers, and direct APIs to instrument Python applications with metrics that are then scraped and stored by a Prometheus server. The library exposes metrics in Prometheus's text-based format, typically via an HTTP endpoint that Prometheus polls at regular intervals.
Developers use it to track application-level events: request counts and latencies, database query performance, cache hit rates, custom business logic outcomes, and system resource usage. It has no runtime dependencies, making it lightweight to add to existing projects. The package is actively maintained by the Prometheus project itself and supports modern Python versions from 3.9 onward.
Use it for
- Track HTTP request counts and response latencies in a web service to feed into Prometheus dashboards and alerting rules.
- Instrument a background job or batch process to expose completion times, error counts, and queue depths.
- Monitor database connection pool usage and query execution times in a data-heavy application.
- Expose custom business metrics for operational visibility and trend analysis.
- Build application-level SLO tracking by instrumenting critical code paths with histogram metrics.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is the canonical, actively maintained Prometheus client for Python with zero runtime dependencies, permissive licensing, and no known vulnerabilities. Install it if you need to expose application metrics to Prometheus; it is the standard choice for this task.
Install
prometheus-client on PyPI
Before you install
Low friction installation with no runtime dependencies. Active maintenance—last commit 2026-08-13, released 21 days ago, 4357 repository stars. Supports current Python versions (3.9 through 3.14) and PyPy.
License in practice
Dual-licensed under Apache-2.0 and BSD-2-Clause, both permissive. No restrictions on commercial or proprietary use.
Quickstart
pip install prometheus-client
from prometheus_client import Counter, start_http_server
request_count = Counter('requests_total', 'Total requests')
start_http_server()
request_count.inc()
Verify before relying
- Whether the package supports custom metric types beyond counters, gauges, histograms, and summaries.
- Whether it handles high-cardinality metrics or has built-in safeguards against cardinality explosion.
- Performance characteristics under heavy instrumentation load.
- Specific HTTP endpoint port and path conventions for metrics exposure.
Package facts
| License | Apache-2.0 AND BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 178,320,226 / month, #233 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: System :: Monitoring |
Evidence: prometheus_client-0.26.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “expose prometheus metrics”
- prometheus-clientInstruments Python applications to expose metrics in Prometheus…
- aioprometheusA Prometheus client library for asyncio applications that collects…
- opentelemetry-exporter-prometheusExports OpenTelemetry metrics to Prometheus for scraping and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also django-prometheus · prometheus-async · prometheus-client-python-speedups · py-grpc-prometheus · prometheus-api-client · prometheus-fastapi-instrumentator · opentelemetry-exporter-prometheus · prometheus-flask-exporter · starlette-prometheus · prometheus-remote-writer