sentry-incident-runbook
jeremylongshore/claude-code-plugins-plus-skills
Sentry를 활용한 사고 대응 절차. 운영 환경의 문제 조사, 오류 분류 또는 사고 대응 워크플로우 수립 시 사용하십시오.“sentry incident response”, “sentry triage”, “investigate sentry error”, “sentry runbook”과 같은 문구를 사용하여 트리거하십시오.
...모든 것을 확장하십시오소개 sentry-incident-runbook
'sentry-incident-runbook' 스킬은 Sentry 내에서 인시던트 대응 절차를 간소화하기 위해 설계되었습니다. 이 스킬은 사용자가 프로덕션 환경의 문제를 조사하고, 오류를 분류하며, 체계적이고 효율적인 방식으로 인시던트 대응 워크플로를 생성할 수 있도록 지원합니다. Sentry와의 연동을 통해 이 스킬은 인시던트의 탐지부터 해결에 이르는 관리 과정을 단순화하여, 중대한 오류를 체계적으로 처리하고 시스템 가동 중단 시간을 최소화합니다. 이 스킬은 프로덕션 환경의 안정성을 유지해야 하는 팀에게 필수적이며, 문제를 신속하고 효과적으로 대응할 수 있도록 지원합니다.
주요 기능으로는 P0-P3 프레임워크를 활용한 인시던트 심각도 분류, 상세한 체크리스트를 통한 인시던트 분류, Sentry의 API 명령어를 활용하여 문제 세부 정보 및 이벤트 데이터를 수집하는 것이 포함됩니다. 또한 이 스킬은 배포 문제, 타사 서비스 장애, 데이터 손상, 리소스 고갈 등 오류의 성격에 따라 미리 정의된 해결 단계를 적용하는 데 도움을 줍니다. 더불어 사용자는 미리 만들어진 템플릿을 사용하여 조사 결과를 문서화하고, 사후 분석 보고서를 생성하며, 인시던트 상태를 전달할 수 있습니다. 이 스킬의 대상 사용자는 프로덕션 문제와 오류를 시기적절하고 체계적인 방식으로 관리해야 하며, 워크플로가 준수되고 모든 인시던트가 적절히 문서화 및 해결되도록 보장해야 하는 팀입니다.
'sentry-incident-runbook'는 DevOps 엔지니어, 사고 대응 담당자, 그리고 오류 관리 및 문제 해결에 관여하는 모든 기술 팀에 이상적입니다. 특히 신속한 대응과 명확한 문서화가 문제 재발 방지 및 원활한 프로덕션 시스템 유지에 결정적인 역할을 하는 환경에서 유용합니다.
자주 묻는 질문
이 스킬을 사용하기 위한 필수 조건은 무엇인가요?
프로젝트 이슈에 접근할 수 있는 Sentry 계정이 필요하며, 중대한 오류에 대한 알림 규칙이 구성되어 있고, 팀 알림 채널(예: Slack, PagerDuty)이 설정되어 있어야 하며, 오류 심각도 분류에 대한 이해가 필요합니다.
인시던트의 심각도는 어떻게 분류하나요?
사고 심각도는 오류 발생률과 사용자 영향도를 기준으로 P0~P3 프레임워크를 사용하여 분류됩니다. P0은 가장 높은 심각도로, 치명적인 문제를 의미합니다.
활성 Sentry 계정이 없어도 이 스킬을 사용할 수 있나요?
아니요, 이 스킬을 효과적으로 사용하려면 프로젝트 이슈에 접근할 수 있는 Sentry 계정이 반드시 필요합니다.
이 스킬로 관리할 수 있는 인시던트 유형에 제한이 있나요?
이 스킬은 Sentry에서 추적되는 인시던트와 연동되도록 설계되었으나, 오류 패턴 탐지 및 심각도 분류와 같이 Sentry가 지원하는 기능으로만 제한됩니다.
인시던트가 해결된 후에는 어떻게 되나요?
해결 후, 이 스킬은 사후 분석 보고서를 생성하는 데 도움을 주며, 근본 원인, 해결 과정 및 기타 관련 결과를 기록합니다.
Sentry Incident Runbook
Overview
Structured incident response framework built on Sentry's error monitoring platform. Covers the full lifecycle from alert detection through severity classification, root cause investigation using Sentry's breadcrumbs and stack traces, Discover queries for impact analysis, stakeholder communication, resolution via the Sentry API, and postmortem documentation with Sentry data exports.
Prerequisites
- Sentry account with project-level access and auth token (
SENTRY_AUTH_TOKEN) - Organization slug (
SENTRY_ORG) and project slug (SENTRY_PROJECT) configured @sentry/node(v8+) or equivalent SDK installed in the application- Alert rules configured for critical error thresholds
- Notification channels connected (Slack integration or PagerDuty)
Instructions
Step 1 — Classify Severity
Assign a severity level based on error frequency and user impact. This determines response time and escalation path.
| Severity | Error Criteria | User Impact | Response Time | Escalation |
|---|---|---|---|---|
| P0 — Critical | Crash-free rate below 95% or unhandled exception spike >500/min | Core flow blocked for all users, data loss risk | 15 minutes | PagerDuty page to on-call engineer |
| P1 — Major | New issue affecting >100 unique users per hour | Key feature degraded, no workaround | 1 hour | Slack #incidents channel, tag team lead |
| P2 — Minor | New issue affecting <100 unique users per hour | Feature degraded but workaround exists | Same business day | Slack #alerts-production |
| P3 — Low | Edge case, cosmetic error, staging-only issue | Minimal or no user-facing impact | Next sprint | Add to backlog, assign owner |
Decision logic for classification:
Alert fires →├── Check crash-free rate (Project Settings → Crash Free Sessions)│ └── Below 95%? → P0├── Check unique users affected (Issue Details → Users tab)│ ├── >100/hr on core flow? → P1│ └── <100/hr or workaround exists? → P2└── Staging-only or edge case? → P3Step 2 — Triage and Investigate
Execute this checklist within the first 15 minutes of a P0/P1 alert.
Initial triage (Sentry UI):
- Open the Sentry issue link from the alert notification
- Check the error frequency graph — determine if the rate is spiking, steady, or declining
- Read the "First Seen" and "Last Seen" timestamps to determine if this is new or a regression
- Check the "Users" count on the issue to quantify impact
- Verify the environment filter — confirm this is production, not staging
- Check the "Release" tag — identify which deployment introduced the error
- Open "Suspect Commits" to find the likely-causal changeset
Deep investigation (stack trace and breadcrumbs):
- Read the full stack trace — identify the failing function and line number
- Expand the breadcrumbs panel — trace the sequence of events leading to the error (HTTP requests, console logs, navigation, UI clicks)
- Check the user context panel for device, browser, OS, and custom user tags
- Review the "Tags" panel for patterns (specific release, region, browser)
API-based investigation:
# Fetch issue details programmaticallycurl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/issues/$ISSUE_ID/" \ | python3 -c "import json, sysissue = json.load(sys.stdin)print(f'Title: {issue[\"title\"]}')print(f'First Seen: {issue[\"firstSeen\"]}')print(f'Last Seen: {issue[\"lastSeen\"]}')print(f'Events: {issue[\"count\"]}')print(f'Users: {issue[\"userCount\"]}')print(f'Level: {issue[\"level\"]}')print(f'Status: {issue[\"status\"]}')print(f'Platform: {issue.get(\"platform\", \"unknown\")}')" || echo "ERROR: Failed to fetch issue — check SENTRY_AUTH_TOKEN and ISSUE_ID"# Fetch latest events for the issue (most recent 5)curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/issues/$ISSUE_ID/events/?per_page=5" \ | python3 -c "import json, sysevents = json.load(sys.stdin)for e in events: release = e.get('release', {}) ver = release.get('version', 'N/A') if isinstance(release, dict) else 'N/A' print(f'Event {e[\"eventID\"][:12]} | {e.get(\"dateCreated\", \"N/A\")} | Release: {ver}')" || echo "ERROR: Failed to fetch events"
Sentry Discover queries for impact analysis:
# Count total events and unique affected users in last 24 hourscurl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/events/" \ --data-urlencode "field=count()" \ --data-urlencode "field=count_unique(user)" \ --data-urlencode "query=issue.id:$ISSUE_ID" \ --data-urlencode "statsPeriod=24h" \ -G | python3 -c "import json, sysdata = json.load(sys.stdin)if 'data' in data and data['data']: row = data['data'][0] print(f'Events (24h): {row.get(\"count()\", \"N/A\")}') print(f'Unique users (24h): {row.get(\"count_unique(user)\", \"N/A\")}')" || echo "ERROR: Discover query failed"# Check p95 transaction duration for affected endpointcurl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/events/" \ --data-urlencode "field=transaction" \ --data-urlencode "field=p95(transaction.duration)" \ --data-urlencode "field=count()" \ --data-urlencode "query=has:transaction event.type:transaction" \ --data-urlencode "statsPeriod=1h" \ --data-urlencode "sort=-count()" \ --data-urlencode "per_page=5" \ -G | python3 -c "import json, sysdata = json.load(sys.stdin)if 'data' in data: for row in data['data']: txn = row.get('transaction', 'unknown') p95 = row.get('p95(transaction.duration)', 0) cnt = row.get('count()', 0) print(f'{txn}: p95={p95:.0f}ms, count={cnt}')" || echo "ERROR: Transaction query failed"
Step 3 — Resolve, Communicate, and Document
Identify the root cause pattern:
| Pattern | Diagnostic Signal | Immediate Action |
|---|---|---|
| Deployment regression | "First Seen" aligns with latest deploy timestamp | Rollback via sentry-cli releases deploys $PREV_VERSION new --env production |
| Third-party failure | Breadcrumbs show failed HTTP calls to external hosts | Enable circuit breaker, add retry logic, monitor dependency status |
| Data corruption | Event context contains malformed input samples | Add input validation, fix data pipeline upstream |
| Resource exhaustion | Error rate correlates with traffic spikes (OOM, pool exhaustion) | Scale horizontally, add connection pooling, implement rate limiting |
| SDK misconfiguration | Events missing context, breadcrumbs, or release info | Review Sentry.init() options, verify source maps uploaded |
Resolve the issue via Sentry API:
# Mark issue as resolved (closes the issue)curl -s -X PUT \ -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "resolved"}' \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/issues/$ISSUE_ID/" \ | python3 -c "import json,sys; d=json.load(sys.stdin); print(f'Status: {d.get(\"status\",\"unknown\")}')" \ || echo "ERROR: Failed to resolve issue"# Resolve in next release (auto-reopens on regression)curl -s -X PUT \ -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "resolved", "statusDetails": {"inNextRelease": true}}' \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/issues/$ISSUE_ID/" \ | python3 -c "import json,sys; d=json.load(sys.stdin); print(f'Status: {d.get(\"status\",\"unknown\")} (regression detection enabled)')" \ || echo "ERROR: Failed to resolve issue"# Ignore with threshold (snooze until count exceeds limit)# Use 100 as the re-alert threshold for noisy low-severity issuescurl -s -X PUT \ -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "ignored", "statusDetails": {"ignoreCount": 100}}' \ "https://sentry.io/api/0/organizations/$SENTRY_ORG/issues/$ISSUE_ID/" \ | python3 -c "import json,sys; d=json.load(sys.stdin); print(f'Status: {d.get(\"status\",\"unknown\")} (snoozed until 100 events)')" \ || echo "ERROR: Failed to ignore issue"
Stakeholder communication templates:
Initial alert (send within 15 minutes of P0):
INCIDENT — [Service Name]Status: InvestigatingImpact: [Description of user-facing symptoms]Started: [Timestamp from Sentry "First Seen"]Sentry Issue: [Link to issue]Incident Lead: @[on-call engineer]Next update: 30 minutesResolution notice:
RESOLVED — [Service Name]Duration: [Total incident time from first alert to resolution]Root Cause: [One-line description from investigation]Fix Applied: [What changed — rollback, hotfix, config change]Postmortem: [Link — due within 48 hours]Postmortem template with Sentry data:
## Incident Postmortem: [Title from Sentry Issue]### Timeline- [HH:MM] Alert fired — Sentry issue [ISSUE_ID] created- [HH:MM] On-call engineer acknowledged- [HH:MM] Root cause identified via [breadcrumbs / stack trace / suspect commits]- [HH:MM] Fix deployed — [rollback / hotfix description]- [HH:MM] Error rate returned to baseline, issue resolved in Sentry### Impact (from Sentry Discover)- **Duration:** [X hours Y minutes]- **Total events:** [count() from Discover query]- **Unique users affected:** [count_unique(user) from Discover query]- **p95 latency during incident:** [p95(transaction.duration) from Discover]### Root Cause (5 Whys)1. Why did the error occur? [Direct cause from stack trace]2. Why was that code path triggered? [From breadcrumbs]3. Why was it not caught in testing? [Gap analysis]4. Why did the alert take [X] minutes? [Alert rule review]5. Why is this class of error possible? [Systemic cause]### Action Items- [ ] [Preventive measure] — Owner: @[name] — Due: [date]- [ ] Update Sentry alert rules to catch [pattern] earlier- [ ] Add regression test covering [scenario from breadcrumbs]- [ ] Review and tighten ownership rules for [component]
Output
- Severity classification (P0-P3) based on error frequency and user impact
- Completed triage checklist with root cause identification
- Sentry Discover query results quantifying incident impact
- API-driven issue resolution with regression detection enabled
- Stakeholder communication messages (initial alert + resolution)
- Postmortem document populated with Sentry data exports
Error Handling
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized from Sentry API | Auth token expired or lacks org-level scope | Regenerate token at Settings > Developer Settings > Internal Integrations with event:read, issue:write scopes |
| Alert fatigue — too many P2/P3 alerts | Alert rules trigger on every event instead of thresholds | Change alert condition to "New issue" or "Event frequency > N in M minutes" |
| Suspect Commits shows wrong commit | Release association not configured | Run sentry-cli releases set-commits --auto in CI pipeline |
| Missing breadcrumbs in events | SDK not capturing HTTP/console/navigation breadcrumbs | Verify Sentry.init({ integrations: [breadcrumbsIntegration()] }) and check maxBreadcrumbs setting |
| Issue keeps regressing after resolve | Root cause not fully addressed, only symptom fixed | Use "Resolve in next release" for auto-reopen, add regression test |
| Discover query returns empty data | Wrong time range or missing event.type filter | Expand statsPeriod to 7d, verify query syntax in Sentry Discover UI first |
Examples
Example 1 — P0 payment failure spike:
An alert fires: PaymentProcessingError with 200 events in 5 minutes. Triage reveals crash-free rate dropped to 91%. Breadcrumbs show the Stripe webhook handler receiving malformed payloads after a Stripe API version change. Suspect Commits points to a dependency update merged 20 minutes ago. Resolution: rollback the deployment, resolve the Sentry issue with inNextRelease, file a postmortem with the 5 Whys showing the missing Stripe API version pin.
Example 2 — P2 intermittent 503 from upstream API:
Sentry shows ServiceUnavailableError affecting 40 users/hour. Discover query reveals count() = 180, count_unique(user) = 40, p95(transaction.duration) = 8200ms. Breadcrumbs show the third-party geocoding API returning 503. Resolution: enable the circuit breaker fallback to cached results, ignore the Sentry issue with ignoreCount: 100, create a backlog item to add a secondary geocoding provider.
Example 3 — P1 new unhandled exception after deploy:
A TypeError: Cannot read properties of undefined appears immediately after a release tagged v2.4.1. First Seen matches the deploy timestamp. Stack trace points to a renamed API response field. Suspect Commits identifies the exact PR. Resolution: deploy hotfix renaming the field access, resolve the issue tied to v2.4.2, update the postmortem with Discover data showing 320 affected users over 45 minutes.
Resources
- Sentry Issue Details — anatomy of an issue page
- Sentry Alerts — configuring alert rules and thresholds
- Sentry Discover Queries — building impact analysis queries
- Issues API — programmatic issue management
- Ownership Rules — auto-assigning issues to teams
@sentry/nodeSDK — Node.js SDK configuration
Next Steps
For configuring Sentry alerts and error capture, see sentry-error-capture. For CI/CD integration with Sentry releases, see sentry-ci-integration. For performance monitoring and tracing, see sentry-performance-tracing.
sentry-incident-runbook 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/sentry-pack/skills/sentry-incident-runbook/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
복사





집
