Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nextjs): Add excludeServerRoutes option to manual setup page #5789

Merged
merged 2 commits into from Nov 17, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Nov 15, 2022

This adds the new excludeServerRoutes option in the nextjs SDK (added in getsentry/sentry-javascript#6207) to the docs. It also pulls all of the auto-instrumentation config into its own section in the manual setup page.

(Note: The only part of this which is actually new content is the Opt Out of Auto-instrumentation on Specific Routes section. Everything else is just stuff moving around.)

lobsterkatie added a commit to getsentry/sentry-javascript that referenced this pull request Nov 15, 2022
Currently, in the nextjs SDK, we inject the user's `Sentry.init()` code (by way of their `sentry.server.config.js` file) into all serverside routes. This adds a new option to the `sentry` object in `next.config.js` which allows users to prevent specific routes from being instrumented in this way. In this option, excluded routes can be specified using either strings (which need to exactly match the route) or regexes.

Note: Heavily inspired by #6125. h/t to @lforst for his work there. Compared to that PR, this one allows non-API routes to be excluded and allows excluded pages to be specified as routes rather than filepaths. (Using routes a) obviates the need for users to add `pages/` to the beginning of every entry, b) abstracts away the differences between windows and POSIX paths, and c) futureproofs users' config values against underlying changes to project file organization.)

Docs for this feature are being added in getsentry/sentry-docs#5789.

Fixes #6119.
Fixes #5964.
@vercel
Copy link

vercel bot commented Nov 15, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
sentry-docs ✅ Ready (Inspect) Visit Preview Nov 17, 2022 at 5:46AM (UTC)

Copy link
Contributor

@lizokm lizokm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a few small stylistic tweaks, but otherwise this looks great!

src/platforms/javascript/guides/nextjs/manual-setup.mdx Outdated Show resolved Hide resolved
src/platforms/javascript/guides/nextjs/manual-setup.mdx Outdated Show resolved Hide resolved
src/platforms/javascript/guides/nextjs/manual-setup.mdx Outdated Show resolved Hide resolved
src/platforms/javascript/guides/nextjs/manual-setup.mdx Outdated Show resolved Hide resolved
src/platforms/javascript/guides/nextjs/manual-setup.mdx Outdated Show resolved Hide resolved
Co-authored-by: Liza Mock <lizka920@gmail.com>
@lobsterkatie lobsterkatie merged commit 846a492 into master Nov 17, 2022
@lobsterkatie lobsterkatie deleted the kmclb-nextjs-add-excludeServerRoutes-option branch November 17, 2022 14:30
lforst pushed a commit that referenced this pull request Nov 22, 2022
…5789)

This adds the new `excludeServerRoutes` option in the nextjs SDK (added in getsentry/sentry-javascript#6207) to the docs. It also pulls all of the auto-instrumentation config into its own section in the manual setup page.

(Note: The only part of this which is actually new content is the `Opt Out of Auto-instrumentation on Specific Routes` section. Everything else is just stuff moving around.)
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants