Issue
I am deploying my apps through Vercel and have connected the Sentry Vercel integration to it. I'm noticing that my events have vercel-preview
and vercel-production
environment values, which I didn't set. How are these being set?
Applies To
- All SaaS Customers
- NextJS
- Vercel
Resolution
This is because of Vercel's system environment variables. When you deploy a Next.js app on Vercel, Vercel sets environment variables such as VERCEL_ENV
during the build and runtime of your application. This variable indicates the type of deployment (preview and production).
If you do not explicitly set the environment in your Sentry configuration, Sentry defaults to reading the environment from the runtime environment variables. The Sentry Vercel integration uses the VERCEL_ENV
variable to determine the environment and appends vercel-
as a prefix. This results in environments like vercel-preview
and vercel-production
.
Therefore, if you manually set the environment value in your Sentry configuration, you should see that value in your Sentry events too.