Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@
[]) + ['admin_extra_buttons', ]

# add the local apps
INSTALLED_APPS += ['cloudharness_django', ]
INSTALLED_APPS += ['cloudharness_django', 'django_prometheus']

# add the CloudHarness Django auto login middleware
MIDDLEWARE = getattr(
settings,
'MIDDLEWARE',
[]
) + [
'cloudharness_django.middleware.BearerTokenMiddleware',
]
MIDDLEWARE = \
['django_prometheus.middleware.PrometheusBeforeMiddleware'] + \
getattr(
settings,
'MIDDLEWARE',
[]
) + \
[
'cloudharness_django.middleware.BearerTokenMiddleware',
'django_prometheus.middleware.PrometheusAfterMiddleware'
]

USER_CHANGE_ENABLED = False

Expand Down Expand Up @@ -92,3 +96,7 @@
},
},
}

if settings.ROOT_URLCONF:
APP_URLCONF = settings.ROOT_URLCONF
ROOT_URLCONF = "cloudharness_django.urls"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.conf import settings
from django.urls import include, path


urlpatterns = []

urlpatterns.append(path('prometheus/', include('django_prometheus.urls')))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually /metrics is used, it's a kind of convention I'd follow also here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding also the endpoint to the GK white listed by default will make life easier

urlpatterns.append(path('', include(settings.APP_URLCONF)))
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = BSD-3-Clause
classifiers =
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 3.0.7

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? We are on django 5 actually

Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Expand All @@ -34,3 +34,4 @@ install_requires =
psycopg2-binary>=2.9.3
Pillow>=9.2.0
python-keycloak
django-prometheus
Loading