diff --git a/authentik/tenants/middleware.py b/authentik/tenants/middleware.py index 3739422fe..01a54a87e 100644 --- a/authentik/tenants/middleware.py +++ b/authentik/tenants/middleware.py @@ -3,6 +3,7 @@ from typing import Callable from django.http.request import HttpRequest from django.http.response import HttpResponse +from sentry_sdk.api import set_tag from authentik.tenants.utils import get_tenant_for_request @@ -19,4 +20,6 @@ class TenantMiddleware: if not hasattr(request, "tenant"): tenant = get_tenant_for_request(request) setattr(request, "tenant", tenant) + set_tag("authentik.tenant_uuid", tenant.tenant_uuid.hex) + set_tag("authentik.tenant_domain", tenant.domain) return self.get_response(request)