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

sentry-known-pitfalls

聚焦 Sentry 实际部署中的典型误用场景,帮助识别初始化时机不当、重复初始化、错误对象捕获不规范、DSN 硬编码、采样率设置失当、事务未正确结束、source map 路径不匹配及告警阈值不合理等常见问题,并提供对应修复方案与配置验证。

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

Skills.MD

# Sentry Known Pitfalls ## Prerequisites - Existing Sentry implementation to review - Access to SDK configuration - Understanding of current error patterns - Codebase access for fixes ## Instructions 1. Verify SDK initialization happens before app starts 2. Check for single initialization point (no multiple init calls) 3. Use framework-specific SDK package for your framework 4. Ensure Error objects are captured (not strings) 5. Verify beforeSend returns event or null explicitly 6. Check DSN is in environment variables (not hardcoded) 7. Review sample rates for production appropriateness 8. Verify all transactions call finish() in try/finally 9. Check source map URL prefix matches actual URLs 10. Review alert configuration for threshold-based rules (avoid alert fatigue) ## Output - Pitfalls identified in current setup - Fixes applied for each issue - Configuration validated - Best practices checklist completed ## Error Handling See `{baseDir}/references/errors.md` for comprehensive error handling. ## Examples See `{baseDir}/references/examples.md` for detailed examples. ## Resources - [Sentry Best Practices](https://docs.sentry.io/product/issues/best-practices/) - [Troubleshooting Guide](https://docs.sentry.io/platforms/javascript/troubleshooting/)

评论 0

还没有评论,来抢沙发。