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

Opsgenie を Microsoft Azure Event Hubs と統合する

Azure Event Hubs のロゴ

メトリック値に関するアラート ルールの場合、指定されたメトリックの値が割り当てられたしきい値を超えると、アラート ルールがアクティブになり、通知が送信されます。イベントに関するアラート ルールの場合、ルールはすべてのイベントについて、または特定の数のイベントが発生した場合にのみ、通知を送信できます。

​Opsgenie が Azure Event Hubs ユーザーに提供するもの

Azure Event Hubs は、メトリックに基づいてアラートを生成できます。OpsgenieAzure によって生成されたアラートのディスパッチャーとして機能します。Opsgenie は、電子メール、テキスト メッセージ (SMS)、電話、Android および iOS のプッシュ通知を使用して、オンコール スケジュールとエスカレーションに基づいて通知する適切なユーザーを決定します。

Opsgenie は、新しい Azure メトリックス アラートもサポートします。

Azure の新しいメトリック アラートでは、新しい Azure ペイロードに新しいフィールドが追加されます。したがって、Opsgenie 統合をサポートするように設定できます。
詳細については、https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-near-real-time-metric-alerts#payload-schema をご覧ください。

統合の機能性

Azure Event Hubs でアラートが作成されると、統合によって Opsgenie でアラートが自動で作成されます。

Opsgenie で Azure Event Hubs 統合を追加する

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

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

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

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

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

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

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

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

  2. [応答者] フィールドによって Microsoft Azure アラートの通知先を指定します。入力し始めると、オートコンプリートの候補が表示されます。

  3. 統合 URL をコピーします。

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

Azure での設定

注: Azure Webhook アラートは、Azure Preview Portal でのみ使用できます。クラシック バージョンを使用している場合は、電子メール統合を使用してください。

  1. Azure ポータルにログインします。

  2. ポータル検索で Event Hub を検索し、Event Hub に移動し、アラートを追加する Event Hub の名前スペースを選択します。

Microsoft Azure Event Hubs ポータル検索

3. [監視] で [アラート] セクションを選択します。

Microsoft Azure Event Hubs モニター

4. [アクションの管理] タブを選択し、[アクション グループの追加] をクリックすると、既存のアクショング ループを編集できます。

Microsoft Azure Event Hubs アクションの管理

5. アクション タイプWebhook を追加して新しいアクションを作成し、詳細の編集をクリックして設定します。

Microsoft Azure Event Hubs アクション タイプ

6. Opsgenie 統合の設定からコピーした Webhook URL を URL フィールドに追加します。(ここでは、共通のアラート スキーマを有効にすることを選択できます)。

Microsoft Azure Event Hubs Webhook

7. 監視の [アラート] セクションから [アラート ルールの管理] を選択し、アラート ルールの作成または編集を選択します。

Microsoft Azure Event Hubs ルール

8. [条件の選択] をクリックして、作成したいアラートの条件を選択し、メトリックを選択します。

Microsoft Azure Event Hubs がシグナル ロジックを設定する

9. 必要なしきい値、アグレゲーション タイプ、アグレゲーション 期間を追加して保存します。異なるメトリックに複数の条件を追加することもできます。

Microsoft Azure Event Hubs 条件の設定

Azure メトリック アラートから送信されたペイロードのサンプル

アラートのペイロードを作成します。

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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 { "schemaId": "AzureMonitorMetricAlert", "data": { "version": "2.0", "properties": null, "status": "Activated", "context": { "timestamp": "2020-06-24T10:28:19.3462700Z", "id": "/subscriptions/25b83e19-ab0d-4579-ad81-asdas-sadasda/resourceGroups/test_eventhub_group/providers/microsoft.insights/metricalerts/test-eventhub-alerts", "name": "test-eventhub-alerts", "description": "test description for alert", "conditionType": "SingleResourceMultipleMetricCriteria", "severity": "3", "condition": { "windowSize": "PT1M", "allOf": [{ "metricName": "SuccessfulRequests", "metricNamespace": "Microsoft.EventHub/namespaces", "operator": "GreaterThan", "threshold": "2", "timeAggregation": "Total", "dimensions": [{ "name": "ResourceId", "value": "25b83e19-ab0d-4579-ad81-d0280e506bb3:test-eventhub-og" }, { "name": "EntityName", "value": "test-eventhub" }, { "name": "OperationResult", "value": "Success" }], "metricValue": 8.0, "webTestName": null }, { "metricName": "IncomingRequests", "metricNamespace": "Microsoft.EventHub/namespaces", "operator": "GreaterThan", "threshold": "3", "timeAggregation": "Total", "dimensions": [{ "name": "ResourceId", "value": "25b83e19-ab0d-4579-ad81-d0280e506bb3:test-eventhub-og" }, { "name": "EntityName", "value": "test-eventhub" }], "metricValue": 8.0, "webTestName": null }] }, "subscriptionId": "25b83e19-ab0d-4579-ad81-d0280e506bb3", "resourceGroupName": "test_eventhub_group", "resourceName": "test-eventhub-og", "resourceType": "Microsoft.EventHub/namespaces", "resourceId": "/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/resourceGroups/test_eventhub_group/providers/Microsoft.EventHub/namespaces/test-eventhub-og", "portalLink": "https://portal.azure.com/#resource/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/resourceGroups/test_eventhub_group/providers/Microsoft.EventHub/namespaces/test-eventhub-og" } } }

Azure 共通アラート スキーマから送信されたペイロードのサンプル

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 36 37 38 39 40 41 42 43 44 45 46 47 { "schemaId": "azureMonitorCommonAlertSchema", "data": { "essentials": { "alertId": "/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/providers/Microsoft.AlertsManagement/alerts/7ccad036-8973-49e9-b628-a18350fb32bb", "alertRule": "test-eventhub-alerts", "severity": "Sev3", "signalType": "Metric", "monitorCondition": "Fired", "monitoringService": "Platform", "alertTargetIDs": ["/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/resourcegroups/test_eventhub_group/providers/microsoft.eventhub/namespaces/test-eventhub-og"], "originAlertId": "25b83e19-ab0d-4579-ad81-d0280e506bb3_test_eventhub_group_microsoft.insights_metricalerts_test-eventhub-alerts_-121967519", "firedDateTime": "2020-06-29T18:41:05.7016722Z", "description": "", "essentialsVersion": "1.0", "alertContextVersion": "1.0" }, "alertContext": { "properties": null, "conditionType": "SingleResourceMultipleMetricCriteria", "condition": { "windowSize": "PT1M", "allOf": [{ "metricName": "SuccessfulRequests", "metricNamespace": "Microsoft.EventHub/namespaces", "operator": "GreaterThan", "threshold": "2", "timeAggregation": "Total", "dimensions": [{ "name": "ResourceId", "value": "25b83e19-ab0d-4579-ad81-d0280e506bb3:test-eventhub-og" }, { "name": "EntityName", "value": "test-eventhub" }, { "name": "OperationResult", "value": "Success" }], "metricValue": 4.0, "webTestName": null }], "windowStartTime": "2020-06-29T18:38:52.06Z", "windowEndTime": "2020-06-29T18:39:52.06Z" } } } }

アラートの例

Microsoft Azure Event Hubs アラートの例

 

その他のヘルプ