If the metric is 0, 1, 0, 1, 1, 0 ...  then max_over_time will be 1, if the 
time period in question covers those values.
If the metric is 0, 0, 0, 0, 0, 0 ... then max_over_time will be 0.

If you enter an expression like

max_over_time(up{instance=~"some_instance_name"}[2d])

and *draw a graph of it*, then you need to understand what that graph 
represents.  On the X axis is time; this is the time the expression was 
evaluated at.  The expression itself looks at the 2 days of data *up to and 
including that time*: that is, the range vector up[2d] reads all data in 
the database between T and T-2d.

For example, if there's a point on the graph where the X axis is 15 Aug 
12:00, and the Y axis is 1, it means that the max_over_time between 13 Aug 
12:00 and 15 Aug 12:00 was 1.  This in turn implies that there was at least 
one 1 value in that 2d period.  It will only show 0 if *all* the values in 
that period were 0.

If that doesn't do what you want, then you'll have to describe exactly what 
you see more clearly, with actual concrete queries and responses, and 
explain why it is different to what you expect.  Otherwise, only you can 
see the data in front of you, so it's up to you to understand why your 
query isn't doing what you expect.

> But I want only unreachable state servers over a period of time?

That will be those where max_over_time(...) is zero, and you can filter 
down to just those servers with an expression like this:

max_over_time(up[2d]) == 0

If you graph this expression, then all the data points will be zeros, but 
the points will appear and disappear over time.  They will be present at 
time T only if all the values in the period T-2d to T were 0.  If that's 
not the case, then the point will not be displayed.

-- 
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/a21eecd5-b11a-459d-b4b7-3d633d8d75c3n%40googlegroups.com.

Reply via email to