sentry-multi-env-setup
Sentry 多环境配置 - 在设置开发/预发布/生产环境的 Sentry、管理特定环境的配置或隔离数据时使用。使用短语如“sentry 环境”、“sentry 预发布设置”、“多环境 sentry”、“sentry 开发与生产”触发。
📖 中文导读:Sentry 多环境配置 - 在设置开发/预发布/生产环境的 Sentry、管理特定环境的配置或隔离数据时使用。使用短语如“sentry 环境”、“sentry 预发布设置”、“多环境 sentry”、“sentry 开发与生产”触发。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: sentry-multi-env-setup description: | 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". allowed-tools: Read, Write, Edit, Grep version: 1.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io
Sentry Multi Env Setup
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
- Separate or shared projects configured
- Environment-based alert rules
- Sample rates optimized per environment
Error Handling
See {baseDir}/references/errors.md for comprehensive error handling.
Examples
See {baseDir}/references/examples.md for detailed examples.