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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4933b9d858759e33fbd081f5062146545716ceaaf6065ea0aeee825fed198cc3 |
|
MD5 | ed0e4a950cf38abf780084ca24e6ab78 |
|
BLAKE2b-256 | 1c300ffc6a5b1b5b8089394befdc5f5ae3107596371550dbec2a5b65f04493e7 |
Close
Hashes for django_business_metrics-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0892452535b25b04ac5c933fdbd2b83623de638e21f5fa7fa945d7deda38b5d |
|
MD5 | 167e0cdf87a8940b806dde4183b9f126 |
|
BLAKE2b-256 | 03d3b44d0ee14c6ffb6949d7612de4bafa8ba8def90061f5a2e2d012baa8aac0 |