Querying Consul With Grafana

Last updated: Nov 15, 2020

usecase

The concern is documenting getting consul queries in grafana

1. variables

1.1. create consul datasource

  • create a Consul variable as a datasource type → select Consul
  • difference is that here, you can use also KEYS (not tree leaves) as values

1.2. create consul query

  • create a ConsulQuery variable as a query → select $Consul as a datasource
  • but how could I create the queries made out of variables — well, most probably
  • you have to be using those, the only variable I can think of is, however, only customer, can you create another one

2. queries

  • You can just query consul
  • here I would like to know now many nodes each client has in their ES cluster

2.1. navigation: no whitespace, relative paths

  • in columns, no spaces are allowed
  • navigate with relative paths

2.2. retrieve key directly

2.3. get selected keys from a parent node

  • either select a leaf such as
customer/${customer}/aws_elasticsearch_prod1/input/volume_size
  • and then add other leaves to is in columns
./,../instance_count/,../instance_type/

2.4. columns

  • seems like that is going from the query
  • so if you query
customer/*/aws_setup_prod1/input/client_name
  • you put the following as columns
./,../uuid
  • to have the result of the query as a columns in and of itself, use ./

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store