sentry-fix-issues
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFix Sentry Issues
修复Sentry问题
Discover, analyze, and fix production issues using Sentry's full debugging capabilities.
利用Sentry的完整调试能力发现、分析并修复生产环境问题。
Invoke This Skill When
何时调用此技能
- User asks to "fix Sentry issues" or "resolve Sentry errors"
- User wants to "debug production bugs" or "investigate exceptions"
- User mentions issue IDs, error messages, or asks about recent failures
- User wants to triage or work through their Sentry backlog
- 用户要求“修复Sentry问题”或“解决Sentry错误”
- 用户希望“调试生产环境Bug”或“排查异常”
- 用户提及问题ID、错误消息,或询问近期故障情况
- 用户希望分类处理或清理Sentry中的待处理问题积压
Prerequisites
前置条件
- Sentry MCP server configured and connected
- Access to the Sentry project/organization
- 已配置并连接Sentry MCP服务器
- 拥有Sentry项目/组织的访问权限
Phase 1: Issue Discovery
阶段1:问题发现
Use Sentry MCP to find issues. Confirm with user which issue(s) to fix before proceeding.
| Search Type | MCP Call |
|---|---|
| Recent unresolved | |
| Specific error type | |
| By ID | |
使用Sentry MCP查找问题。在开始处理前,与用户确认需要修复的具体问题。
| 搜索类型 | MCP调用 |
|---|---|
| 近期未解决问题 | |
| 特定错误类型 | |
| 按ID查询 | |
Phase 2: Deep Issue Analysis
阶段2:问题深度分析
Gather ALL available context for each issue:
| Data Source | MCP Call | Extract |
|---|---|---|
| Core Error | | Exception type/message, full stack trace, file paths, line numbers, function names |
| Event Details | | Breadcrumbs, tags, custom context, request data |
| Trace (if available) | | Parent transaction, spans, DB queries, API calls, error location |
| Replay (if available) | | User actions, UI state, network requests |
收集每个问题的所有可用上下文信息:
| 数据源 | MCP调用 | 提取内容 |
|---|---|---|
| 核心错误 | | 异常类型/消息、完整堆栈跟踪、文件路径、行号、函数名称 |
| 事件详情 | | Breadcrumbs、标签、自定义上下文、请求数据 |
| 链路追踪(若可用) | | 父事务、Span、数据库查询、API调用、错误位置 |
| 会话重放(若可用) | | 用户操作、UI状态、网络请求 |
Phase 3: Root Cause Hypothesis
阶段3:根本原因假设
Before touching code, document:
- Error Summary: One sentence describing what went wrong
- Immediate Cause: The direct code path that threw
- Root Cause Hypothesis: Why the code reached this state
- Supporting Evidence: Breadcrumbs, traces, or context supporting this
- Alternative Hypotheses: What else could explain this? Why is yours more likely?
Challenge yourself: Is this a symptom of a deeper issue? Check for similar errors elsewhere, related issues, or upstream failures in traces.
在修改代码前,记录以下内容:
- 错误摘要:用一句话描述问题现象
- 直接原因:抛出错误的直接代码路径
- 根本原因假设:代码为何会进入该状态
- 支持证据:能支撑该假设的Breadcrumbs、链路追踪或上下文信息
- 备选假设:还有哪些可能的原因?为何你的假设更合理?
自我验证:这是否是更深层次问题的表象?检查是否存在其他类似错误、相关问题,或链路追踪中的上游故障。
Phase 4: Code Investigation
阶段4:代码排查
| Step | Actions |
|---|---|
| Locate Code | Read every file in stack trace from top down |
| Trace Data Flow | Find value origins, transformations, assumptions, validations |
| Error Boundaries | Check for try/catch - why didn't it handle this case? |
| Related Code | Find similar patterns, check tests, review recent commits ( |
| 步骤 | 操作内容 |
|---|---|
| 定位代码 | 自上而下阅读堆栈跟踪中的所有文件 |
| 追踪数据流 | 查找值的来源、转换过程、预设条件及验证逻辑 |
| 错误边界 | 检查try/catch语句 - 为何未处理该场景? |
| 相关代码 | 查找类似代码模式,检查测试用例,查看最近的提交记录( |
Phase 5: Implement Fix
阶段5:实施修复
Before writing code, confirm your fix will:
- Handle the specific case that caused the error
- Not break existing functionality
- Handle edge cases (null, undefined, empty, malformed)
- Provide meaningful error messages
- Be consistent with codebase patterns
Apply the fix: Prefer input validation > try/catch, graceful degradation > hard failures, specific > generic handling, root cause > symptom fixes.
Add tests reproducing exact Sentry event conditions and verifying edge cases.
在编写代码前,确认你的修复方案能够:
- 处理引发错误的特定场景
- 不会破坏现有功能
- 处理边缘场景(null、undefined、空值、格式错误)
- 提供有意义的错误消息
- 与代码库的编码模式保持一致
实施修复: 优先选择输入验证而非try/catch,优雅降级而非硬崩溃,特定处理而非通用处理,修复根本原因而非仅处理表象。
添加测试用例,复现Sentry事件的精确条件并验证边缘场景。
Phase 6: Verification Audit
阶段6:验证审核
Complete before declaring fixed:
| Check | Questions |
|---|---|
| Evidence | Does fix address exact error message? Handle data state shown? Prevent ALL events? |
| Regression | Could fix break existing functionality? Other code paths affected? Backward compatible? |
| Completeness | Similar patterns elsewhere? Related Sentry issues? Add monitoring/logging? |
| Self-Challenge | Root cause or symptom? Considered all event data? Will handle if occurs again? |
在宣布问题修复前完成以下检查:
| 检查项 | 问题 |
|---|---|
| 证据验证 | 修复方案是否解决了 exact 错误消息?是否处理了显示的数据状态?是否能阻止所有同类事件? |
| 回归风险 | 修复是否会破坏现有功能?是否影响其他代码路径?是否向后兼容? |
| 完整性 | 是否存在其他类似代码模式?是否有相关的Sentry问题?是否需要添加监控/日志? |
| 自我验证 | 修复的是根本原因还是仅处理表象?是否考虑了所有事件数据?如果问题再次出现是否能处理? |
Phase 7: Report Results
阶段7:报告结果
Format:
undefined格式:
undefinedFixed: [ISSUE_ID] - [Error Type]
Fixed: [ISSUE_ID] - [Error Type]
- Error: [message], Frequency: [X events, Y users], First/Last: [dates]
- Root Cause: [one paragraph]
- Evidence: Stack trace [key frames], breadcrumbs [actions], context [data]
- Fix: File(s) [paths], Change [description]
- Verification: [ ] Exact condition [ ] Edge cases [ ] No regressions [ ] Tests [y/n]
- Follow-up: [additional issues, monitoring, related code]
undefined- Error: [message], Frequency: [X events, Y users], First/Last: [dates]
- Root Cause: [one paragraph]
- Evidence: Stack trace [key frames], breadcrumbs [actions], context [data]
- Fix: File(s) [paths], Change [description]
- Verification: [ ] Exact condition [ ] Edge cases [ ] No regressions [ ] Tests [y/n]
- Follow-up: [additional issues, monitoring, related code]
undefinedQuick Reference
快速参考
MCP Tools: , , , , , ,
sentry_search_issuessentry_get_issuesentry_get_eventsentry_get_tracesentry_get_replaysentry_list_projectssentry_get_projectCommon Patterns: TypeError (check data flow, API responses, race conditions) • Promise Rejection (trace async, error boundaries) • Network Error (breadcrumbs, CORS, timeouts) • ChunkLoadError (deployment, caching, splitting) • Rate Limit (trace patterns, throttling) • Memory/Performance (trace spans, N+1 queries)
MCP工具: , , , , , ,
sentry_search_issuessentry_get_issuesentry_get_eventsentry_get_tracesentry_get_replaysentry_list_projectssentry_get_project常见错误模式: TypeError(检查数据流、API响应、竞态条件)• Promise Rejection(追踪异步逻辑、错误边界)• Network Error(检查Breadcrumbs、CORS、超时)• ChunkLoadError(部署、缓存、代码拆分问题)• Rate Limit(追踪调用模式、限流)• 内存/性能问题(追踪Span、N+1查询)