11

I have a few VMs set up as ADO (VSTS) build servers and thought I'd look into CPU and RAM usage over time to optimize the VM size. However I have had a hard time finding anything in Azure that allows me to investigate memory usage in VMs. The VMs do have the IaaS WAD extension installed and I can view things like CPU usage in Monitor but there doesn't seem to be any Monitor metric related to memory. Do I really need to move to a third party like Datadog to get such basic information presented in a graph?

Metric selection in Azure Monitor

6

They have removed the "host metric" memory from VM's. You have to use the new Insight option to expose the memory usage.

https://azure.microsoft.com/en-us/blog/rich-insights-for-virtual-machines-from-azure-monitor/

Go to your VM -> Monitoring -> Insight and onboard it to Insight if needed. After it is onboarded and has started collecting data(20-30 min) you can choose the performance tab: enter image description here

1
  • "Go to your VM -> Monitoring -> Insight" -- thank you, but for me, this is a paid option that states: "Get more visibility... You will be billed based on the amount of data ingested and your data retention settings". I'm not an Azure admin - just an application dev concerned about RAM usage. It's a shame Microsoft charge for such basic functionality. They say never blame malice when you can blame incompetence, but exactly why would MS they think memory isn't an important metric? Maybe it's M$ after all.
    – Happyblue
    May 11 '21 at 14:20
1

At the time of writing (July 2019), the issue the OP is seeing is actually quite simple. If you have diagnostics enabled, that Metrics screen should actually show you the performance counters, including memory-related ones. Just go to the left where it says "Metric namespace" and choose "Guest (classic)" to see those metrics, reading out of the storage account. At the end of August, however, you will no longer be able to set new alerts on those classic guest OS metrics, and it will be phased out by July 2020.

Here are your options for getting and alerting on memory and other guest OS metrics on a Windows VM (there are other links nearby for Linux VMs for 1 and 2, while 3 and 4 should be basically the same).

  1. Continue using Windows Diagnostics Extension with metrics viewing and classic alerts working from storage 1 and 2
    • Can’t create new alerts this way after Aug 31
    • Will be shut down in June 2020
  2. Send guest OS metrics as custom metrics to Monitor store, then set normal metric alerts 3
    • Currently only available in select regions
  3. Use Log Analytics VM Extension/Agent to pump metrics to a workspace – configure log query alerts or log metric alerts
    • Tutorial to enable 4
    • Log queries 5
    • Metric alerts on logs (for perf counters, Agent Health etc.) 6
  4. Use Azure Monitor for VMs/Insights – automatically tracks and provides a graph for Logical Disk Space Used % and other metrics. 7
    • “health alerts” are available somewhere (docs currently under revision)

Summary: 1 is the easiest to do right now but will eventually be replaced by 2. 3 and 4 are using the same technology and offer detailed capabilities, but 3 is the "do-it-yourself" version that lets you just collect data and you have to define your own queries and alerts. 4 offers many pre-set graphs and alerts for a variety of metrics.

0

You dont need WAD extension to view those metrics. those metrics are gathered from the virtualization host (you get them for free for every vm).

To view WAD metrics you need to parse the table storage where they are stored or ingest them to some sort of monitoring solution (like OMS). they are not exposed on the portal.

-1

You can create custom query on dashboard to monitor RAM on VMs:

Perf
| where CounterName == "% Committed Bytes In Use"
| where CounterValue > 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.