From af60efa365922e77ce18cb61e910dd32923a4ee6 Mon Sep 17 00:00:00 2001 From: Edward Oliveira Date: Wed, 16 Nov 2022 13:11:28 -0300 Subject: [PATCH] HOT-FIX: Add Prometheus metrics --- sapl/settings.py | 4 ++++ sapl/urls.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sapl/settings.py b/sapl/settings.py index 35200a41e..20fac0385 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -93,6 +93,8 @@ INSTALLED_APPS = ( 'webpack_loader', + 'django_prometheus', + ) + SAPL_APPS # FTS = Full Text Search @@ -123,6 +125,7 @@ HAYSTACK_CONNECTIONS = { } MIDDLEWARE = [ + 'django_prometheus.middleware.PrometheusBeforeMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', @@ -132,6 +135,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', + 'django_prometheus.middleware.PrometheusAfterMiddleware', ] if DEBUG: INSTALLED_APPS += ('debug_toolbar',) diff --git a/sapl/urls.py b/sapl/urls.py index 155a7e591..5f5c2e30f 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -69,6 +69,8 @@ urlpatterns += [ path("robots.txt", TemplateView.as_view( template_name="robots.txt", content_type="text/plain")), + path('prometheus/', include('django_prometheus.urls')), + ]