Can't get my query right

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?
    I would like to see the average load of all hosts in a VMware cluster.

  • How are you trying to achieve it?
    Current query:
    SELECT last(“usage_average”) FROM “vsphere_host_cpu” WHERE (“vcenter” =~ /^$vcenter$/ AND “clustername” =~ /^$clustername$/) AND $timeFilter GROUP BY time($inter) fill(none)

  • What happened?
    It shows the average load of the FIRST host per cluster.

  • What did you expect to happen?
    Show the average of across all hosts in the cluster.

I see that my query is wrong because it should somewhere group per host and then average that “usage_average” of those hosts, to give me the “usage_average” for the cluster. But I just can’t figure out how to do it.

Hi @thegabeman! I think you need to add the names of the relevant host tag(s) to the GROUP BY clause. E.g.

GROUP BY vcenter, clustername, time($inter)
1 Like