Variable 2:
name: app_name
Values: (I want to achieve this scenario). But not sure how to achieve it in Grafana.
if(env_name == “Development”)
return “app_dev”
else if(env_name == “Test”)
return “app_tst”
else if(env_name == “Production”)
return “app_prd”
I tried doing this, but could not acheive it. As I do not know how to return the value out?
How will you be using variable2 in your query? What is you query data source type? If you are not using the first variable in your dashboard make it simpler by using 1 variable with key values
Development : app_dev,Test : app_tst,Production : app_prd
Actually Variable 1 it self connects to Humio datasource and gets the environment names.
Here is the query:
“#app_name” = select([“#app_environment”])
Which returns me environment values “Development”, “Test”, “Production”
Which I use for Humio widgets.
I also have a widget which checks if the application is up and I have that information through Mimir metric. This query will give me the status of the app.
up{app=“application_name”}
As you can see I want this query to run something like this
up{app=$app_name}
I do this because, the system is already setup like this. All log messages goto Humio datasource and metrics goto Mimir.