Forum Discussion
Kusto Query to Show VM NIC Bandwidths?
A very basic traditional metric for VMs outside of Azure is the bandwidth, in bits per second, of all the VM's NICs. I'm trying to replicate this in Azure (we have an NVA where we need to know which NICs have what kind of bandwidth utilization.)
The metrics the diagnostic settings for the NIC write into a log analytics workspace are of this type (a bunch of other columns too but these are relevant here)
TimeGenerated | Resource | MetricName | Average | TimeGrain |
<timestamp> | NVA NIC1 | BytesSentRate | 123 | PT1M |
<timestamp> | NVA NIC1 | BytesReceivedRate | 123 | PT1M |
<timestamp> | NVA NIC2 | BytesSentRate | 123 | PT1M |
<timestamp> | NVA NIC2 | BytesReceivedRate | 123 | PT1M |
I'm trying to wrap my head around a Kusto query which would allow me to create a single time series of all four of those metrics. Currently the best I've found is to use "let" to create four data sets, filter each for the resource and specific metric name, project it from the generic metric names (like "BytesSentRate" ) to "nic1BytesSent" and "nic2BytesReceived", then join all four, and then summarize it into a time series that can be rendered.
This seems like an absurdly complicated and resource-intensive way of doing it, and one that's a pain to integrate into workbooks and the like. Is there a better way to get a graph of the network traffic in bps from a NIC to put in a log analytics workbook or Azure dashboard?
The metric documentation: https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-network-networkinterfaces-metrics