--- id: prometheus-flask-exporter version: "0.23.2" license: MIT license_treatment: permissive maintenance: aging --- # prometheus-flask-exporter — Prometheus metrics exporter for Flask License: permissive · Maintenance: aging · Downloads: 3.2M/mo ## What it is and what it does Prometheus Flask exporter integrates Prometheus metrics collection directly into Flask applications. It automatically tracks HTTP request duration, request count, and uncaught exceptions using a Prometheus registry, exposing them on a `/metrics` endpoint by default. The library provides decorators to define custom metrics (counters, gauges, histograms, summaries) on individual endpoints and supports filtering which endpoints are tracked. The package depends on prometheus_client for metric primitives and flask for the web framework. It's designed for applications that need observability into request patterns and performance without manual instrumentation of every endpoint. Configuration options allow changing the metrics endpoint path, registry, grouping strategy, and default labels applied to all metrics. Use it for: - Monitor Flask application request latency and throughput in production environments with Prometheus scraping - Track endpoint-specific metrics like request count by status code or custom business logic counters - Exclude sensitive endpoints from metrics collection using decorators or regex path patterns - Expose application version and metadata as static Prometheus gauge metrics - Group request metrics by endpoint function name instead of URI path to reduce cardinality ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Exports HTTP request metrics from Flask applications to Prometheus, tracking request duration, count, exceptions, and custom metrics via decorators. Yes, with conditions. Install if you run Flask applications with Prometheus monitoring infrastructure already in place and need straightforward request-level metrics. The low install friction and permissive license make adoption easy. However, the aging maintenance status (521 days since last release) means you should verify compatibility with your Flask and Python versions before committing to production use. ## Install pip install prometheus-flask-exporter uv add prometheus-flask-exporter poetry add prometheus-flask-exporter ## Installing prometheus-flask-exporter Before you install: Low friction install with only two runtime dependencies (prometheus_client and flask). Maintenance status is aging—last release was 521 days ago, though the repository remains active with recent commits and 685 stars. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: from flask import Flask from prometheus_flask_exporter import PrometheusMetrics app = Flask(__name__) metrics = PrometheusMetrics(app) @app.route('/') def main(): pass # requests tracked by default Verify before relying: - Whether the package actively maintains compatibility with Flask versions beyond those listed in classifiers - Performance overhead of metrics collection on high-throughput applications ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 3.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags flask prometheus metrics exporter, prometheus http request monitoring, flask request duration tracking, prometheus flask integration, application metrics collection flask, prometheus exporter decorator, flask endpoint monitoring, observability, prometheus, metrics [View on SkillFed](https://skillfed.io/packages/prometheus-flask-exporter) · [View on PyPI](https://pypi.org/project/prometheus-flask-exporter/)