How do I keep staging errors out of my production list?

Give staging its own Project and DSN, or keep the SDK off in staging. Setting environment in Sentry.init labels every event, but issues group across environments within a Project and the Errors list has no environment filter. A bug seen first in staging also uses up the new-issue email before it reaches production.

Last updated 26 November 2026. By Paul Badarau.

Kofi, a fictional developer, runs a small invoicing app with a staging copy he tests on. On Monday a test in staging throws TypeError: total is undefined, and Monitoring emails him about the new issue. On Wednesday the same bug reaches production. The production events join the issue staging opened, so no email arrives, and the issue looks two days old.

The environment option labels each error, log line and span, and the issue page shows the environment of every occurrence. It does not keep the two apart. Grouping covers every environment of a Project, and the Errors list filters by search text, level and period, with no environment filter. Keeping staging out takes one of these setups:

  1. A Project for staging. Add it to your Workspace in Accounts, turn it on in Monitoring Setup, and create a DSN for it. Build staging with that DSN and production with the production DSN. Each Project has its own issues, counts and new-issue emails.
  2. No staging events at all. Pass enabled: false to Sentry.init in the staging build, so the SDK sends nothing from there.
  3. In both cases, still set environment: 'staging' or environment: 'production' in each build. The label shows on every event, so a staging event sent with the wrong DSN is easy to spot.

Only Owners and Administrators can turn on a Project and create DSN keys. A Viewer can read both lists.

The two Projects still share one allowance. Errors and log lines from every Project count toward the Workspace's 10,000 Monitoring events a month, so a noisy staging build spends the same events as production. Going over the limit does not stop collection, and the Owner is warned.

The product page for this is Monitoring.

Start your 14-day free trial