On 15 Jun 01:18, 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
This feature has been requested many times
https://github.com/prometheus/prometheus/pull/1139
https://github.com/prometheus/prometheus/pull/6530
https://github.com/prometheus/prometheus/issues/7179
https://groups.google.com/g/prometheus-developers/c/_h6_QC1zC8U/m/815U0fxQBAAJ
But no consensus has been reached yet to accept that in Prometheus.
In the mean time you can +/- workaround this in recording rules
https://roidelapluie.be./blog/2019/02/21/prometheus-last/
>
> --
> 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/36ba6d12-ec84-43c3-980e-a38b5ce5e873o%40googlegroups.com.
--
Julien Pivotto
@roidelapluie
--
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/20200615082344.GA166253%40oxygen.