Aug 16 2021
- last edited on
Apr 08 2022
I'm using Grafana with Azure Monitor as datasource to monitor our AKS cluster. I've installed a Grafana dashboard which shows Node CPU usage for the past 12 hours, which is great, but it would be more useful to me if it showed me the last 7 days. This is very easy to adjust in Grafana, but when I change timespan to 7 days, the graph is pretty opaque, since it's trying to plot some 23.000 entries (see attached image).
To make it more comprehensible, I would like to aggregate the entires together in for instance timespans of 3 hours. I know theres a function to do just that in the query language:
I've tried so hard to make it work in my query, but I just can't make it work. Next step is to really dive into the query language, but it's time I would like to really spare.
So can anyone help me make this query aggregate the data with 3 hours intervals?
Perf | where ObjectName == "K8SNode" | where CounterName == "cpuCapacityNanoCores" | where $__timeFilter(TimeGenerated) | where InstanceName contains '$AKS' | summarize arg_max(TimeGenerated, *) by Computer | project Computer, CpuTotal=(CounterValue) | join kind=inner ( Perf | where ObjectName == "K8SNode" | where CounterName == "cpuUsageNanoCores" | where $__timeFilter(TimeGenerated) | where InstanceName contains '$AKS' | project TimeGenerated, Computer, CpuUsed=(CounterValue) ) on Computer | order by TimeGenerated asc | project TimeGenerated, Computer, CpuPercentageUsad=(CpuUsed / CpuTotal) * 100
Thanks in advance
Aug 26 2021 11:51 AM