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

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

2023 年現在の New Relic の新ロゴ

概要

What does the integration offer?

Opsgenie has native integration with New Relic workflows. Use the integration to send New Relic issues to Opsgenie’s API with detailed information. Opsgenie acts as a dispatcher for New Relic issues, determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls, and iPhone & Android push notifications, and escalates alerts until the alert is acknowledged or closed.

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

How does the integration work?

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

  • When an alert is closed in New Relic Workflows, the related alert automatically closes in Opsgenie through the integration.

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

Set up the integration

New Relic is an API-based integration. Setting it up involves the following steps:

  • Add aNew Relic integration in Opsgenie

  • Configure the integration in New Relic

Add a New Relic integration

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

  1. [チーム] に移動して自分のチームを選択します。

  2. 左側のナビゲーションで [統合] を選択し、[統合を追加] を選択します。

統合をチーム ダッシュボードから追加すると、そのチーム統合の所有者になります。Opsgenie では、この統合を通じて受信したアラートはそのチームのみに割り当てられます。このセクションの残りの手順に従って、統合を設定してください。

To add a New Relic integration in Opsgenie:

  1. Go to Settings > Integrations.

  2. Select Add integration.

  3. Run a search and select “New Relic”.

  4. 次の画面で、統合の名前を入力します。

  5. オプション: 特定のチームが統合からのアラートを受信するようにする場合は、[Assignee team (担当者チーム)] のチームを選択します。

  6. [続行] を選択します。
    この時点で、統合が保存されます。

  7. Expand the Steps to configure the integration section and copy the endpoint URL.
    You will use this URL while configuring the integration in New Relic later.

  8. [統合をオンにする] を選択します。
    統合のために作成したルールは、統合をオンにした場合にのみ機能します。

Configure the integration in New Relic

  1. Select Alert & AI from the side menu from your New Relic account.

  2. Select Destinations.

  3. Create a Webhook destination.

  4. Enter a name for the Webhook.

  5. Paste the URL you copied while adding the integration in Opsgenie into Endpoint URL.

  6. Select Workflows from Alerts & AI and create a new workflow.
    Use the webhook destination you created earlier.

  7. Test the New Relicpayload in the Payload template for webhook.
    For the New Relic payload template, see the following article.

  8. Select Update message.

  9. Select Activate workflow.
    Verify if the workflow is enabled in New Relic.

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

Payload template to use while creating a Workflow in 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}} } }

Sample JSON payload sent from New Relic

(in JSON format)

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 } }

Payload parsed by Opsgenie

(in JSON format)

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" ]

その他のヘルプ