Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 518 Bytes

README.md

File metadata and controls

27 lines (23 loc) · 518 Bytes

flask-prometheus

Flask Middleware for Prometheus Metrics

Usage

from flask_prometheus import Prometheus

Prometheus(app)

Metrics

REQUESTS = Counter(
    "http_requests_total", "Total Requests", labelnames=["method", "path", "status"]
)
LATENCY = Histogram(
    "http_request_duration_seconds",
    "Total Requests",
    labelnames=["method", "path", "status"],
)
SIZE = Summary(
    "http_response_size_bytes",
    "Response Sizes",
    labelnames=["method", "path", "status"],
)