From 24b0c5ee9da9eba0fa2239484006edc3c5f5cf36 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Thu, 18 Jan 2024 15:28:39 -0800 Subject: [PATCH] api: add runtime to prometheus metrics --- api/prometheus.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/prometheus.go b/api/prometheus.go index 3e4698ee..85233ef9 100644 --- a/api/prometheus.go +++ b/api/prometheus.go @@ -21,12 +21,13 @@ func (hs HostState) PrometheusMetric() []prometheus.Metric { "commit": hs.Commit, "os": hs.OS, "build_time": hs.BuildTime, + "start_time": hs.StartTime, }, }, { - Name: "hostd_start_time", - Value: 1, - Timestamp: hs.StartTime, + Name: "hostd_runtime", + Value: float64(time.Since(hs.StartTime).Milliseconds()), + Timestamp: time.Now(), }, { Name: "hostd_last_announcement",