From e2a37c31c0aad3fe36e9f5a392e40a3a0f6e81ee Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 23 Apr 2021 13:16:31 +0100 Subject: [PATCH] Use default registry when `prometheus_multiproc_dir` is set This should allow custom metrics to be used (unless I've missed something) --- django_prometheus/exports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_prometheus/exports.py b/django_prometheus/exports.py index 91c8dfe7..8630400d 100644 --- a/django_prometheus/exports.py +++ b/django_prometheus/exports.py @@ -117,7 +117,7 @@ def ExportToDjangoView(request): You can use django_prometheus.urls to map /metrics to this view. """ if "prometheus_multiproc_dir" in os.environ: - registry = prometheus_client.CollectorRegistry() + registry = prometheus_client.REGISTRY multiprocess.MultiProcessCollector(registry) else: registry = prometheus_client.REGISTRY