Environments let you separate data from different deployment stages within a single Sentry project. You can filter the issue stream, performance data, and alerts to only show events from a specific environment likeDocumentation Index
Fetch the complete documentation index at: https://sentrydocs.dev/llms.txt
Use this file to discover all available pages before exploring further.
production, staging, or development.
How environments work
An environment is a tag attached to every event your SDK sends. When you set theenvironment option in the Sentry SDK, all events from that instance are tagged with that environment name. Sentry then lets you filter any view by environment.
Environments are scoped to your organization — if two projects both send events tagged production, they share the same production environment at the organization level.
Setting the environment in your SDK
Configure the environment when you initialize Sentry:Filtering by environment in the UI
The environment selector appears at the top of most Sentry views. Selecting an environment filters:- The issue stream
- Issue event counts and graphs
- Performance data
- Release health metrics
- Dashboards
Environment-specific alert rules
Alert rules can be scoped to a specific environment. When you create an issue alert or metric alert, you can optionally restrict it to fire only for events from a chosen environment. This means you can have a high-urgency alert forproduction and a lower-priority alert (or no alert at all) for staging.
To set an environment on an alert:
- Go to Alerts → Create Alert
- In the alert configuration form, find the Environment field
- Select the environment this rule should apply to
If you leave the environment field blank, the alert applies to events from all environments.
Hidden environments
If you send events to Sentry from environments likelocal, test, or ci, the environment list can become cluttered. You can hide an environment so it doesn’t appear in the environment selector by default.
To hide an environment:
- Go to Settings → Environments
- Click the environment you want to hide
- Toggle Hide from project filters
Best practices
- Use consistent names across your SDK deployments.
production,staging, anddevelopmentare conventional names. Avoid variations likeprod,PRODUCTION, orProduction, which Sentry treats as separate environments. - Avoid environment names that change per-deploy (e.g. a commit SHA). Environments are organization-wide and a new name creates a new environment record every time.
- Scope production alerts tightly by setting
environment: productionon your most critical alert rules, so staging noise doesn’t page your on-call team.