• 製品
  • 使用を開始する
  • 関連ドキュメント
  • リソース

Opsgenie を New Relic ワークフローと統合する

2023 年現在の New Relic の新ロゴ

Opsgenie が New Relic ユーザーに提供するもの

Opsgenie には、New Relic ワークフローとのネイティブ統合があります。統合を使用して、New Relic 課題を Opsgenie の API に詳細情報とともに送信します。Opsgenie は New Relic 課題のディスパッチャーとして機能し、オンコール スケジュールに基づいて通知する適切な担当者を決定します。メール、テキスト メッセージ (SMS)、電話、iPhone、Android のプッシュ通知によって通知し、アラートが確認されるかクローズされるまでアラートをエスカレートします。

このドキュメントでは、OpsgenieNew Relic から受信するデータの統合と詳細を設定する方法について説明します。

統合の機能性

  • New Relic ワークフローでアラートが作成されると、統合によって Opsgenie でもアラートが自動で作成されます。

  • New Relic ワークフローでアラートがクローズされると、関連するアラートも統合によって Opsgenie で自動的にクローズされます。

  • New Relic ワークフローでアラートが承認されると、関連するアラートも統合によって Opsgenie で自動的に承認されます。

Opsgenie の設定

この統合はチーム ダッシュボードから追加可能

Opsgenie の Free または Essentials の各プランを使用している、または Jira Service Management の Standard プランで Opsgenie を使用している場合、このプランでは [設定] の [統合] ページが利用できないため、この統合はチーム ダッシュボードからのみ追加できます。

統合をチーム ダッシュボードから追加すると、そのチーム統合の所有者になります。Opsgenie では、この統合を通じて受信したアラートはそのチームのみに割り当てられます。

そのためには、次の手順に従います。

  1. Teams からチーム ダッシュボードに移動します。

  2. [統合] > [統合を追加] の順に選択します。

残りの手順に従って統合を完了します。

  1. [設定] > [統合] の順に移動します。New Relic を検索して [追加] を選択します。 

  2. New Relic の通知対象となるユーザーを "応答者" フィールドに追加します。

  3. エンドポイント URL をコピーします。

  4. [Save Integration (統合の保存)] を選択します。

New Relic の設定

  1. New Relic のサイド メニューから [アラート & AI] を選択します。

  2. [Destinations (宛先)] に移動して、オプションから [Webhook] を選んで新しい宛先を追加します。

  3. [Webhook 名] に名前を入力します。

  4. 生成した URL を "エンドポイント URL" フィールドに入力します。この URL は、Opsgenie の "New Relic 統合" ページにあります。

  5. [Save destination (宛先を保存)] を選択します。

  6. [アラート & AI] から [ワークフロー] を選択します。次に [ワークフローを追加] を選択します。

  7. 必要に応じてデータをフィルタリングして、[通知] から [Webhook] を選択します。

  8. Webhook と上記で作成した宛先を選択します。

  9. New Relic ペイロード テンプレート (このドキュメントの次のステップで提供されます) をコピーします。次に、それをペイロード テンプレートに貼り付けます。

  10. [テスト通知を送信] を選択して、正常に送信されていることを確認します。次に [メッセージを更新] を選択します。

  11. "ワークフロー" ページに戻ります。[ワークフローを有効化する] を選択します。

  12. New Relic でワークフローが有効になっていることをご確認ください。

New Relic ペイロード テンプレート

New Relic で新しいワークフローを作成するときは、このペイロード テンプレートをご利用ください。

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 { "tags": "tag1,tag2", "teams": "team1,team2", "recipients": "user1,user2", "payload": { "condition_id": {{json accumulations.conditionFamilyId.[0]}}, "condition_name": {{json accumulations.conditionName.[0] }}, "current_state": {{#if issueClosedAtUtc}} "closed" {{else if issueAcknowledgedAt}} "acknowledged" {{else}} "open"{{/if}}, "details": {{json issueTitle}}, "event_type": "Incident", "incident_acknowledge_url": {{json issueAckUrl }}, "incident_api_url": "N/A", "incident_id": {{json issueId }}, "incident_url": {{json issuePageUrl }}, "owner": "N/A", "policy_name": {{ json accumulations.policyName.[0] }}, "policy_url": {{json issuePageUrl }}, "runbook_url": {{ json accumulations.runbookUrl.[0] }}, "severity": {{#eq "HIGH" priority}} "WARNING" {{else}}{{json priority}} {{/eq}}, "targets": { "id": {{ json entitiesData.entities.[0].id }}, "name": {{ json entitiesData.entities.[0].name }}, "type": "{{entitiesData.entities.[0].type }}", "product": "{{accumulations.conditionProduct.[0]}}" }, "timestamp": {{#if closedAt}} {{ closedAt }} {{else if acknowledgedAt}} {{ acknowledgedAt }} {{else}} {{ createdAt }} {{/if}} } }

 

New Relic から Opsgenie に送信される JSON ペイロードの例

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 { "tags": "tag1,tag2", "teams": "team1,team2", "recipients": "user1,user2", "payload": { "condition_id": 1, "condition_name": "test condition", "current_state": "open", "details": "CPU > 50% for 5 minutes", "event_type": "INCIDENT", "incident_acknowledge_url": "http://localhost/incident/1/acknowledge", "incident_api_url": "http://localhost/api/incident/1", "incident_id": 1, "incident_url": "http://localhost/incident/1", "owner": "John Doe", "policy_name": "test policy", "policy_url": "http://localhost/policy/1", "runbook_url": "http://localhost/runbook/url", "severity": "CRITICAL", "targets": [ { "id": "12345", "link": "http://localhost/target/12345", "name": "Test Target", "labels": [ "production", "hostname" ], "type": "Server", "product" : "productName" } ], "timestamp": 123456789000 } }

このペイロードは Opsgenie によって次のように解析されます。

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [ "owner" : "John Doe", "severity" : "CRITICAL", "policy_url" : "http://localhost/policy/1", "teams" : [ "team1", "team2" ], "target_name" : "Test Target", "target_type" : "Server", "policy_name" : "test policy", "incident_url" : "http://localhost/incident/1", "incident_acknowledge_url" : "http://localhost/incident/1/acknowledge", "tags" : [ "tag1", "tag2" ], "event_type" : "INCIDENT", "incident_id" : "1", "target_link" : "http://localhost/target/12345", "runbook_url" : "http://localhost/runbook/url", "recipients" : [ "user1", "user2" ], "target_labels" : [ "production", "hostname" ], "details" : "CPU > 50% for 5 minutes", "state" : "open", "condition_name" : "test condition", "target_product" : "productName", "timestamp" : "123456789000" ]

その他のヘルプ