Skip to content

Commit 287e92f

Browse files
authored
feat(express): Add option of passing router to tracing integration (#2740)
As of getsentry/sentry-javascript#3078 the integration can also take a router instead of an app.
1 parent aa97ebe commit 287e92f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/platforms/node/guides/express/index.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ Sentry.init({
165165
// enable HTTP calls tracing
166166
new Sentry.Integrations.Http({ tracing: true }),
167167
// enable Express.js middleware tracing
168-
new Tracing.Integrations.Express({ app }),
168+
new Tracing.Integrations.Express({
169+
// to trace all requests to the default router
170+
app,
171+
// alternatively, you can specify the routes you want to trace:
172+
// router: someRouter,
173+
}),
169174
],
170175

171176
// We recommend adjusting this value in production, or using tracesSampler

0 commit comments

Comments
 (0)