Django Prometheus business metrics
Project description
Django Prometheus business metrics
This Django app provides a Prometheus metrics endpoint serving so-called business metrics. These are metrics that are calculated when Prometheus hits the metrics endpoint.
Usage
-
Create a
BusinessMetricsManager
object and register some metrics:# project/business_metrics.py from django_business_metrics.v0 import BusinessMetricsManager, users metrics_manager = BusinessMetricsManager() # Add a pre-defined metric metrics_manager.add(users) # Add some custom metrics @metrics_manager.metric() def my_metric(): return 10
-
Register a Prometheus endpoint:
# project/urls.py ... from .business_metrics import metrics_manager ... urlpatterns = [ ... path('business-metrics', metrics_manager.view), ... ]
-
Setup your Prometheus agent to scrape metrics from
/business-metrics
endpoint.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-business-metrics-0.1.0a3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b4fdde7104019a81ddb93bbefb473c5cf2c80d51e8c76f013ab449d5cefb4e |
|
MD5 | ce03f45e8b8ba902c2796c09c901e547 |
|
BLAKE2b-256 | da9c9c182f33bf84bfce9d82d5905b81206004e747238624c12d2d53aedf54b3 |
Close
Hashes for django_business_metrics-0.1.0a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c1180ffcc5fcd707715385c578485d05f32e914930fc122561f867afbcd1ad2 |
|
MD5 | 4f010f02aff04d807aa3c79598798f55 |
|
BLAKE2b-256 | 8f299a077d28128e2387a4a1de7486b8999bafa72887249a9d838cb7004d203a |