On 13.10.20 01:22, [email protected] wrote:
> I want to get the difference between the current time and the past 5 minutes,
> but I tried two methods and couldn’t get it
> 
> 1. delta(isphone{name="qq",exname!~"test|test1"}[5m]) 
> 
> 2. sum_over_time(isphone{name="qq",exname!~"test|test1"}[5m]) - sum_over_time
> (isphone{name="qq",exname!~"test|test1"}[5m])offset 5m )
> 
> If I execute sum_over_time(isphone{name="qq",exname!~"test|test1"}[5m])
> directly, the data can be displayed normally, but I can’t get the difference
> between now and five minutes ago. Can anyone have a way? ?

I'd say the `offset` has to modify the selector directly:

  sum_over_time(isphone{name="qq",exname!~"test|test1"}[5m])
-
  sum_over_time(isphone{name="qq",exname!~"test|test1"}[5m] offset 5m)

In different news, this question is more a fit for the
prometheus-users mailing list:
https://groups.google.com/forum/#!forum/prometheus-users

-- 
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" 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-developers/20201014142931.GH3395%40jahnn.

Reply via email to