-2

In Grafana make template:

Name - Instance
Query - label_values(instance) 
for recive all instance.
And have reqest example:
sum(machine_cpu_cores) by (instance)

If sum(machine_cpu_cores) by (instance=~"$Instance") I have error. How do it right? Thanks.

1 Answers1

0

Most likely that you've misplaced the =~ operator.

The correct query should look like this:

sum(machine_cpu_cores{instance=~"$Instance"}) by (instance)
Yoory N.
  • 4,881
  • 4
  • 23
  • 28