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(name='name', documentation='documentation') 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.0a5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6288e9b7b2671eae278815e2ab610aeda9d8e7c4061dc5af5d09922245c595f5 |
|
MD5 | 42192affb61075a4c8af95129a19b23f |
|
BLAKE2b-256 | 94cb7f9c04f10f3ae2d796746d42c82acfd6112bcf9f563cb6f807a6dd498515 |
Close
Hashes for django_business_metrics-0.1.0a5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d63f9915543e9502796734ed7d2c9a76001de7a5d1b3a32e49e7b4956f4921d |
|
MD5 | da2abf520ef2435938fd2e3f3b1c6397 |
|
BLAKE2b-256 | 32b8e21b800557b20d338ff9390bcb3f00be40f169b6b549efeef61076e76da2 |