简体   繁体   English

Azure 监控日志 - 虚拟机规模集指标

[英]Azure Monitor Logs - Virtual Machine Scale Set Metrics

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:如果您尚未在 Azure 中为您的虚拟机规模集配置Insights ,并且您从 Azure Portal 访问Insights窗格,您将收到以下通知:

"With an Azure virtual machine scale set you get host CPU, disk and up/down state of your VMSS out of the box." “使用 Azure 虚拟机规模集,您可以获得开箱即用的 VMSS 主机 CPU、磁盘和上/下 state。”

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.当您单击 Azure 门户内部的虚拟机规模集的指标窗格时,这似乎是正确的,因为在其中您可以开箱即用地显示各种平台指标(例如CPU 百分比等)并使用它数据。

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 eg use the built in query Virtual Machine Scale Sets - Chart CPU usage trends by computer (see picture):如果我然后访问 Azure 订阅内的Azure Monitor资源,并将 scope 设置为资源组,然后按查询虚拟机规模集的趋势使用此虚拟机规模集的资源组,例如,该虚拟机规模集的使用趋势和图表驻留在其中, (见图):

在此处输入图像描述

It generates the following KQL query:它生成以下 KQL 查询:

// 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.如果我运行该查询,它不会显示来自该 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.但是,它确实显示了来自该资源组 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?为什么此查询位于虚拟机规模集下,如果它检索虚拟机的数据但不检索这些虚拟机规模集/VM 实例的数据? 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 .我试图改变它以从我的虚拟机规模集中获取指标数据,但我似乎无法在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."他们是否做到了,通过“使用 Azure 虚拟机规模集,您可以获得开箱即用的 VMSS 的主机 CPU、磁盘和上/下 state。” statement mean that this data is only populated to Monitor - Metrics and not to Monitor - Logs ?声明意味着此数据仅填充到Monitor-Metrics而不是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? Monitor - Logs for Virtual Machine Scale Sets 中是否收集了任何现成的平台指标,就像虚拟机一样? 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."他们是否做到了,通过“使用 Azure 虚拟机规模集,您可以获得开箱即用的 VMSS 的主机 CPU、磁盘和上/下 state。” statement mean that this data is only populated to Monitor - Metrics and not to Monitor - Logs?声明意味着此数据仅填充到 Monitor - Metrics 而不是 Monitor - Logs?

Yes, out of the box it's only populated to Azure Monitor - Metrics .是的,开箱即用它只填充到Azure Monitor - Metrics More specifically it's being populated and stored in the Azure Monitor metrics database .更具体地说,它被填充并存储在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? Monitor - Logs for Virtual Machine Scale Sets 中是否收集了任何现成的平台指标,就像虚拟机一样?

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 .虚拟机规模集有现成的收集平台指标,如上所述,这些指标已填充并存储在Azure 监控指标数据库中。 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.为了能够从Azure Monitor - Logs访问这些平台指标,需要设置和配置虚拟机规模集诊断设置,以使用平台指标数据填充Log Analytics 工作区

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.相应地配置上述诊断设置后,可以通过查询AzureMetrics表来访问Azure 监视器 - 日志中的这些平台指标

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.对于平台指标,不需要在虚拟机规模集上配置其他代理,因为平台指标是从 Azure 平台本身收集的,而不是从虚拟机主机及其底层操作系统收集的。

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.但这超出了这篇文章中原始问题的 scope。

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为虚拟机规模集提供开箱即用的平台指标Microsoft.Compute/virtualMachineScaleSets

Out of the box provided platform metrics for Virtual Machine instances of Virtual Machine Scale Sets : Microsoft.Compute/virtualMachineScaleSets/virtualMachines虚拟机规模集虚拟机实例提供开箱即用的平台指标Microsoft.Compute/virtualMachineScaleSets/virtualMachines

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM