Hi,

On 5/1/20 3:57 AM, O wrote:
> I am using increase() function to calculate the increase in counter
> value over a time period. These values are being displayed in a table in
> Grafana. But, for a duration of 15 days or so, it errors out because the
> number of samples that are being pulled is too high and the limit
> for |--query.max-samples| flag is crossed. 
> 
> So, my question is if there is a better way to calculate the increase in
> counter and display it in the Grafana table without pulling so many
> labels from Prometheus.

increase() tries to detect counter resets. In order for this to work,
each data point has to be considered (at least I assume that this is the
case). I don't see a a way around this.

If you know for sure that your counter does not reset (at least in the
timeframe you are interested in), you might achieve what you want by a
simple substraction which should be less resource-intensive:

your_metric - your_metric offset 14d

Of course, you can also increase the max-samples value. It is primarily
there as a safeguard against high resource usage (i.e. you might need
more RAM and longer processing times).

Kind regards,
Christian

-- 
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/cf18f170-c6d1-41d9-10e9-e211e6fcd0a9%40hoffmann-christian.info.

Reply via email to