Forum Discussion
Ho w to correctly measure Bytes Received/sec &&&&& Bytes Sent/sec
I would like to correctly measure through log analytic and then in Grafana network traffic generated for one or more VMs.
For test VMs I have enable Data collection rule and enabled collecting data every 60s for network Interface "Bytes Received/sec" and "Bytes Sent/sec". Inside metric is also enabled.
Query that I use in log analytic is :
Perf
| where TimeGenerated between (datetime(2024-03-19) .. datetime(2024-03-20))
| where Computer == "***********"
| where ObjectName == "Network Interface" and CounterName == "Bytes Received/sec" and InstanceName == "Microsoft Hyper-V Network Adapter _2"
| summarize BytsSent = sum(CounterValue)/1073741824 by bin(TimeGenerated, 24h),CounterName
InsightsMetrics
| where TimeGenerated between (datetime(2024-03-19) .. datetime(2024-03-20))
| where Origin == "vm.azm.ms"
| where Namespace == "Network" and Name == "ReadBytesPerSecond"
| where Computer == "******"
| extend NetworkInterface=tostring(todynamic(Tags)["vm.azm.ms/networkDeviceId"])
| summarize AggregatedValue = sum(Val) by bin(TimeGenerated, 1d), Computer, _ResourceId, NetworkInterface
Results for Perf is 0,32339 GB/day and for InsightsMetrics is 14.7931 GB/day. If I go to network interface and select metric data for network interface is data that I get return from query in log analytic for Metric same/correct .
I have now shorten sample period of data collection rule to 15s, I hope that this will ,give more accurate results.
I’m I doing something wrong or I collect data the wrong way. I don’t want to activate inside metric for every VM, I want to activate any data that I’m interesting.