Awesome Open Source
Awesome Open Source

Starlette Prometheus

Build Status codecov Package Version PyPI Version


Prometheus integration for Starlette.


  • Python 3.6+
  • Starlette 0.9+


$ pip install starlette-prometheus


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.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,122,589
Middleware (2,469
Prometheus (2,404
Metrics (2,139
Asgi (164
Starlette (143
Related Projects