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.0a2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c827633df1b034213f4e04488cc0fd2ddd2dd330cbfd592c9e10bccaea71c09 |
|
MD5 | c40050a66512cb3260febd2b1b71d320 |
|
BLAKE2b-256 | 2985ea9a7b6d396496ae2b2637efab0de7f21ddd75f1e31b23cd72fc9beb054b |
Close
Hashes for django_business_metrics-0.1.0a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c733a14bf7133a9a4421868649702251e007867e61e9b0b3d1b0a587c9585dc0 |
|
MD5 | 8cfcf029098c4384cf7c74746f252e0d |
|
BLAKE2b-256 | c18236c55e171fa813359fa106d3723d6674d86a7fe6fa88e5c09809e19d06bc |