https://github.com/amitsaha/python-prometheus-demo
Demo of using Prometheus for monitoring Python web applications
https://github.com/amitsaha/python-prometheus-demo
metrics prometheus python statsd webapplication
Last synced: 3 months ago
JSON representation
Demo of using Prometheus for monitoring Python web applications
- Host: GitHub
- URL: https://github.com/amitsaha/python-prometheus-demo
- Owner: amitsaha
- License: mit
- Created: 2017-04-22T02:12:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-08-01T00:55:45.000Z (5 months ago)
- Last Synced: 2025-10-12T01:49:22.129Z (3 months ago)
- Topics: metrics, prometheus, python, statsd, webapplication
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 109
- Watchers: 0
- Forks: 44
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python + Prometheus Demo
## Demos based on codeship blog posts
The following two applications are discussed in the [first blog post](https://www.cloudbees.com/blog/monitoring-your-synchronous-python-web-applications-using-prometheus?utm_content=58060028&utm_medium=social&utm_source=twitter):
### [flask_app_prometheus](https://github.com/amitsaha/python-prometheus-demo/tree/master/flask_app_prometheus)
A Flask application using the native Prometheus Python client to expose metrics via the `/metrics` endpoint
### [flask_app_statsd_prometheus](https://github.com/amitsaha/python-prometheus-demo/tree/master/flask_app_statsd_prometheus)
A Flask application which pushes the metrics to a `statsd` bridge which converts `DogStatsd` metrics to `Prometheus` compatible metrics.
The [second blog post](https://www.cloudbees.com/blog/monitoring-your-asynchronous-python-web-applications-using-prometheus?utm_content=58777682&utm_medium=social&utm_source=twitter) refers to the next application:
### [aiohttp_app_prometheus](https://github.com/amitsaha/python-prometheus-demo/tree/master/aiohttp_app_prometheus)
An aiohttp application with prometheus integeration.
## Django web application + statsd -> Prometheus
### [django_app_statsd_prometheus](./django_app_statsd_prometheus)
This demo demonstrates how we can push HTTP metrics from a Django application into statsd exporter
which is then scraped by prometheus.
### [django_app_gunicorn_statsd_prometheus](./django_app_gunicorn_statsd_prometheus)
This demo demonstrates howe can push statsd metrics from gunicorn running a django application.
I learned about this approach from this [blog post](https://medium.com/@damianmyerscough/monitoring-gunicorn-with-prometheus-789954150069).
## Attempts to get native prometheus export working
See [blog post](http://echorand.me/your-options-for-monitoring-multi-process-python-applications-with-prometheus.html)
### [flask_app_prometheus_worker_id](https://github.com/amitsaha/python-prometheus-demo/tree/master/flask_app_prometheus_worker_id)
### [flask_app_prometheus_multiprocessing](https://github.com/amitsaha/python-prometheus-demo/tree/master/flask_app_prometheus_multiprocessing)