VM Insights, also known as Azure Monitor for VMs, allows you to collect additional metrics called guest level metrics from your virtual machines (VMs).
To allow the additional metrics to be collected you must first enable Insights for each VM you wish to monitor. These metrics can then be shown in SquaredUp using the Azure Monitor Logs tile.
This article covers:
- Enabling Insights for a VM
- KQL queries
- Walkthrough: Querying Insights data in SquaredUp using the Azure Monitor Logs tile
- Walkthrough: Adding Insights data to a perspective
Enabling Insights for a VM
Enabling Insights does the following:
- Deploys the Log Analytics agent onto your VM
- Installs the Dependency agent on your VM
- Configures workbooks in Azure to visualise this data
The steps below allow you to enable Insights for an individual VM. You can enable Insights for multiple VMs at once as described by Microsoft here.
When you enable Insights you will be billed based on the amount of data ingested and your data retention settings.
- Log in to the Azure Portal and browse to the VM for which you want to enable Insights. Under Monitoring on the menu click Insights.
- Click the Enable button to enable Insights for that VM. It will take a minute to deploy, after which you can you can navigate to Insights and view the Performance data or the Dependency Map pre-populated by a Workbook.
After Insights is enabled leave it a short while to collect some data, which will then show on the graphs in the workbooks.
KQL Queries
You can use KQL to add any query to your dashboard. For more information about the KQL query language see Microsoft's Azure Monitor Log Queries.
You might like to look at the workbooks on the Performance tab in the Azure portal for query ideas. (The Dependency Map shown in the Azure portal cannot currently be shown in SquaredUp).
- In to the Azure Portal and browse to the VM you are interested in.
- Under Monitoring on the menu click Insights.
- Click on Performance, rather than Map.
- Click View Workbooks > Performance.
- Click Edit at the top of the screen, then the Edit button below the graph you are interested in, to view the query and metrics used.
Walkthrough: Querying Insights data in SquaredUp using the Azure Monitor Logs tile
Once enabled the additional metrics are stored in the InsightsMetrics table in your Log Analytics workspace.
This walkthrough will help you to add an Insights KQL query to a SquaredUp dashboard to show the average Processor \ Utilization Percentage metric.
- Log into SquaredUp and create a new dashboard.
- Click on the Logs tile.
- Select Logs (Line Graph)
- Leave the scope blank.
- Leave the timeframe as it is for now. You can choose to define the timeframe inside the KQL query itself.
- Select the workspace that your VM is connected to.
- Paste in the following query:
For more information about the KQL query language see Microsoft's Azure Monitor Log Queries.InsightsMetrics | where Namespace == "Processor" | where Name == "UtilizationPercentage" | summarize avg(Val) by Computer, bin(TimeGenerated, 5m)
- After clicking next you should see a graph displayed.
- Leave the data range and display sections as they are.
- In the label section tick show legend.
- Click done.
Walkthrough: Adding Insights data to a perspective
This walkthrough will help you to add an Insights KQL query to a SquaredUp perspective to show the memory available.
- Log in to SquaredUp and browse to the VM you are interested in.
- Create a new perspective or browse to the perspective you want to add a tile to.
- Click on the Logs tile.
- Select Logs (Line Graph)
- In the scope section click on this resource.
- Leave the timeframe as it is for now. You can choose to define the timeframe inside the KQL query itself.
- Select the workspace that your VM is connected to.
- Paste in the following query:
InsightsMetrics
It is the
| where Computer startswith "{{scope[0].name}}"
| where Namespace == "Memory"
| where Name == "AvailableMB"
| summarize avg(Val) by Computer, bin(TimeGenerated, 5m){{scope[0].name}}
section that pulls in the VM that is the focus of the perspective.
- After clicking next you should see a graph displayed.
- Leave the data range and display sections as they are.
- Click done.