From 2db1eeb4ec09301ecb4e8cc9ed03b6c866adc2aa Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 5 Feb 2019 19:52:42 +0100 Subject: [PATCH] Fix prometheus_rule_group_last_evaluation_timestamp_seconds It should be a unix timestamp, not the seconds in the minute. Signed-off-by: beorn7 --- rules/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/manager.go b/rules/manager.go index f901d8c56..2aae53337 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -385,7 +385,7 @@ func (g *Group) GetEvaluationTimestamp() time.Time { // setEvaluationTimestamp updates evaluationTimestamp to the timestamp of when the rule group was last evaluated. func (g *Group) setEvaluationTimestamp(ts time.Time) { - g.metrics.groupLastEvalTime.WithLabelValues(groupKey(g.file, g.name)).Set(float64(ts.Second())) + g.metrics.groupLastEvalTime.WithLabelValues(groupKey(g.file, g.name)).Set(float64(ts.UnixNano()) / 1e9) g.mtx.Lock() defer g.mtx.Unlock()