Hi Gladson Oliver,
Thanks for reaching out to Microsoft Q&A.
To enable Virtual Machine Guest metrics for your Azure VMs and ensure you can monitor and alert based on these metrics, here’s a structured approach:
- Verify Diagnostic Settings and Data Collection Rules
- Diagnostic Settings: Ensure that the diagnostic settings are configured correctly to send guest metrics. However, since the traditional (classic) guest metrics do not support alerting and are somewhat limited, you'll want to use a modern setup.
- Data Collection Rules (DCR): If you're using Azure Monitor, setting up DCRs can be an effective way to gather guest OS metrics. Ensure that the DCR is targeting the correct VMs and that it includes the necessary performance counters (like CPU, memory, disk, etc.).
- Enable Azure Monitor Agent (AMA) for Guest Metrics (Preferred)
- The Azure Monitor Agent (AMA) is the recommended method for collecting guest OS metrics instead of relying on the legacy guest metrics (classic). AMA is actively developed and supports newer metric namespaces and better integration with Log Analytics.
- To set this up:
- Install the AMA on your VMs.
- Use the DCR to collect guest metrics by selecting Metrics Namespace: Virtual Machine Guest in the Azure Monitor Metrics.
- AMA also supports Azure Monitor alerts, which should meet your requirements for alerting in a production environment.
- Use the DCR to collect guest metrics by selecting Metrics Namespace: Virtual Machine Guest in the Azure Monitor Metrics.
- Install the AMA on your VMs.
- Avoid Sinks in Production
- As you noted, using Sinks under diagnostic settings is in preview and not ideal for production environments. While it enables some guest metrics, the AMA and DCR approach provide a more stable, supported method.
- Creating Alerts
- Once the guest metrics are flowing into Azure Monitor (via AMA and DCR), you can set up alerts based on these metrics. Go to Azure Monitor > Alerts and create new alert rules based on the guest metrics available in the Virtual Machine Guest namespace.
Useful Links and Documentation
- Tutorial on Monitoring Azure VMs with Guest OS metrics
- Set up DCRs for Virtual Machine Guest Metrics
- Configure Azure Monitor Alerts
By using AMA along with DCR, you should be able to reliably capture guest OS metrics and set up alerting, suitable for a production setup.
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.