Microsoft Azure Event Hubs Integration

Microsoft Azure Event Hubs is a fully managed, real-time data ingestion service that’s simple, trusted and scalable. Stream millions of events per second from any source to build dynamic data pipelines and immediately respond to business challenges. Keep processing data during emergencies using the geo-disaster recovery and geo-replication features.

For an alert rule on a metric value, when the value of a specified metric crosses a threshold assigned, the alert rule becomes active and sends a notification. For an alert rule on events, a rule can send a notification on every event, or, only when a certain number of events happen.

​What does Opsgenie offer Azure Event Hubs users?

Azure Event Hubs can generates alerts based on metrics. Opsgenie acts as a dispatcher for the alerts generated by Azure. Opsgenie determines the right people to notify based on on-call schedules and escalations and notifies via using email, text messages (SMS), phone calls, and Android & iOS push notifications.

📘

Opsgenie Supports the new Azure metric alerts as well:

With the Azure new metric alerts, new fields are added in the new Azure payload. Hence, you can accordingly configure the Opsgenie integration to support them.
For more info visit: https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-near-real-time-metric-alerts#payload-schema

Functionality of the integration

When an alert is created in Azure Event Hubs, an alert is created in Opsgenie automatically through the integration.

Add Azure Event Hubs integration in Opsgenie

  1. Please create an Opsgenie account if you haven't done so already.
  2. Go to Opsgenie's Azure Event Hubs Integration page.

🚧

For Free and Essentials plans, you can only add the integrations from the Team Dashboards, please use the alternative instructions given below to add this integration.

  1. Specify who is notified of Microsft Azure alerts using the Teams field. Auto-complete suggestions are provided as you type.

📘

An alternative for Step 2) and Step 3) is to add the integration from the Team Dashboard of the team which will own the integration. To add an integration directly to a team, navigate to the Team Dashboard and open Integrations tab. Click Add Integration and select the integration that you would like to add.

  1. Copy the integration URL.
  2. Click Save Integration.

Configuration in Azure

Note: Azure webhook alerts are only available via the Azure Preview Portal. If using the classic version, please use the Email integration.

  1. Log in to Azure portal.
  2. Search for Event hub in portal search and go to your event hubs, and select your event hubs namespace for which you want to add alert
  1. Select the Alerts section under Monitoring
  1. Select Manage Actions tab and click to Add action group, you can choose to edit an existing action group
  1. Create a new action by adding Action Type as Webhook and click Edit Details to configure
  1. Add the webhook url copied from Opsgenie integration settings to URI field. (Here you may choose to enable common alert schema)
  1. Choose Manage alert rules from Alerts section under Monitoring and choose to create or edit an alert rule
  1. Choose the condition on which you want to create alert by clicking on Select condition and select the metric
  1. Add desired Threshold value , Aggregation type and Aggregation period and save. You may choose to add multiple conditions on different metrics.

Sample payload sent from Azure Metric Alert

Create Alert payload:

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

Sample payload sent from Azure Common Alert Schema

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

Sample alert

Updated 3 months ago


Microsoft Azure Event Hubs Integration


Microsoft Azure Event Hubs is a fully managed, real-time data ingestion service that’s simple, trusted and scalable. Stream millions of events per second from any source to build dynamic data pipelines and immediately respond to business challenges. Keep processing data during emergencies using the geo-disaster recovery and geo-replication features.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.