Created
November 11, 2018 19:19
-
-
Save dwelch2344/6331c3981bbefa860b7b2504e9c68451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //... | |
| 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