diff --git a/server/app.js b/server/app.js index f778ec53f..56db34a09 100644 --- a/server/app.js +++ b/server/app.js @@ -119,6 +119,18 @@ app.on("error", (error, ctx) => { if (requestId) { scope.setTag("request_id", requestId); } + + const authType = ctx.state ? ctx.state.authType : undefined; + if (authType) { + scope.setTag("auth_type", authType); + } + + const userId = + ctx.state && ctx.state.user ? ctx.state.user.id : undefined; + if (userId) { + scope.setUser({ id: userId }); + } + scope.addEventProcessor(function (event) { return Sentry.Handlers.parseRequest(event, ctx.request); });