Sentry Multi Env Setup
Configure Sentry across multiple environments.
Use when setting up Sentry for dev/staging/production,
managing environment-specific configurations, or isolating data.
Trigger with phrases like "sentry environments", "sentry staging setup",
"multi-environment sentry", "sentry dev vs prod".
Prerequisites
- Environment naming convention defined
- DSN management strategy
- Sample rate requirements per environment
- Alert routing per environment
Instructions
- Set environment option in SDK init to match deployment target
- Configure environment-specific sample rates (100% dev, 10% prod)
- Choose project structure (single with environments vs separate projects)
- Set up separate DSNs per environment in environment variables
- Implement conditional DSN loading to disable in development
- Add environment context and tags in beforeSend hook
- Configure environment filters in Sentry dashboard
- Create production-only alert rules with appropriate conditions
- Set up lower-priority staging alerts for development feedback
- Document environment configuration and best practices for team
Output
- Environment-specific Sentry configuration