Populate 4th variable/dropdown with values from custom variables/dropdowns (2nd or 3rd) based on choice in 1st variable/dropdown

Using Grafana v7.4.3
Datasource: Prometheus

1st variable: Type=Custom, Name=Tier, Values=Tier1 : $Tier1_svc, Tier2 : $Tier2_svc
2nd variable: Type=Custom, Name=Tier1_svc, Values=app1,app2,app3,app4,app5
3rd variable: Type=Custom, Name=Tier2_svc, Values=app6,app7,app8,app9,app10
4th variable: Type=Query, Name=Service, Datasource=Prometheus, Query=label_values(up{replatform_instance_name=~"$Tier"},replatform_instance_name)

1st dropdown (Tier) correctly shows values Tier1, Tier2
2nd dropdown (Tier1_svc) correctly shows values app1, app2, app3, app4 and app5
3rd dropdown (Tier2_svc) correctly shows values app6, app7, app8, app9 and app10
4th dropdown (Service) shows “None”

The expectation is that the 4th dropdown (Service) would show the list of either the 2nd or 3rd variable, based on the selection of 1st dropdown (Tier). When Tier1 is selected, the Service dropdown/variable would display values app1, app2, app3, app4 and app5. When Tier2 is selected, the Service dropdown/variable would display values app6, app7, app8, app9 and app10.

Ultimately, the selected list would be used for graphs on the dashboard… for example: win_aspnet_app_Requests_persec{replatform_instance_name=~"$Service"}.

I have reviewed all Grafana documentation and the community forum regarding variables and found nothing that is relevant to my question.

Hi @mitchell044 and welcome to the forum :wave:

I think, in general, you will need to explore using chained variables, which are very flexible and powerful:

This topic was automatically closed after 365 days. New replies are no longer allowed.