Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass auth for metrics #397

Merged
merged 2 commits into from
Jun 4, 2024
Merged
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
12 changes: 10 additions & 2 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"core.middleware.CustomErrorMiddleware",
"django_prometheus.middleware.PrometheusAfterMiddleware", # This needs to be the last middleware in the list. Avoid appending to this list and rather insert into -1.
# Prometheus needs to be the last middleware in the list.
# Avoid appending to this list and rather insert into -1.
"django_prometheus.middleware.PrometheusAfterMiddleware",
]

ROOT_URLCONF = "core.urls"
Expand Down Expand Up @@ -186,7 +188,10 @@

# Sentry Configuration
sentry_sdk.init(
dsn=os.environ.get("SENTRY_DSN_WORKAROUND"), # Datahub overwrites with this variable unless it is renamed, causing Sentry to tag issues with the incorrect environment
dsn=os.environ.get(
"SENTRY_DSN_WORKAROUND"
), # Datahub overwrites with this variable unless it is renamed,
# causing Sentry to tag issues with the incorrect environment
enable_tracing=True,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
Expand All @@ -213,6 +218,9 @@
"REDIRECT_URI": os.environ.get("AZURE_REDIRECT_URI"),
"SCOPES": ["User.Read"],
"AUTHORITY": os.environ.get("AZURE_AUTHORITY"),
"PUBLIC_PATHS": [
"/metrics",
],
}
LOGIN_URL = "/azure_auth/login"
LOGIN_REDIRECT_URL = "/" # Or any other endpoint
Expand Down