Skip to main content
added 99 characters in body
Source Link
Will1v
  • 196
  • 2
  • 14

Is there a way to define a toggle variable that holds sets of variables?

eg a region switch that would have:

  • 'Europe': {ip: 'europe_ip', port: 'europe_port', service_name: 'europe_service_name'}
  • 'America': {ip: 'america_ip', port: 'america_host', service_name: 'america_service_name'}
  • 'Asia': {ip: 'asia_ip', port: 'asia_host', service_name: 'asia_service_name'}

where you'd have a dropdown for region with Europe, America, Asia at the top of the dashboard and then refer to these variable as $region.ip, $region.service_name etc

I can't figure out how to do it, even using Custom variables

EDIT: I need to be able to define these variables manually. Not pull them from some data source

Is there a way to define a toggle variable that holds sets of variables?

eg a region switch that would have:

  • 'Europe': {ip: 'europe_ip', port: 'europe_port', service_name: 'europe_service_name'}
  • 'America': {ip: 'america_ip', port: 'america_host', service_name: 'america_service_name'}
  • 'Asia': {ip: 'asia_ip', port: 'asia_host', service_name: 'asia_service_name'}

where you'd have a dropdown for region with Europe, America, Asia at the top of the dashboard and then refer to these variable as $region.ip, $region.service_name etc

I can't figure out how to do it, even using Custom variables

Is there a way to define a toggle variable that holds sets of variables?

eg a region switch that would have:

  • 'Europe': {ip: 'europe_ip', port: 'europe_port', service_name: 'europe_service_name'}
  • 'America': {ip: 'america_ip', port: 'america_host', service_name: 'america_service_name'}
  • 'Asia': {ip: 'asia_ip', port: 'asia_host', service_name: 'asia_service_name'}

where you'd have a dropdown for region with Europe, America, Asia at the top of the dashboard and then refer to these variable as $region.ip, $region.service_name etc

I can't figure out how to do it, even using Custom variables

EDIT: I need to be able to define these variables manually. Not pull them from some data source

Source Link
Will1v
  • 196
  • 2
  • 14

Sets variables in Grafana?

Is there a way to define a toggle variable that holds sets of variables?

eg a region switch that would have:

  • 'Europe': {ip: 'europe_ip', port: 'europe_port', service_name: 'europe_service_name'}
  • 'America': {ip: 'america_ip', port: 'america_host', service_name: 'america_service_name'}
  • 'Asia': {ip: 'asia_ip', port: 'asia_host', service_name: 'asia_service_name'}

where you'd have a dropdown for region with Europe, America, Asia at the top of the dashboard and then refer to these variable as $region.ip, $region.service_name etc

I can't figure out how to do it, even using Custom variables