diff --git a/apprise_api/core/settings/__init__.py b/apprise_api/core/settings/__init__.py index 45921c0..7090b14 100644 --- a/apprise_api/core/settings/__init__.py +++ b/apprise_api/core/settings/__init__.py @@ -61,12 +61,17 @@ INSTALLED_APPS = [ # Apprise API 'api', + + # Prometheus + 'django_prometheus', ] MIDDLEWARE = [ + 'django_prometheus.middleware.PrometheusBeforeMiddleware', 'django.middleware.common.CommonMiddleware', 'core.middleware.theme.AutoThemeMiddleware', 'core.middleware.config.DetectConfigMiddleware', + 'django_prometheus.middleware.PrometheusAfterMiddleware', ] ROOT_URLCONF = 'core.urls' diff --git a/apprise_api/core/urls.py b/apprise_api/core/urls.py index eb4acd6..04e87fe 100644 --- a/apprise_api/core/urls.py +++ b/apprise_api/core/urls.py @@ -29,4 +29,5 @@ from api import urls as api_urls urlpatterns = [ path('', include(api_urls)), + path('', include('django_prometheus.urls')), ] diff --git a/requirements.txt b/requirements.txt index 2015575..d372836 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,3 +24,6 @@ requests paho-mqtt < 2.0.0 gntp cryptography + +# prometheus metrics +django-prometheus