Advanced variables depends on variable


I try to use a variable that depends on other variable

So I have my first variable
projectName = label_values(sonarqube_bugs, name)
branchName = label_values({name="$projectName"}, branch)

When I select a projectName, branchName is working
If i select more than one projectName or “All” branchName is not working

So I tried to configure
projectName custom all value = .+
branchName = label_values({name=~"$projectName"}, branch)
But it gives me all branches of all projects for each project.
Is there a way to do that ? Or is there a way to configure a default branchName value if (and only if) projectName is All ?

Also, if I select multiple value, branchName is not working, prometheus does not seems to support “in” operator, if there anyway to do that ?

Best regards,

1 Like

@poil I’ve requirement to collect Sonarqube metrics to Grafana. Could you please advise how you have implemented this setup.

I used this :
I’m no more in the company where I need this, perhaps the original repository is more uptodate.