starlette-exporter
Prometheus metrics exporter for Starlette applications.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a standard need for Prometheus monitoring of web applications. The permissive Apache 2.0 license poses no restrictions. Install it if you run Starlette and need Prometheus metrics without writing custom instrumentation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only two runtime dependencies (prometheus_client and starlette).
- Actively maintained with recent releases; last commit 2026-07-29.
License · maintenance · safety
Apache License 2.0 (permissive) — Apache License 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and open-source projects, provided you include a copy of the license and state significant changes.
last release 2026-07-29 (16 days) · last repo commit 2026-07-29 · 413 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,916,953 downloads/mo, #3,434 on PyPI
Alternatives
Verify before relying
pip install starlette_exporter
from starlette.applications import Starlette
from starlette_exporter import PrometheusMiddleware, handle_metrics
app = Starlette()
app.add_middleware(PrometheusMiddleware)
app.add_route("/metrics", handle_metrics)- Whether the package works with all current versions of prometheus_client and starlette, or if specific version ranges are required.
- Performance overhead of metric collection in high-throughput scenarios.
- Compatibility with frameworks beyond Starlette (e.g., FastAPI) given only starlette is listed as a runtime dependency.
What it is and what it does
starlette_exporter is a middleware that automatically instruments Starlette applications to collect HTTP metrics compatible with Prometheus. It tracks three core metrics: total request count (starlette_requests_total), request duration distribution (starlette_request_duration_seconds), and concurrent requests in progress (starlette_requests_in_progress). Each metric is labeled by HTTP method, request path, and response status code, allowing fine-grained monitoring and alerting.
The middleware integrates as a standard Starlette middleware and exposes metrics via a /metrics endpoint that Prometheus can scrape. It supports customization through options like custom labels (static or request-derived), histogram bucket configuration, path grouping for cardinality control, and filtering or grouping of unhandled paths. It also provides helper functions to extract label values from request or response headers with cardinality constraints.
Use it for
- Monitor request latency distribution and identify performance regressions in Starlette services.
- Track concurrent request volume to detect capacity issues and inform auto-scaling decisions.
- Add custom labels from headers to correlate metrics with deployment environment or tenant information.
- Exclude health-check or probe endpoints from metrics collection to reduce noise and cardinality.
- Integrate trace IDs as exemplars in Prometheus histograms to link metrics to distributed traces.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and solves a standard need for Prometheus monitoring of web applications. The permissive Apache 2.0 license poses no restrictions. Install it if you run Starlette and need Prometheus metrics without writing custom instrumentation.
Install
starlette-exporter on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (prometheus_client and starlette). Actively maintained with recent releases; last commit 2026-07-29.
License in practice
Apache License 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and open-source projects, provided you include a copy of the license and state significant changes.
Quickstart
pip install starlette_exporter
from starlette.applications import Starlette
from starlette_exporter import PrometheusMiddleware, handle_metrics
app = Starlette()
app.add_middleware(PrometheusMiddleware)
app.add_route("/metrics", handle_metrics)
Verify before relying
- Whether the package works with all current versions of prometheus_client and starlette, or if specific version ranges are required.
- Performance overhead of metric collection in high-throughput scenarios.
- Compatibility with frameworks beyond Starlette (e.g., FastAPI) given only starlette is listed as a runtime dependency.
Package facts
| License | Apache License 2.0 permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesprometheus_clientstarlette |
| Maintenance | Actively maintained 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,916,953 / month, #3,434 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: starlette_exporter-0.24.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 › “request monitoring middleware”
- starlette-exporterCollects and exports Prometheus metrics for Starlette and FastAPI…
- opentelemetry-instrumentation-asgiProvides ASGI middleware for OpenTelemetry that instruments request…
- timing-asgiTiming-asgi is an ASGI middleware that automatically measures 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 aioprometheus · prometheus-fastapi-instrumentator · starlette-prometheus · prometheus-flask-exporter · airflow-exporter · django-prometheus · opentelemetry-exporter-prometheus · prometheus-client · starlette-compress · fastapi-healthchecks