Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adinhodovic/django-mixin
Monitoring mixin for Django-prometheus. A set of Grafana dashboards and Prometheus rules for Django.
https://github.com/adinhodovic/django-mixin
django django-prometheus django-rest-framework grafana grafana-dashboard monitoring monitoring-mixins prometheus
Last synced: 7 days ago
JSON representation
Monitoring mixin for Django-prometheus. A set of Grafana dashboards and Prometheus rules for Django.
- Host: GitHub
- URL: https://github.com/adinhodovic/django-mixin
- Owner: adinhodovic
- Created: 2022-11-23T15:56:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T19:24:42.000Z (3 months ago)
- Last Synced: 2024-10-12T07:27:01.841Z (23 days ago)
- Topics: django, django-prometheus, django-rest-framework, grafana, grafana-dashboard, monitoring, monitoring-mixins, prometheus
- Language: Jsonnet
- Homepage:
- Size: 1.47 MB
- Stars: 49
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-django - django-mixin - Monitoring mixin for Django-prometheus. A set of Grafana dashboards and Prometheus rules for Django. (Third-Party Packages / Monitoring)
README
# Prometheus Monitoring Mixin for Django
A set of Grafana dashboards and Prometheus alerts for Django using the metrics from [Django Prometheus](https://github.com/korfuri/django-prometheus).
## Dashboards
- [Django Overview](https://grafana.com/grafana/dashboards/17617-django-overview/) - Django Overview, a simple overview of the database, cache and requests.
![django-overview](images/django-overview.png)
- [Django Requests Overview](https://grafana.com/grafana/dashboards/17616-django-requests-overview/) - Django request overview, providing insights of all requests filterable by view and method. Separate graphs for app and admin views, has as well weekly breakdowns for top templates, top exceptions by type, top exceptions by view and top responses by view.
![django-requests-overview](images/django-requests-overview.png)
- [Django Requests by View](https://grafana.com/grafana/dashboards/17613-django-requests-by-view/) - Django requests by view, a breakdown of requests by view that shows compute expensive metrics as latency buckets alongside requests, responses and status codes.
![django-requests-by-view](images/django-requests-by-view.png)
There are also generated dashboards in the `./dashboards_out` directory.
## How to use
This mixin is designed to be vendored into the repo with your infrastructure config.
To do this, use [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler):You then have three options for deploying your dashboards
1. Generate the config files and deploy them yourself
2. Use jsonnet to deploy this mixin along with Prometheus and Grafana
3. Use prometheus-operator to deploy this mixinOr import the dashboard using json in `./dashboards_out`, alternatively import them from the `Grafana.com` dashboard page.
## Generate config files
You can manually generate the alerts, dashboards and rules files, but first you
must install some tools:```sh
brew install jsonnet jsonnet-bundler
```Then, grab the mixin and its dependencies:
```sh
git clone https://github.com/adinhodovic/django-mixin
cd django-mixin
jb install
```Finally, build the mixin:
```sh
make prometheus_alerts.yaml
make dashboards_out
```The `prometheus_alerts.yaml` file then need to passed
to your Prometheus server, and the files in `dashboards_out` need to be imported
into you Grafana server. The exact details will depending on how you deploy your
monitoring stack.## Alerts
The mixin follows the [monitoring-mixins guidelines](https://github.com/monitoring-mixins/docs#guidelines-for-alert-names-labels-and-annotations) for alerts.