一键导入
alerting-context
Pull incident context from alerting platforms (PagerDuty). Use when investigating who's on-call, incident history, alert patterns, or MTTR metrics.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Pull incident context from alerting platforms (PagerDuty). Use when investigating who's on-call, incident history, alert patterns, or MTTR metrics.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Opsgenie alert management and on-call scheduling. Use for listing alerts, checking on-call, computing MTTA/MTTR, and alert fatigue analysis. Supports team and priority filtering.
Amplitude product analytics. Use when querying user events, funnels, retention, or product usage data. Provides event segmentation, user activity lookup, and annotation queries.
Google BigQuery data warehouse queries and schema inspection. Use when running SQL queries, listing datasets/tables, or inspecting table schemas in BigQuery.
MySQL/MariaDB database inspection and queries. Use when investigating table schemas, running queries, checking processlist, replication status, InnoDB engine status, or lock contention.
PostgreSQL database inspection and queries. Use when investigating table schemas, running queries, checking locks, replication status, or long-running queries.
Snowflake data warehouse queries and schema inspection. Use when running SQL queries against Snowflake, listing tables, or inspecting schemas.
| name | alerting-context |
| description | Pull incident context from alerting platforms (PagerDuty). Use when investigating who's on-call, incident history, alert patterns, or MTTR metrics. |
| allowed-tools | Bash(python *) |
IMPORTANT: Credentials are injected automatically by a proxy layer. Do NOT check for PAGERDUTY_API_KEY in environment variables - it won't be visible to you. Just run the scripts directly; authentication is handled transparently.
Before diving into logs and metrics, understand:
All scripts are in .claude/skills/alerting-context/scripts/
python .claude/skills/alerting-context/scripts/get_incident.py --id INCIDENT_ID [--timeline]
# Examples:
python .claude/skills/alerting-context/scripts/get_incident.py --id P123ABC
python .claude/skills/alerting-context/scripts/get_incident.py --id P123ABC --timeline
python .claude/skills/alerting-context/scripts/list_incidents.py [--status STATUS] [--days N] [--limit N]
# Examples:
python .claude/skills/alerting-context/scripts/list_incidents.py
python .claude/skills/alerting-context/scripts/list_incidents.py --status triggered
python .claude/skills/alerting-context/scripts/list_incidents.py --status acknowledged --limit 10
python .claude/skills/alerting-context/scripts/list_incidents.py --days 30
python .claude/skills/alerting-context/scripts/calculate_mttr.py [--service SERVICE_ID] [--days N]
# Examples:
python .claude/skills/alerting-context/scripts/calculate_mttr.py
python .claude/skills/alerting-context/scripts/calculate_mttr.py --days 30
python .claude/skills/alerting-context/scripts/calculate_mttr.py --service PSERVICE123 --days 90
# Get details of the current incident
python get_incident.py --id P123ABC --timeline
Returns:
# Get incidents from the last 30 days
python list_incidents.py --days 30 --status resolved
# Check for patterns in a specific service
python list_incidents.py --service PSERVICE123 --days 90
Look for:
# Get MTTR for this service
python calculate_mttr.py --service PSERVICE123 --days 30
Returns:
| Goal | Command |
|---|---|
| Get incident | get_incident.py --id P123ABC |
| With timeline | get_incident.py --id P123ABC --timeline |
| Active incidents | list_incidents.py --status triggered |
| Acknowledged | list_incidents.py --status acknowledged |
| Last 30 days | list_incidents.py --days 30 |
| Calculate MTTR | calculate_mttr.py --service X --days 30 |
# Search for similar alerts in last 30 days
python list_incidents.py --days 30
# Check the output for recurring alert titles
# Look for same service, similar patterns
# Get full incident details with timeline
python get_incident.py --id P123ABC --timeline
# Check 'assignments' and 'acknowledgements' in output
# Timeline shows escalation events
# Get MTTR for incident comparison
python calculate_mttr.py --service PSERVICE123 --days 30
# Compare current incident duration to historical average
# If current > p95, this is an unusually long incident
## Alerting Context Summary
### Current Incident
- **ID**: [incident_id]
- **Title**: [title]
- **Status**: [triggered/acknowledged/resolved]
- **Service**: [service_name]
- **Urgency**: [high/low]
- **Created**: [timestamp]
- **Duration**: [how long since created]
### On-Call
- **Primary**: [name] ([email])
- **Secondary**: [name] ([email])
- **Escalation Policy**: [policy_name]
### Historical Context
- **Similar incidents (30d)**: N incidents with same/similar title
- **Average MTTR for this service**: X minutes
- **This alert fires**: Z times/week on average
### Recommendations
- [If recurring] Review runbook for this alert
- [If long duration] Consider escalating
- [If noisy] Consider tuning alert threshold