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.0a4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017043eeef0fd963a33c886a4ede967d1548a5a5c822cd5de69f985e75d8bb71 |
|
MD5 | 074a2fa1db594d47141b76e40ccbd924 |
|
BLAKE2b-256 | f4ec5f32e22f64cbc654e8f14ee94d4478582bf61daca5416e806a13b1f0a931 |
Close
Hashes for django_business_metrics-0.1.0a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c785a41f2881f027f5093324e422d86aeb4ecad9744fec8902d42c126649b26 |
|
MD5 | 8cebd9f29ba7925ea69d123d14624e95 |
|
BLAKE2b-256 | b64262475a3ec04563e955cc30ea90d0d1c27f8c13b81174a36b2a0b2f0f59ff |