Skip to main content

Prometheus integration for Starlette

Project description

Starlette Prometheus

Build Status Package Version PyPI Version

:warning: This repository is a fork of the original starlette_prometheus middleware, using upgraded dependencies.


Prometheus integration for Starlette.


  • Python 3.6+
  • Starlette 0.9+


$ pip install starlette-prometheus-middleware


A complete example that exposes prometheus metrics endpoint under /metrics/ path.

from starlette.applications import Starlette
from starlette_prometheus import metrics, PrometheusMiddleware

app = Starlette()

app.add_route("/metrics/", metrics)

Metrics for paths that do not match any Starlette route can be filtered by passing filter_unhandled_paths=True argument to add_middleware method.


This project is absolutely open to contributions so if you have a nice idea, create an issue to let the community discuss it.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlette-prometheus-middleware-0.9.0.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page