I have 2 variables in my Grafana: namespace
and service
.
namespace
is defined as: foo: app1|app2|app3service
is defined as: list of app4, app5, app6I've got a metric named http_request_count
with label app.
I want to implement the following query in my Grafana panel:
http_request_count{app = namespace or service}
When the user selects both the namespace
and service
variables, I want it to be piped together so the metric is calculated for all services. But, when the user selects either of the variables, its values must be piped.
If I write something like the following:
http_request_count{app = "${namespace}|${service}"}
then, when the user doesn't choose namespace
it will be empty and a time series with an empty app label value will be selected(I want to exclude time series having an empty app label value).
How can I implement this logic correctly?
add selector app!=""