When the value of query_result_sys_network_track_error is empty, the result 
is also empty. I want it to default to 0, regardless of whether the minuend 
or subtrahend is empty. I tried using vector(0), but when used together 
with sum by, the same problem occurs.

My current query is:

```

(sum by (host)(sum_over_time(query_result_sys_network_track_error[24h]))) - 
(sum by (host)(sum_over_time(query_result_sys_network_track_error[24h] 
offset 7d)))

```

I tried using vector(0) to solve this problem but it did not work:

```

(sum by (host)(sum_over_time(query_result_sys_network_track_error)) or 
vector(0)) - (sum by 
(host)(sum_over_time(query_result_sys_network_track_error[24h] offset 7d)) 
or vector(0))

```

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/de87a0e2-56f2-40db-a755-99466247c6f0n%40googlegroups.com.

Reply via email to