If you haven't configured Insights on you Virtual Machine Scale Set in Azure, and you access the Insights pane from the Azure Portal you'll get informed with the following:
"With an Azure virtual machine scale set you get host CPU, disk and up/down state of your VMSS out of the box."
This seems to be true when you click on the Metrics pane of the Virtual Machine Scale Set, inside of the Azure Portal, because inside there you can show various platform metrics (such as CPU Percentage etc.) out of the box and work with that data.
So far so good.
If I then access the Azure Monitor resource inside of the Azure Subscription, and set the scope to the resource group that this Virtual Machine Scale Set resides within, and then e.g. use the built in query Virtual Machine Scale Sets - Chart CPU usage trends by computer (see picture):
It generates the following KQL query:
// Chart CPU usage trends by computer
// Calculate CPU usage patterns over the last hour, chart by percentiles.
InsightsMetrics
| where TimeGenerated > ago(1h)
| where Origin == "vm.azm.ms"
| where Namespace == "Processor"
| where Name == "UtilizationPercentage"
| summarize avg(Val) by bin(TimeGenerated, 5m), Computer //split up by computer
| render timechart
If I run that query, it doesn't show any metric data from any Virtual Machine Scale Set (or any of their Virtual Machine instances) inside of that scope. It does however display metric data from all of the Virtual Machines that are or has been (within the time limit of course) deployed inside of that resource group scope. Why is this query located under Virtual Machine Scale Sets, if it retrieves data for Virtual Machines but not for Virtual Machine Scale Sets/VM Instances of those? Why isn't it located under Virtual Machine below, instead? I've tried to alter it to get metric data from my Virtual Machine Scale Sets, but I can't seem to find any inside of the Monitor Logs.
Do they, with the "With an Azure virtual machine scale set you get host CPU, disk and up/down state of your VMSS out of the box." statement mean that this data is only populated to Monitor - Metrics and not to Monitor - Logs? Isn't there any out of the box platform metrics collected in Monitor - Logs for Virtual Machine Scale Sets, just as there are for Virtual Machines? If there isn't, what needs to be done to enable that? If there is, any example query to retrieve those metrics would be appreciated!
Thanks!
I've done some more research in regards of this, and think that I can provide somewhat elaborated answers to my own questions.
Do they, with the "With an Azure virtual machine scale set you get host CPU, disk and up/down state of your VMSS out of the box." statement mean that this data is only populated to Monitor - Metrics and not to Monitor - Logs?
Yes, out of the box it's only populated to Azure Monitor - Metrics. More specifically it's being populated and stored in the Azure Monitor metrics database.
Isn't there any out of the box platform metrics collected in Monitor - Logs for Virtual Machine Scale Sets, just as there are for Virtual Machines?
There are out of the box collected platform metrics for Virtual Machine Scale Sets, which as stated above are populated and stored in the Azure Monitor metrics database. To be able to access these platform metrics from Azure Monitor - Logs, one would need to set up and configure the diagnostic settings of the Virtual Machine Scale Set, to populate a Log Analytics workspace with the platform metrics data.
After the above diagnostic settings has been configured accordingly, one could access these platform metrics inside of Azure Monitor - Logs by querying the AzureMetrics table.
For platform metrics, no additional agents needs to be configured on the Virtual Machine Scale Set, since the platform metrics are being collected from the Azure platform itself, and not from Virtual Machine hosts and their underlying operating system.
If one however need to complete the metrics with guest operating system metrics, then one would need to configure additional agents collecting the desired data. But that is out of scope of the original asked questions in this post.
Source of the above statements: Create diagnostic settings to send platform logs and metrics to different destinations
Out of the box provided platform metrics for Virtual Machine Scale Sets: Microsoft.Compute/virtualMachineScaleSets
Out of the box provided platform metrics for Virtual Machine instances of Virtual Machine Scale Sets: Microsoft.Compute/virtualMachineScaleSets/virtualMachines