技能 编程开发 多环境 Sentry 配置

多环境 Sentry 配置

v20260311
sentry-multi-env-setup
在开发、预发和生产环境间配置 Sentry,分别管理 DSN、采样率与告警,便于团队隔离问题并减少无关提醒。
获取技能
194 次下载
概览

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 ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error handling.

Examples

See ${CLAUDE_SKILL_DIR}/references/examples.md for detailed examples.

Resources

Overview

Configure Sentry across multiple environments.

信息
Category 编程开发
Name sentry-multi-env-setup
版本 v20260311
大小 2.89KB
更新时间 2026-03-12
语言