On Mon, 15 Jun 2020 at 12:41, Baitanik Talukder <[email protected]>
wrote:
> Yeah it is pushed to pushgateway..
> so here for last 4 days no metric was pushed to gateway.
>
> Basically I need to check the last 3 known values and based on that raise
> alert.
> most recent count > 0 : raise alert warning
> most recent 2 consecutive count > 0 : raise alert severe
> most recent 3 consecutive count > 0 : raise alert critical
>
>
How do I do it in prometheus rule ?
>
Prometheus is not an event logging system, so that would be quite difficult.
The usual way to do this is to push a gauge when things succeed whose value
is the current time - and then alert when that's too long ago by comparing
with time().
Brian
>
> On Monday, 15 June 2020 13:48:23 UTC+5:30, Baitanik Talukder wrote:
>>
>> I need the last value in a range vector.
>> Something like
>>
>> *last_value*(failure_count{job="xyz"}[5d])
>>
>> it is need for the following scenrio:
>> for last 4 days there was no failure_count metric pushed.. so last value
>> we have 5 days back.
>> output of
>> failure_count{job="xyz"}[5d]
>>
>> I need the last value (5) from here.
>>
>> failure_count{endpoint="http",job="xyz"} 8 @1591776884.502
>> [email protected]
>> 9 @1591776944.502
>> 5 @1591776974.502
>>
>> --
> 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/ac7783e3-6ae9-4569-a7fd-7b5ee9470663o%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/ac7783e3-6ae9-4569-a7fd-7b5ee9470663o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Brian Brazil
www.robustperception.io
--
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/CAHJKeLrY9dUXs36NNQ7-Lv_gXDOd5MXNWVF8XH4LcwqPznxa7A%40mail.gmail.com.