Environments in Sentry are string tags attached to every inbound event. They let you separate production errors from staging noise, scope alert rules to specific deployments, and track release adoption per environment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/getsentry/sentry/llms.txt
Use this file to discover all available pages before exploring further.
How environments work
When an SDK sends an event, it includes anenvironment field. Sentry stores this value and creates an Environment record (scoped to the organization) the first time it sees a new name:
production environment record is shared across all projects in an organization.
Setting the environment in the SDK
Pass theenvironment option when initializing the SDK:
- Python
- JavaScript / Node.js
- Ruby
Environment name rules
Environment names are validated against a pattern defined insentry.constants.ENVIRONMENT_NAME_PATTERN. Names must:
- Be 64 characters or fewer
- Match the allowed character pattern (no null bytes or certain control characters)
production, staging, development, testing, qa, canary.
Filtering by environment in the UI
The environment selector appears at the top of most Sentry pages — Issues, Performance, Releases, and Dashboards. Selecting an environment filters all data on the page to events tagged with that environment.Environments and alert rules
Alert rules can be scoped to one or more environments. An issue alert configured forproduction only fires when matching events carry environment=production. This prevents staging errors from paging your on-call team.
To scope an alert:
- Open Alerts and create or edit an alert rule.
- Under Environment, select the environment(s) this rule should apply to.
Environments and releases
When you deploy a release, you associate it with an environment using sentry-cli or the Releases API:Hiding environments
If an environment accumulates stale data or was created by mistake, you can hide it from the UI. Hidden environments still appear in theEnvironmentProject table but are excluded from the environment selector: