Conversation
Sentry was initialized unconditionally in app and portal across the server, edge, and client runtimes. The DSN has a hardcoded fallback and there was no environment gating, so every Vercel deployment — production AND every preview/branch deploy — reported into the same Sentry project, creating noise. Gate ingestion on the Vercel environment via the `enabled` option: - server/edge configs: VERCEL_ENV === 'production' - client configs: NEXT_PUBLIC_VERCEL_ENV === 'production' (inlined at build time) `enabled: false` makes the SDK a silent no-op (it never throws); a missing var resolves to false, so the worst case is Sentry being off in a non-prod env — never a runtime error or a broken build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(sentry): only report errors from the production environment
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
🎉 This PR is included in version 3.82.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Enable Sentry only in production for both app and portal (server, edge, and client) to stop preview/dev deployments from sending events. This cuts noise and avoids quota burn without risking runtime errors.
enabled: server/edge useVERCEL_ENV === 'production', client usesNEXT_PUBLIC_VERCEL_ENV === 'production'.Written for commit 6b0878c. Summary will update on new commits.