Django Prometheus business metrics
Reason this release was yanked:
It's a broken version, models.py file shouldn't be there
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
This project uses ApiVer. Always import from
django_business_metrics.v0
namespace and not fromdjango_business_metrics
.
-
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.
Development
poetry install
Before committing make sure to run:
nox -s format test
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-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ecde5230fc595f043543b9499e9b70f4ed190657737de451d46fb7559f17c29 |
|
MD5 | 0c8ac280fd4bbd6bd27cb2b721bf9f2f |
|
BLAKE2b-256 | f2fbc55673a56fb3cf6e39656964d436f3a9dc941a0e0fa477cb085ced9c7652 |
Close
Hashes for django_business_metrics-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aaf4c77873782a364908dc0b4ed2976eee49408c8537b14c9acfc1771f5ec11 |
|
MD5 | a4e60b3c5aeebe811cebc81e9f0dcc3c |
|
BLAKE2b-256 | 34f2438a026d728f1c4598ed4299dbd2d7135f3527339f99614284a48662c99e |