Grafana multistage query with HTTP GET requests

I am trying to perform a multistage query in Grafana. The queries are HTTP GET requests. In my first request, I get an output in JSON format, I want each element of this output to form a new GET request and get the results.

I am using the Infinity plugin to perform HTTP GET requests.
Here are example requests/queries.

Output - 
{
  "test": [
    "consumer-ec2-1"
  ],
  "test1": [
    "consumer-ec2-1"
  ]
}

The second-level queries I want to perform should look like this using the above output.

https://api.dev.sample.com/monitoring/v1/kafka/consumerGroupClientMetrics?
consumerGroup=$variable-1&topic=test -u username:password

https://api.dev.sample.com/monitoring/v1/kafka/consumerGroupClientMetrics?
consumerGroup=$variable-1&topic=test1 -u username:password

Here, the last parameters for both queries topic=test and topic=test1 are taken from the output of the first query. The number of second-level queries I want to perform depends on the number of elements in the first query. There can be 100s of such elements, each will form a distinct second-level query.

I will then render the output data in a table for all such queries.

Is this possible? If so how?

Thanks.

Are you comfortable with JavaScript?

Not much, are there any alternatives or can basic knowledge of javascript help here? If so, please elaborate on what is the option with js.

Which visualization do you want? Bar chart, time series?

From here look at business chart which implements Apache echarts

I think the time series makes more sense. I’ll take a look at the options you shared thanks. I am also looking to use alerting for the data hope that is possible too.

The docus they have should help, they also have excellent videos on YouTube

1 Like

I would rather use Node-RED for that… I.e. Grafana sends first request to Node-RED, Node-RED handles all stages, and Grafana receives final result from Node-RED.

2 Likes