Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Created November 11, 2018 19:19
Show Gist options
  • Save dwelch2344/6331c3981bbefa860b7b2504e9c68451 to your computer and use it in GitHub Desktop.
Save dwelch2344/6331c3981bbefa860b7b2504e9c68451 to your computer and use it in GitHub Desktop.
//...
const middleware = {
before: (handler, next) => {
Sentry.configureScope(scope => {
const route = pathOr('<unknown>', ['event', 'path'], handler)
handler.context.sentry = scope
// doesn't work
// scope.addBreadcrumb({ message: 'scope.breadcrumb route=' + route }, 100)
Sentry.addBreadcrumb(
{ message: 'Sentry.breadcrumb route=' + route },
null,
scope
)
// scope.setExtra('route', route)
// scope.setTag('user_mode', 'admin');
// scope.setUser({ id: '4711' })
next()
})
},
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment