feat: name field for sentry

This commit is contained in:
DIYgod
2019-09-03 23:06:44 +08:00
parent 70c9546871
commit 3cebb70ef4

View File

@@ -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);
});