Hi ,
To set up an alert for when the Service Bus is unavailable using a KQL (Kusto Query Language) query, you'll typically use data from Azure Monitor logs.
- Identify relevant log sources: Determine which log sources contain data related to Service Bus availability. This might include logs from Azure Activity Log, Azure Monitor logs (such as diagnostic logs), or custom logs if you're logging specific events related to Service Bus availability.
- Write a KQL query: Craft a KQL query that checks for signs of Service Bus unavailability. This could involve checking for errors or lack of expected activity.
- Define the condition: Set up a condition in the alert rule that triggers when the KQL query results meet certain criteria, indicating Service Bus unavailability.
- Set up the alert rule: Create an alert rule in Azure Monitor that uses your KQL query and condition to trigger alerts.
Example KQL Query
AzureDiagnostics
| where TimeGenerated > ago(30m) | where ResourceProvider =="MICROSOFT.SERVICEBUS" | where Category == "Error" | summarize count() by EventName_s, _ResourceId Please check this link for https://learn.microsoft.com/en-us/azure/service-bus-messaging/monitor-service-bus?tabs=AzureDiagnostics
Accept answer if helps, Thanks!