Hi. I have a use case where I need to pass the result of one Query(A) into the next one as part of the input. Is that possible?
Use case:
Query ‘A’ is will return the state of objects, active/inactive. I only want to move forward with objects with Active states in the next set of queries/expressions.
If you want to filter all other queries by only Active objects, you can create a Grafana variable which will get instance/pod names, or whatever can be used as a filter. And then reuse that variable in all your queries.
For example:
Variable expression: $active_instances = label_values(my_objects(state="active"), instance)
Then in your panels you can do the following:
QueryA: cpu_usage{instance=~"$active_instaces"}