-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(nextjs): Add excludeServerRoutes
option to manual setup page
#5789
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
Merged
lobsterkatie
merged 2 commits into
master
from
kmclb-nextjs-add-excludeServerRoutes-option
Nov 17, 2022
Merged
feat(nextjs): Add excludeServerRoutes
option to manual setup page
#5789
lobsterkatie
merged 2 commits into
master
from
kmclb-nextjs-add-excludeServerRoutes-option
Nov 17, 2022
Conversation
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
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.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
lforst
approved these changes
Nov 16, 2022
lizokm
approved these changes
Nov 16, 2022
There was a problem hiding this 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!
Co-authored-by: Liza Mock <lizka920@gmail.com>
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.)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.)