Remove rows with '-' from Grafana Prometheus

I am using grafana(v6.7.3) to showcase dashboard using Prometheus datasource.

I have made many query filters – written them together:

  1. metric_state{id=~"$id", cluster=~"$cluster",user=~"$tenant", name=~".APPLE.",job="$job"} - 0
    –> only this metric has the column “NAME” which is not present in other metrics (I want to filter for name that contains word “APPLE” )

  2. metric_numActiveBatches{id=~"$id",cluster=~"$cluster",job="$job"} - 0 > 0
    –> only this metric has the column “ActiveBatches” which is not in other metrics (I want to filter for active batches greater than 0)

Apart from the two metrics above, I am also filtering for other metrics and displaying as it a new column in the table displayed on the dashboard:
3. metric_numTotalCompletedBatches{id=~"$id",cluster=~"$cluster",job="$job"} - 0
–> this will display CompletedBatches as a new column

When I see the final table on the dashboard it displays many rows with names as “-” and activeBatches as “-” --> these are null values and I am not sure how to remove rows that have any NULL values in them.

How do I only display rows that have NO NULL values?

I read online that no function in prometheus exists to filter out null.

In that case, do I need to write my queries differently? i.e. write queries with INNER_JOIN such that only it displays values when there is data in both. Can someone please suggest how to combine the two metrics above such that no null values are displayed?

I feel like i have to use the + on() or * on() operator and group_left – I tried a couple things but I am unable to understand how to use it and make it work… Please help !! It’s urgent I get this thing working today :sob:

Hi, I need help with this issue too. Any solution?