Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
1 result

django-prometheus

  • Clone with SSH
  • Clone with HTTPS
  • Jan David Mol's avatar
    Jan David Mol authored
    9d87a64a
    History

    Docker Deploy: Grafana

    Demo

    This repo contains a demo setup for the django-prometheus plugin, which exposes Django usage metrics as a Prometheus end point. See their README on how to use it.

    Spin up

    To build and spin up the demo environment:

    docker-compose build
    docker-compose up

    Once the stack has booted up, you can visit:

    You will see that the django-prometheus plugin will expose general statistics like:

    • Backend database performance,
    • HTTP response times,
    • CRUD operations on models that have been extended with the ExportModelOperationsMixin class.

    Example metric exposed by this plugin (for a full list see example-exposed-metrics.txt):

    # HELP django_model_inserts_total Number of insert operations by model.
    # TYPE django_model_inserts_total counter
    django_model_inserts_total{model="question"} 0.0
    django_model_inserts_total{model="choice"} 0.0

    Furthermore, the default dashboard relies on prometheus/django.rules to evaluate those formulas faster when asked.