3 Environment Dashboard Variables => 2 DataSource Variables?

We have 3 environments in our setup staging / sandbox / prod and they use 2 different prometheus data sources dev / prod. Staging and Sandbox lives in the dev prometheus, and prod lives in prod.

I am looking for a way to set the datasource as a variable based on the selection of the environment, such that:

  • selection of staging changes datasource variable to dev
  • selection of sandbox changes datasource variable to dev
  • selection of prod changes datasource variable to prod

I know I can do this with 2 different dashboard variable dropdowns, but Ideally I would like to hide the datasource variable and change them with a single environment selection. Is this possible?

Hi @coneybeare,

Did you find any solution for your problem ?
I am facing the similar challenge with Azure monitor data source.

create Custom variable. spacing is critical here for kv pair (k: seen in UI, v: used in queries etc)

staging : dev,  sandbox : dev, prod : prod