Cloudability Set up Azure Memory Metrics Collection (using Azure Monitor)
- Platform metrics:
- Key Metrics: CPU Percentage, Disk Reads/Writes, Network Throughput
- Enabled after you have set up Azure Rightsizing and RI Planning.
- Guest OS metrics:
- Key Metrics: Memory Utilization
- Requires a Guest OS agent and diagnostic data sync
- Enabled after completing the steps below
Although Guest OS metrics are not required for Rightsizing Recommendations, they are strongly encouraged. Our analysis has shown that by understanding memory usage, Cloudability can make even better informed and sized recommendations, typically resulting in 10-20% additional cost savings.
- Enable Azure Monitor
Enable monitoring in Azure.
- Enable managed identity
Enable Azure resources to authenticate to cloud services without storing credentials in code.
- Enable diagnostics
Enable Azure to access diagnostics. There are separate instructions for Windows and Linux.
- In the Azure portal search, type virtual machines .
- Under Services , select Virtual machines .
- In the Virtual machines page, select the desired virtual machine.
- In the left navigation panel, under Monitoring , select Diagnostic settings .
- In the Overview tab, from the Diagnostics storage account drop-down, select or create a diagnostics storage account.
- Select Enable guest-level monitoring . Note:
If the Enable guest-level monitoring option is disabled, you must enable managed identity for this resource.
- Select Save .
Enable managed identity
A system-assigned managed identity enables Azure resources to authenticate to cloud services without storing credentials in code. For more information, see What are managed identities for Azure resources?
- In the Azure portal search, type virtual machines .
- Under Services , select Virtual machines .
- In the Virtual machines page, select the virtual machine you want.
- In the left navigation panel, select Identity .
- Under Status , select On .
- Select Save .
- In the Azure portal search, type virtual machines .
- Under Services , select Virtual machines .
- In the Virtual machines page, select the virtual machine you want.
- In the left navigation panel, select Diagnostic settings .
- In the Sinks tab, under Send diagnostic data to Azure Monitor , select
Enabled .
- Select Save .
If the Send diagnostic data to Azure Monitor option is disabled, you must enable managed identity for this resource.
Install Diagnostics Agent (Linux Only)
- Remotely log into the virtual machine via SSH.
- Download the Telegraf package.
wget https://dl.influxdata.com/telegraf/releases/telegraf_1.13.4-1_amd64.deb
- Install the package.
- Ubuntu and Debian
sudo dpkg --install --force-confnew telegraf_1.13.4-1_amd64.deb
- RedHat and CentOS
sudo yum localinstall -y telegraf-1.13.4-1.x86_64.rpm
- Ubuntu and Debian
- Generate the new Telegraf configuration file in the current directory.
telegraf --input-filter cpu:mem --output-filter azure_monitor config > azm-telegraf.conf
- Replace the example configuration with the new generated configuration.
sudo cp azm-telegraf.conf /etc/telegraf/telegraf.conf
- Stop the Telegraf agent on the VM.
sudo systemctl stop telegraf
- Start the telegraf agent on the VM to ensure it picks up the latest configuration.
sudo systemctl start telegraf
Troubleshooting
Linked to Log Analytics Workspace
- In the Azure portal search, type log analytics workspaces .
- Under Name , select the desired Log Analytics Workspace
- In the left navigation panel, under the Workspace Data Source section, select Virtual Machines .
- View the grid to verify each resource is associated with a Log Analytics Workspace.
Required Metrics Namespace
- In the Azure portal search, type virtual machines .
- Under Monitoring , select Metrics .
- In the Metrics panel, select the Metric Namespace drop-down.
- For Windows resources, you should see three metrics:
- Virtual Machine Host
- Guest (classic)
- Virtual Machine Guest - source of memory metrics
- For Linux resources, you should see four metrics:
- Virtual Machine Host
- Guest (classic)
- telegraf/mem - source of memory metrics
-
- telegraf/cpu
- telegraf/cpu
- For Windows resources, you should see three metrics: