Usually what I recommend is [$__interval] and setting the "min step" to 1h.
This will make sure that the sum_over_time() works how you would
expect, each point in the chart matches the width of the step..

On Thu, Aug 20, 2020 at 4:03 PM Gergely Brautigam <[email protected]>
wrote:

>
>
> On Thursday, August 20, 2020 at 3:56:11 PM UTC+2 [email protected] wrote:
>
>> Try sum_over_time(metric[4d])
>>
>
> Hi!
>
> Yep, tried that. Something like this:
>
> sum(sum(sum_over_time(server_restarts{result="failed"}[1h])) without
> (instance))
>
> But unfortunately this doesn't give an accurate number at all. If I select
> last 7 days in Grafana, but the time range here is 1h this messes up badly.
> And to be honest, I don't fully understand the correlation between time
> range in promql and the grafana time range. I do understand that time range
> `[1h]` is like a sample rate. So I could try and change this to 7d but that
> messes up things even more. :D
>
> What I can understand to use would to have a variable which you ALSO need
> to adjust while selecting the time frame in Grafana. I guess that could
> work.
>
>
>>
>> https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time
>>
>> If you are getting separate values per instance or pod, then sum() over
>> all the timeseries.
>>
> --
> 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/32608f79-363f-4be1-9eb2-513fc5226e6bn%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/32608f79-363f-4be1-9eb2-513fc5226e6bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABbyFmrZZDsHSekGqZkcZ4B5PNoJq245Vvq-yNkwQxtnFioZ9w%40mail.gmail.com.

Reply via email to