A Flask extension that provides Prometheus metrics for Flask web applications with minimal configuration. Version 1.0.0 supports Python >=3.6 and offers a straightforward API to expose metrics like request count, request duration, and custom metrics via a /metrics endpoint.
pip install flask-prometheus-metricsVerified import paths — ran on the pinned version, not inferred.
Initialize PrometheusMetrics with the Flask app. By default, metrics are exposed at /metrics.
Use a reverse proxy or add authentication via Flask decorators before the /metrics route.
Pass the Flask app instance to register_metrics(), e.g., register_metrics(app).
Use from flask_prometheus_metrics import PrometheusMetrics instead.