You can probably get away with using subqueries now.
https://prometheus.io/blog/2019/01/28/subquery-support/
On Tue, 23 Jul 2019 at 14:03, Cedric Den Haese
<cedric....@gmail.com> wrote:
>
> Hi everybody,
>
> Inspired by the following article, I want to compare a metrics value with the value from the previous days at the same time using the offset modifier.
> https://medium.com/qubit-engineering/using-seasonality-in-prometheus-alerting-d90e68337a4c
> (The syntax used there seems to be outdated, but the concept remains the same.)
>
> To do this, I have set up a recording rule to get the value at the days before and put them in a new metric with the "offset" label, as instructed by the article.
> Since I am only interested in the average (and standard deviation) of those values at this time, I can calculate those by using "avg without (offset)" (again from the article).
>
> Since I don't actually need the metric with the offset label, this made me wonder if prometheus supports temporary recording rules.
> I am thus looking for a way to set up recording rules that are evaluated each time and can be used for further expressions, but aren't saved for the complete retention period.
>
> Is there a way to do this in prometheus?
>
> --
> 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 promethe...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/66369ee2-3c65-4587-9ebd-78000c8bbbd1%40googlegroups.com.