Skip to content

fix(sentry): Report Vercel environment instead of NODE_ENV - #210

Merged
sergical merged 1 commit into
mainfrom
cursor/rollouts-sentry-environments-5cfc
Sep 29, 2026
Merged

sergical merged 1 commit into
mainfrom
cursor/rollouts-sentry-environments-5cfc

Conversation

@sergical

Copy link
Copy Markdown
Member

Both Sentry configs set environment: process.env.NODE_ENV, which is production on every Vercel build. Preview deploys were therefore reported as production, so preview traffic was mixed into production errors and web vitals.

This change uses the Vercel environment instead:

  • Client: NEXT_PUBLIC_VERCEL_ENV, which Vercel exposes to Next.js projects automatically.
  • Server: VERCEL_ENV.
  • Local development falls back to NODE_ENV, as before.

The production name doesn't change, so existing alerts and dashboards filtered on environment:production keep working. Only preview traffic moves, to preview.

This prepares the repo for Cursor Rollouts, which verifies each environment separately against telemetry. It also adds a short Telemetry section to AGENTS.md, covering the Sentry project, environment and release conventions, and web vitals coverage, so agents know where to look.

Web vitals for soft navigations (getsentry/sentry-javascript#23425) are already on by default in @sentry/nextjs 11.0.0 (webVitalsIntegration({ softNavigations: true }), with span streaming as the default), so no SDK config change is needed.

Verified with biome check and pnpm test:run.

Open in Web Open in Cursor 

Preview and production deploys both reported environment=production,
mixing preview traffic into production web vitals and errors. Use the
Vercel environment so each can be compared on its own (e.g. by Cursor
Rollouts, which tracks each environment separately).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-changelog Ready Ready Preview Sep 29, 2026 6:57pm UTC

Request Review

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤙

@sergical
sergical merged commit a502c89 into main Sep 29, 2026
15 checks passed
@sergical
sergical deleted the cursor/rollouts-sentry-environments-5cfc branch September 29, 2026 21:40

This branch was successfully deployed

1 active deployment
Preview — 1007bec6 Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants