SOLVED

Azure Alerts metrics in LogAnalytics

Copper Contributor

Hi there,

 

Is it possible to get metrics for the Azure Alerts available to query LogAnalytics.  i.e. for example I'd like to show on an Azure Dashboard, along side the other resource metrics know how many active Sev 1 alerts etc for a specific time period.

 

I have looked in LogAnalytics (query) and I see the Alert table however it's empty - I do have some active and closed Alerts.

 

Am I looking in the right place, or is that this data is not available?

 

Thanks

Bryan

2 Replies
best response confirmed by Stanislav Zhelyazkov (MVP)
Solution

Hi,

Azure Alerts data is not in Log Analytics. It is located in API:

https://docs.microsoft.com/en-us/rest/api/monitor/alertsmanagement/alerts/getall

Microsoft does not provide any dashboards for alerts unfortunately. Might be best to request this feature in Azure Monitor user voice.

@bryan_wilson 

 

Hey Bryan, the Workbooks blade in Azure Monitor can do something that's at least very, very close to what your asking.

Go to 'Monitor' -> 'Workbooks' blades, then click 'New':

1.png

 

Click 'Add Query':

2.png

 

Then click the tiny '(change)' option next to where it says 'Query: None.....'

3.png

 

Then we get to the good stuff:

4.png

 

Make the following changes to the option to get you something close to what you want:

Data Source = Alerts (preview)

Resource Type = Subscriptions

Subscriptions = <select the subscriptions you want to cover>
Time Range = <define the desired time range for your query>

Results = Alerts

Severity/Condition/Alert State = <define as per your needs>

Visualisation = Grid

This new workbook can then be saved, and the step pinned to a Dashboard.

You'll probably want to tweak a bit to get it to suit your requirements, but I think this should get you close?

1 best response

Accepted Solutions
best response confirmed by Stanislav Zhelyazkov (MVP)
Solution

Hi,

Azure Alerts data is not in Log Analytics. It is located in API:

https://docs.microsoft.com/en-us/rest/api/monitor/alertsmanagement/alerts/getall

Microsoft does not provide any dashboards for alerts unfortunately. Might be best to request this feature in Azure Monitor user voice.

View solution in original post