tags: prometheus grafana visualization metrics
Dashboard aimed at the apps deployed with Kubernetes, although it can be easily tweaked to be infrastructure-agnostic.
12 dasboard’s panels covers the following metrics:
- Requests per second per host, endpoint, HTTP method etc.
- Percentiles (latency within which certain percent of requests served)
- Number of 4xx, 5xx errors per second
- Error count by endpoint
- CPU usage per host
- Memory usage per host
- Open file descriptors per host
- App’s uptime per host
- App’s version per host
- App’s deployment environment (e.g. development, staging, production) per host
- Python interpretor version per host
Dashboard also provides variables:
- Prometheus datasource
- Time interval
- Kubernetes pod name
- App’s endpoint
- HTTP method
- HTTP status code for errors
The variables allow to change some panels charts grouing, intervals, labels selection.
Usage is easy:
- 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.