Hi Brian!

Thanks! :) 

The metric IS a gauge. It goes up on server restarts and then goes down again 
as the reconciliation does not find any more servers which have restarted. It's 
part of a statistic for all servers. So, for now, I have to deal with it being 
a gauge.

resets MIGHT be actually something that could work. Please correct me if I'm 
wrong here, but resets is actually for counters and not gauges?

resets should only be used with counters.

Or does this not imply the literal metric type, counter?

Cheers.

> On 2020. Sep 1., at 14:16, Brian Candler <b.cand...@pobox.com> wrote:
> 
> First understand what your metric does, and what change in that metric you're 
> looking for.  Decide whether it is a counter (it increments for each server 
> restart, resetting to zero only when some collector restarts) or is a gauge 
> (e.g. the number of restarts in a 5 minute period).
> 
> If it's a counter, sum_over_time() is not what you're looking for.  If each 
> of your metrics goes
> 
> {instance="a"} va1 va2 va3 va4
> {instance="b"} vb1 vb2 vb3 vb4
>                t1  t2  t3  t4 -->
> 
> then the results of sum_over_time will be
> 
> {instance="a"} va1+va2+va3+va4
> {instance="b"} vb1+vb2+vb3+vb4
>                      t4
> 
> You are probably looking for either increase() 
> <https://prometheus.io/docs/prometheus/latest/querying/functions/#increase> 
> or resets() 
> <https://prometheus.io/docs/prometheus/latest/querying/functions/#resets>.
> 
> The first says how much the counter has increased in total.  It is roughly 
> equal to va4-va1.  It's more accurately equal to va4-va1 (but excluding 
> counter resets), divided by the different in timestamps between va4 and va1, 
> multiplied by the entire time window the query covers. If the counter goes up 
> by 1 each time a "restart" event occurs, this is what you want to get the 
> total number of restarts over a given period.
> 
> The second says how many times the value has dipped downwards, i.e. the 
> number of times the counter has reset.  If the counter is going up 
> continuously, but resets to zero each time a "restart" event occurs, this is 
> what you want.
> 
> -- 
> 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 prometheus-users+unsubscr...@googlegroups.com 
> <mailto:prometheus-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/prometheus-users/9b69d82d-7e3c-440e-a670-1b6d38c6463ao%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/prometheus-users/9b69d82d-7e3c-440e-a670-1b6d38c6463ao%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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/0B72657B-3425-4FDD-A517-94B12B053E97%40arangodb.com.

Reply via email to