On 23 Jul 01:04, Marek Skalicky wrote:
> Hi,
> I'm running prometheus with lookback-delta=9m and scraping a metric every 5 
> minutes. I've seen issue when evaluating 
> 'increase(ifHCInOctets{network_key="xxx"}[10m])/2' in recording rule.
> I've reported that as a bug in 
> https://github.com/prometheus/prometheus/issues/9092, but I was told the 
> lookback-delta should be 15m so it's an issue of configuration.
> 
> But when I do the same query in grafana it shows correctly. So does the 
> lookback-delta have special meaning for recording rules?
> My understanding was that the lookback delta is used per individual data 
> points, so the fact that the query/rule has range vector 10m has nothing to 
> do with the lookback delta. I have also recording rules doing "the same" 
> with 1h and 24h range vector and those work fine.
> 
> Could anyone please explain why I should use 15m lookback-delta?

In your case you have a very low scrape interval, 300s. That means that
for your prometheus server, if you query data, you would find some
oddities with the default lookback delta.

When I did look at the issue, I did not notice that you were using
increase. Then, loopback delta does not play a role. Instead, you should
use:

irate(ifHCInOctets{network_key="xxx"}[15m])

which seems a better option.

15 min should ensure there is at least 2 datapoints, and irate will do
the calculation between the last 2 datapoints.

> 
> Many thanks,
> Marek Skalicky
> 
> -- 
> 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/c73ad64d-0958-442d-88c5-2d5a6f2a738an%40googlegroups.com.


-- 
Julien Pivotto
@roidelapluie

-- 
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/20210723090913.GA237588%40hydrogen.

Reply via email to