Answer the question
In order to leave comments, you need to log in
How to get the time for which the metric became maximum in Prometheus?
Can you tell me if it's possible, and if so, how?
There is a metric that we give to prometheus, at some point in time it changes from 0 to a certain maximum value (let's say 100). The task is: to get the time for which it grew.
I tried like this:
some_metric{label="l1"}[10m]
- the interval during which the maximum value is usually always reached
timestamp(max_over_time(some_metric{label="l1"}[10m]))- timestamp(min_over_time(some_metric{label="l1"}[10m]))
- in this case, 0 is returned because, for reasons that are not clear to me, the expression:timestamp(max_over_time(some_metric{label="l1"}[10m]))
timestamp(min_over_time(some_metric{label="l1"}[10m]))
min_over_time(some_metric{label="l1"}[10m])
max_over_time(some_metric{label="l1"}[10m])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question