mcpField
O
oncall-irm

oncall-irm

github.com/grafanaクラウド・DevOps2954.3k 回インストール1 日前に更新
リポジトリ

oncall-irm について

Grafana OnCall と IRM のアラートルーティング、エスカレーションチェーン、スケジュールを設定・検証するスキルです。Grafana Cloud でインシデント対応を管理するチーム向けに、連携設定と一連の動作確認手順をまとめています。

主な機能

  1. 01アラート連携とルーティング設定
  2. 02エスカレーションチェーンの設計とテスト
  3. 03iCalからのスケジュール作成
  4. 04通知と解決に関するガイダンス

活用シーン

  1. 01AlertmanagerのアラートをIRMに接続
  2. 02運用開始前にルールをテスト
  3. 03エスカレーションチェーンの構築と検証
  4. 04iCalからオンコール予定を作成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/grafana/skills --skill oncall-irm

インストール後、Claude Code で/oncall-irmを入力して読み込まれたか確認します。

同梱ファイルreferences/integrations.mdreferences/templates-schedules.md

詳細

Grafana OnCall と IRM

OnCall のドキュメント: https://grafana.com/docs/oncall/latest/ IRM のドキュメント: https://grafana.com/docs/grafana-cloud/alerting-and-irm/

Grafana OnCall OSS はメンテナンスモードです(2026 年 3 月にアーカイブ)。Cloud ユーザーは IRM をご利用ください。コンセプト(チェーン、スケジュール、インテグレーション)は同じです。

前提条件

  • IRM/OnCall が有効になっている Grafana Cloud スタック
  • API トークン(Authorization: <token>)
  • OnCall アプリをインストールするための Slack ワークスペースと管理者(ChatOps 用)

基本コンセプト

コンセプト説明
インテグレーションアラートを受け付ける Webhook URL。ソースごとに 1 つ
ルートエスカレーションチェーンにマッピングする Jinja2 条件(最初に True となった条件を使用)
エスカレーションチェーン待機/スケジュールへの通知/チームへの通知/Webhook/自動解決の各ステップ
スケジュールカレンダーベースのローテーション(Web/iCal/Terraform)
アラートグループグルーピング ID テンプレートでまとめられた関連アラート
通知ポリシーユーザーごとの通知チャネル — Slack、モバイルプッシュ、SMS、電話、メール

フロー:アラート → インテグレーション → ルーティングテンプレート → エスカレーションチェーン → 通知 → 確認/解決。

よくあるワークフロー

1. Alertmanager を IRM に接続し、ルーティングを確認する
# 1. In IRM: New integration → Alertmanager. Copy the webhook URL.
# 2. alertmanager.yml (see references/integrations.md for full block):
receivers:
  - name: grafana-oncall
    webhook_configs:
      - url: https://<stack>.grafana.net/integrations/v1/alertmanager/<id>/
        send_resolved: true
        max_alerts: 100
# 3. Test the routing template BEFORE going live (UI: Integration → Route → "Preview")
#    Paste a sample payload (use a real Alertmanager test webhook). Expect:
#      Routing result: True
#      Escalation chain selected: <expected chain>
#    If False — your Jinja expression is wrong; fix and re-preview.

# 4. End-to-end test — fire amtool (or any test webhook) at the URL
amtool alert add foo severity=critical team=platform --alertmanager.url http://localhost:9093

# 5. Verify in IRM → Alert Groups (should appear within ~5s) — confirm:
#    - Correct route fired
#    - Correct schedule/user notified
#    - Slack message appeared in the configured channel

ルーティングテンプレートの構文と Jinja ヘルパー:references/templates-schedules.md。 その他のインテグレーション(Grafana Alerting、汎用 Webhook、Slack):references/integrations.md。

2. エスカレーションチェーンを作成して確認する
1. Notify "Primary On-Call" (Important Notifications)
2. Wait 5 min
3. Notify "Primary On-Call" (Default Notifications)
4. Wait 10 min
5. Notify team "Platform"
6. Trigger outgoing webhook (PagerDuty / ticket)
# Verify: create a test alert (UI → Integration → "Send demo alert"),
# then watch the alert-group timeline tick through steps 1 → 6.
# Use IRM → Escalation Chains → "Test" if available, otherwise the demo alert is the canonical check.
3. iCal からスケジュールを作成し、「現在オンコール中の担当者」を確認する
# 1. Create the schedule
curl -X POST https://<stack>.grafana.net/api/v1/schedules/ \
  -H "Authorization: <token>" -H "Content-Type: application/json" \
  -d '{"name":"Platform On-Call",
       "ical_url_primary":"https://calendar.example.com/platform.ics",
       "slack":{"channel_id":"C123456ABC","user_group_id":"S123456ABC"}}'

# 2. Verify the schedule was created
curl -s https://<stack>.grafana.net/api/v1/schedules/ \
  -H "Authorization: <token>" | jq '.results[] | select(.name=="Platform On-Call")'

# 3. Verify who is on-call right now
curl -s https://<stack>.grafana.net/api/v1/schedules/<schedule_id>/next_shifts/ \
  -H "Authorization: <token>" | jq '.results[0]'
# Expect a shift starting now (or recently) with the right user_id.

Terraform を使った方法とシフトブロックについては、references/templates-schedules.mdをご覧ください。

ベストプラクティス

  • チェーンは 4 レベル以内にし、最後のステップを明確に定義します(PagerDuty への Webhook または自動解決)。
  • Alertmanager で常に send_resolved: true を設定し、OnCall が自動解決するようにします。
  • Alertmanager の Webhook 設定では max_alerts: 100 を使用します。
  • 配信の信頼性を高めるため、Slack とモバイルプッシュを組み合わせます。
  • RBAC のためにインテグレーション/スケジュールをチームに割り当てます。

リソース

コメント