that max_over_time or min_over_time can not be applied in my case , because I need recent value.. not the max or min value in that period..
On Monday, 15 June 2020 15:15:03 UTC+5:30, Baitanik Talukder wrote: > > Okay.. if we try to do the workaround with recording rule.. please tell me > how in this case.. > > just to get the latest know values from this blog ( > https://roidelapluie.be./blog/2019/02/21/prometheus-last/) > > only this one is enough .. right ? > > - record: available_sms_last expr: available_sms or available_sms_last > > where available_sms is the actual metric > > so my case I only have to add : > > groups: > - name: test-rules rules: - expr: failure_count or failure_count_last > record: failure_count_last > - alert: failure_count_last_alert > expr: failure_count_last_alert > 0 > > 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/6f9d61b1-5391-4f29-832a-779d4a36e41do%40googlegroups.com.

