On Mon, 29 Jun 2020 at 16:10, Mathieu Tétreault < [email protected]> wrote:
> Hello, > > I am trying to get my head around an issue that I am having. > > Let's say I have metrics A, B and C that are scraped every 15 seconds. At > the end of each hours we need to use metrics A, B and C to create metric > D. The D metric needs to be timestamped at the beginning of the hour. Let > says the metric D is calculated at the 14h59, it should be timestamped at > 14h00. > > In other words, is there a way to save a metric at the end of each hour > and can it be timestamped as it was scraped at the beginning of the hour? > > I was looking toward using the recording rules, but I haven't found > anything that would do it. > > Is prometheus made to support that? > It isn't. Eval intervals like scrape intervals shouldn't be over 2m, and even when in the 2m a given scape/evaluation will be performed is arbitrary for the sake of spreading out load. In addition PromQL can't look into the future, and recording rules can't perform evaluations that output to the past. Prometheus isn't designed with 100% exact reporting in mind, https://www.robustperception.io/monthly-reporting-with-prometheus-and-python is one way you could approach this. -- 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/CAHJKeLoL3j537aCD_r0chGiYV2qnQzu5%2Beyr2f7e%2BL-xFC82Mw%40mail.gmail.com.

