What is Azure VM Insights?
Microsoft recently announced general availability of Azure VM Insights, aka Azure Monitor for VM. This service is basically a set of features that allow you to monitor your VMs in more detail, from collecting the telemetry from your VM to displaying it meaningfully – all with a single click. I am satisfied with Azure VM Insights for the most part, but I also have some mixed feelings about it. Read on to find out why.
Alternatively, click here to learn how to visualize VM Insights data in SquaredUp.
What does it do?
To start with, enabling VM Insights does the following:
- It deploys the Log Analytics agent to your VM.
- It installs the Dependency agent on your VM.
- It installs some workbooks to visualize this data.
How is it enabled?
Enabling the VM Insights solution is pretty straightforward. For a single VM, simply locate the option in the menu and turn it on.
After enabling the solution, let it sit for a while to give the LA agent time to collect some data. It will soon start showing in the graphs:
This performance data comes from Logs, and you can verify this if you view the actual configuration by clicking on edit:
Since it’s a workbook, it can be presented in a more sophisticated way, as compared to just Logs. This is as you can add different data types to a workbook such as plain text, metrics, parameter drop downs, etc. Read more about workbooks here.
This part of the VM Insights Solution comes from the Log Analytics agent since it’s the one collecting logs.
Now onto the second part, Service Map. In the same Insights blade, you also see a map:
This map comes from the Dependency agent which runs on your VM and streams the data back to the workspace by leveraging the Log Analytics agent.
This was for a single VM. You can also enable it on scale from the Azure Monitor portal:
You can also enable it programmatically by PowerShell or ARM templates. Read more about enabling Azure Monitor for VMs here.
After enabling the Solution, it’ll add a few tables to your Log Analytics workspace. Now here lies my complaint – there is also a “Perf” table that is created when you connect your VM to a workspace, and a new table called “InsightsMetrics” is now generated, and the purpose of both these tables is the same – to store performance counters. However, what counters are stored in which table differs on where you’re collecting them from. For example, the performance collected from non-Azure machines goes into the Perf table, while performance counters from Azure machines go into the InsightsMetrics table – somewhat inconvenient but alright, I can live with that. The tricky part comes next.
InsightsMetrics only stores the “standard” performance counters required for VM Insights solution. So, if you collect counters other than that, it goes into Perf. Confused? Let me show you what I mean.
I turned on VM Insights for my VM, and I’ve got performance data into the InsightsMetrics table as expected:
And I have nothing in the Perf table:
Now, I started collecting a metric that is not part of the “standard” VM Insights metrics.
This metric is now stored in the Perf table, not InsightsMetrics.
Notice the issue with this yet?
- This causes the performance counters to split into two different tables, so you have to make sure you choose the right table, being mindful of the counter you’re choosing.
- You can easily end up collecting specific performance counters in both the tables, essentially duplication of data ingestion.
- You will have to re-write the queries you’ve already written using the Perf table to change to the InsightsMetrics
- This has made some sample queries from the query explorer inaccurate, because they’re still scoped to Perf For example, there’s a query called “What data is being collected”, in the samples, which I’m guessing is one of the most widely used ones.
If I run that now, I get this:
Which is obviously not true, because I am also collecting a bunch of other metrics, but in a different table. Personally, I’d like all my performance counters in one place.
Microsoft has briefly addressed these two tables in documentation here (note the text in purple boxes).
How does this matter in SquaredUp?
If you rely on SquaredUp for Azure for your data visualization needs, no need to worry – we’ve got you covered. You can view your VM Insights performance data in SquaredUp as well.
As mentioned before, VM Insights data is essentially stored and queried from Logs. SquaredUp has a native Logs tile that can query into the Logs and display it pretty easily. Here’s our KB article about the Logs tile and how it works.
After all is done, you can make a nice, clean dashboard like this:
Or, you can also choose to scope a Perspective on a per-VM basis:
Cool, that’s all for this one. If you'd like to learn more about Azure Monitor, visit our 9-part journey through Azure Monitor from zero to hero here.
Till next time!