Grafana dashboard designed for a Flask web application that exposes metrics with flask_prometheus_metrics Flask extension
Dashboard aimed at the apps deployed with Kubernetes, although it can be easily tweaked to be infrastructure-agnostic.
- Install flask_prometheus_metrics exporter to your Flask application
- Make Prometheus scraping your app's
/metrics
endpoint - Import flask-web-app.json at
https://<your-grafana-domain>.tld/dashboard/import
If you do not deploy your app in Kubernetes you may need to tweak
flask-web-app.json pod
labels to meet your
needs. Instead of pod
you may use instance
or hostname
or
other label name depending on how your Prometheus handle your app's
hostname.
12 panels covers the following metrics:
- Requests per second
- Latency
- Percentiles (latency within which certain percent of requests served)
- Number of 4xx, 5xx errors per second
- Error count by endpoint
- CPU usage
- Memory usage
- Open file descriptors
- App's uptime
- App's version
- App's deployment environment (e.g. development, staging, production)
- Python interpretor version
Dashboard provides variables:
- Prometheus datasource
- Time interval
- Kubernetes pod name
- App's endpoint
- HTTP method
- Percentile
- HTTP status code for errors
The variables allow to change some panels charts grouing, intervals, labels selection.