首页/ AI 技能 / @skilllib/skill-2014279412617785347
Skill站外收录 @skilllib/skill-2014279412617785347

sentry-multi-env-setup

支持在开发、预发布和生产环境中分别配置 Sentry,实现错误数据的环境隔离与差异化处理,包括按环境设定采样率、动态加载 DSN、添加环境上下文标签、设置分级告警规则及仪表盘过滤策略。

0.0 (0) 137 次安装 原作者 编程导航
收录于 2026-01-22
开发运维 AI 技能

Skills.MD

# Sentry Multi Env Setup ## Prerequisites - Environment naming convention defined - DSN management strategy - Sample rate requirements per environment - Alert routing per environment ## Instructions 1. Set environment option in SDK init to match deployment target 2. Configure environment-specific sample rates (100% dev, 10% prod) 3. Choose project structure (single with environments vs separate projects) 4. Set up separate DSNs per environment in environment variables 5. Implement conditional DSN loading to disable in development 6. Add environment context and tags in beforeSend hook 7. Configure environment filters in Sentry dashboard 8. Create production-only alert rules with appropriate conditions 9. Set up lower-priority staging alerts for development feedback 10. 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. ## Resources - [Sentry Environments](https://docs.sentry.io/product/sentry-basics/environments/) - [Filtering Events](https://docs.sentry.io/platforms/javascript/configuration/filtering/)

评论 0

还没有评论,来抢沙发。