Hi fellows,
I want to get the timestamp or the time passed since a certain metric has been a certain value, like 1 in this case:
I have an enum value (can make it a Gauge too, if needed) and want to see, when it has been at a certain state the last time, hence getting the timestamp of it. The state in question:
my_metric{label="custom_thing: a"} 1
|
Currently the metric is this state since couple days:
my_metric{label="custom_thing: b"} 0
|
Output expected after query:
my_metric{label="custom_thing: a"} 1590743254.8581
|
or
my_metric{label="custom_thing: a"} 1...@1590743254.8581
|
When I run
my_metric{label="custom_thing: a"}[1w]
I end up in seeing the timestamps in question, if the change has been within the last week. That approach would be sufficient, I could do different ranges to workaround it. Still the output is like
1 @1590743254.858
1 @1590743554.858
1 @1590743854.858
but I can't just get the most recent timestamp of these.
Any ideas would be appreciated.
BR;v