starlette-prometheus
Prometheus integration for Starlette
Decision gist · record as of 2026-08-14
Yes, if you need Prometheus metrics for a Starlette application and accept the GPL-3.0+ copyleft license. Install friction is low and the package is stable. However, dormant maintenance means you should verify compatibility with your Starlette version and be prepared to fork or patch if issues arise. Not suitable if your project cannot comply with GPL-3.0+ licensing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8+ and Starlette 0.12+.
- Unfiltered unhandled paths can lead to unbounded memory use; use filter_unhandled_paths=True if needed.
- Low install friction with only two runtime dependencies (starlette and prometheus_client).
License · maintenance · safety
GPL-3.0+ (copyleft) — Licensed under GPL-3.0+, a copyleft license. Any application using this package must comply with GPLv3+ terms, including potential source code disclosure obligations if you distribute the application.
last release 2024-09-03 (710 days) · last repo commit 2024-05-20 · 378 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 432,478 downloads/mo, #6,708 on PyPI
Alternatives
Verify before relying
pip install starlette-prometheus
from starlette.applications import Starlette
from starlette_prometheus import metrics, PrometheusMiddleware
app = Starlette()
app.add_middleware(PrometheusMiddleware)
app.add_route("/metrics/", metrics)- Whether the package is actively maintained or seeking new maintainers despite dormant status.
- Performance impact of metrics collection on high-throughput applications.
- Compatibility with recent Starlette versions beyond what the classifiers declare.
What it is and what it does
Starlette Prometheus is a middleware package that integrates Prometheus metrics collection into Starlette web applications. It automatically instruments HTTP requests and responses, collecting metrics like request counts, latencies, and response codes, then exposes them via a `/metrics/` endpoint that Prometheus can scrape. The package wraps Starlette's middleware system to intercept requests transparently.
The package depends on starlette and prometheus_client to function. It's straightforward to set up—add the middleware and route the metrics endpoint—but requires careful configuration when handling dynamic or unmatched routes, as unfiltered path tracking can consume unbounded memory. The package supports Python 3.8 through 3.12 and is marked Production/Stable, though development has been dormant since its last release.
Use it for
- Expose HTTP request metrics to Prometheus for monitoring Starlette application performance and availability.
- Track request latency, error rates, and throughput to feed into alerting and dashboarding systems.
- Debug and profile application behavior by analyzing request patterns and response times over time.
- Integrate observability into microservices built with Starlette without writing custom instrumentation code.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need Prometheus metrics for a Starlette application and accept the GPL-3.0+ copyleft license.
Install friction is low and the package is stable. However, dormant maintenance means you should verify compatibility with your Starlette version and be prepared to fork or patch if issues arise. Not suitable if your project cannot comply with GPL-3.0+ licensing.
Install
starlette-prometheus on PyPI
Before you install
Low install friction with only two runtime dependencies (starlette and prometheus_client). Maintenance is dormant—last release was over 710 days ago, though the repository remains active and the package is marked Production/Stable.
Requires Python 3.8+ and Starlette 0.12+. Unfiltered unhandled paths can lead to unbounded memory use; use filter_unhandled_paths=True if needed.
License in practice
Licensed under GPL-3.0+, a copyleft license. Any application using this package must comply with GPLv3+ terms, including potential source code disclosure obligations if you distribute the application.
Quickstart
pip install starlette-prometheus
from starlette.applications import Starlette
from starlette_prometheus import metrics, PrometheusMiddleware
app = Starlette()
app.add_middleware(PrometheusMiddleware)
app.add_route("/metrics/", metrics)
Verify before relying
- Whether the package is actively maintained or seeking new maintainers despite dormant status.
- Performance impact of metrics collection on high-throughput applications.
- Compatibility with recent Starlette versions beyond what the classifiers declare.
Package facts
| License | GPL-3.0+ copyleft |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesstarletteprometheus_client |
| Maintenance | Dormant 710 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 432,478 / month, #6,708 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application Frameworks |
Evidence: starlette_prometheus-0.10.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 › “prometheus metrics starlette”
- starlette-prometheusAdds Prometheus metrics collection and exposure to Starlette web…
- aioprometheusA Prometheus client library for asyncio applications that collects…
- starlette-exporterCollects and exports Prometheus metrics for Starlette and FastAPI…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also starlette-exporter · aioprometheus · prometheus-fastapi-instrumentator · prometheus-client · oslo.metrics · airflow-exporter · django-prometheus · prometheus-async · starlette-context · starlette-testclient