From cb6edcb19897ec815fdf3bf7375690bbad46e634 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 13 Dec 2021 16:15:27 +0100 Subject: [PATCH] core: set tag with request ID Signed-off-by: Jens Langhammer --- authentik/core/middleware.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/authentik/core/middleware.py b/authentik/core/middleware.py index 5dadd1f27..11834dbed 100644 --- a/authentik/core/middleware.py +++ b/authentik/core/middleware.py @@ -5,6 +5,7 @@ from typing import Callable from uuid import uuid4 from django.http import HttpRequest, HttpResponse +from sentry_sdk.api import set_tag SESSION_IMPERSONATE_USER = "authentik_impersonate_user" SESSION_IMPERSONATE_ORIGINAL_USER = "authentik_impersonate_original_user" @@ -50,6 +51,7 @@ class RequestIDMiddleware: "request_id": request_id, "host": request.get_host(), } + set_tag("authentik.request_id", request_id) response = self.get_response(request) response[RESPONSE_HEADER_ID] = request.request_id setattr(response, "ak_context", {})