Metric Alerts on Logs

Brass Contributor

Trying to solve this witchcraft that is Metric Alerts on Logs :unamused:

 

So going via the portal, is it possible to monitor a Resource Group i.e. the % Memory usage of all VMs within a Resource Group ? I presume it is done via one of the Dimension options but it's not very obvious.

 

 

2 Replies

@JK_UK As far as I get it, only a few things can be done via metrics, like CPU and disk performance metrics. Those are the things you can deduct from the Hyper-V host that the VM is running on. Anything that is not properly visible is done through log collection. So you have to create a Log Analytics query. The query we use is as follows (this gets memory for both linux and windows vms):

 

Perf | where ObjectName == "Memory" and CounterName == "% Committed Bytes In Use" or CounterName == "% Used Memory"  | summarize AggregatedValue = avg(CounterValue) by Computer, bin(TimeGenerated, 5m)

 

@-Akos- Thanks for the reply. Like you, we also use queries for our alerts currently, I thought I'd try and look at metric alerts on logs as they're supposedly quicker, they look a nightmare to setup though from a templating point of view and I think I'm right in saying that they only work with Performance Counter metrics, we're just in the process of moving to Insights and turning off the Performance Counters we collect so it wouldn't have worked anyway.