From 3cebb70ef4243445b13b81a0d4df7b757b035492 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 3 Sep 2019 23:06:44 +0800 Subject: [PATCH] feat: name field for sentry --- lib/middleware/onerror.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/middleware/onerror.js b/lib/middleware/onerror.js index ec4bacf6b9..faf0331588 100644 --- a/lib/middleware/onerror.js +++ b/lib/middleware/onerror.js @@ -35,6 +35,7 @@ module.exports = async (ctx, next) => { if (config.sentry) { Sentry.withScope((scope) => { scope.setTag('route', ctx._matchedRoute); + scope.setTag('name', ctx.request.path.split('/')[1]); scope.addEventProcessor((event) => Sentry.Handlers.parseRequest(event, ctx.request)); Sentry.captureException(err); });