From 67d0a1318e46d5c9f10507a397fb2fd51f9e27fb Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Mon, 19 Dec 2022 16:44:15 +0300 Subject: [PATCH] Fix Histogram does not honor PROMETHEUS_LATENCY_BUCKETS --- django_prometheus/middleware.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/django_prometheus/middleware.py b/django_prometheus/middleware.py index fd72d784..98f87ca5 100644 --- a/django_prometheus/middleware.py +++ b/django_prometheus/middleware.py @@ -61,6 +61,9 @@ def register(self): "Histogram of requests processing time (including middleware " "processing time)." ), + buckets=getattr( + settings, "PROMETHEUS_LATENCY_BUCKETS", DEFAULT_LATENCY_BUCKETS + ), namespace=NAMESPACE, ) self.requests_unknown_latency_before = self.register_metric(