Description
django-prometheus exports Django monitoring metrics for Prometheus, so you can watch the health and performance of a Django application over time. It provides metrics for requests and responses, for database access through the Django ORM, and for cache access through the Django cache framework. 10 and later, and installing it also installs the prometheus_client library. To use it you add the app and its URL configuration to your project settings. Latency is recorded in histograms with default buckets, and you can define your own buckets, with the trade-off that more buckets cost more performance. A namespace setting prefixes every metric, which helps when several projects share a Prometheus server. Databases can be monitored by changing the database engine to the django_prometheus backend, for SQLite, MySQL and PostgreSQL, and caches can be monitored by switching to the matching django_prometheus cache backend for file-based, Memcached and Redis caches. Model operations can be counted with a mixin that is safe to add to existing models without a migration, which exports counters for inserts, updates and deletes.…
Highlights
- Metrics for requests, responses and latency
- Database and cache monitoring
- Counters for model inserts, updates and deletes
- Migration status gauges
- Custom buckets and namespaces
Ratings & Reviews
No ratings yet
Be the first to rate Django Prometheus.
People also visit
Flask-MonitoringDashboard
Automatically monitor the evolving performance of Flask/Python web services
Django Prometheus FAQ
What is django-prometheus?
A library that exports Django monitoring metrics to Prometheus.
Is it free?
Yes. It is open source and hosted on GitHub.
Which versions does it need?
Django 4.2 or later and Python 3.10 or later, according to the README.
What can it monitor?
Requests and responses, ORM database access, cache access, model operations and migrations.
Does it need a database change?
No. You change the database engine to the django_prometheus backend in settings, and the README says adding the model mixin needs no migration.
Where are all the metrics listed?
In a metrics reference document in the repository, documentation/metrics.md.
What are the best Django Prometheus alternatives?
Popular alternatives to Django Prometheus include Django Watchman, Django Health Check and Nextcloud Exporter. See all Django Prometheus alternatives



