@mantris/appify
Version:
Very opinionated Node.js API boilerplate as module.
17 lines (13 loc) • 367 B
JavaScript
const Sentry = require('@sentry/node')
/**
* @return {Function} Middleware.
*/
module.exports = () => (req, res, next) => {
Sentry.withScope((scope) => {
scope.setTag('deeptrace_id', req.deeptrace.id)
scope.setTag('deeptrace_parent_id', req.deeptrace.parentid)
scope.setTag('deeptrace_root_id', req.deeptrace.rootid)
next()
})
}