0

I am using a dashboard variable name $project which can be project_A, project_B or All(or *) in Grafana.

Now, I want to write a query like

sum by (uri,status,method)(
 rate(http_server_requests_seconds_sum{team="myTeam",uri!="/actuator/prometheus",uri!="/actuator/health",project="$project"}[10m])  / 
 rate(http_server_requests_seconds_count{team="myTeam",uri!="/actuator/prometheus",uri!="/actuator/health",project="$project"}[10m]) 
)

This is giving me no output when I am setting $project=All. I am assuming this is because it cannot resolve the variable $project in both the functions because for a specific $project value it is successfully giving me output.

Am I guessing correct? What is the workaround of it?

Thanks in advance!

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
Blur Machine
  • 63
  • 1
  • 3

1 Answers1

0

Change:

project="$project"

To:

project=~"$project"