From 0d2d6e9a2768b331daef448701a2442a9c56727d Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Fri, 24 May 2013 10:44:34 +0200 Subject: [PATCH] Include uptime in the status console. In order to help corroborate whether a Prometheus instance has flapped until meta-monitoring is in-place, we ought to provide the instance's start time in the console to aid in diagnostics. --- main.go | 1 + web/status.go | 3 +++ web/templates/status.html | 13 ++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 812250b3d3..3d84a45e9e 100644 --- a/main.go +++ b/main.go @@ -224,6 +224,7 @@ func main() { Config: conf.String(), TargetPools: targetManager.Pools(), Flags: flags, + Birth: time.Now(), }, CurationState: curationState, } diff --git a/web/status.go b/web/status.go index bb7e595baf..abd07e6ce1 100644 --- a/web/status.go +++ b/web/status.go @@ -18,6 +18,7 @@ import ( "github.com/prometheus/prometheus/storage/metric" "net/http" "sync" + "time" ) type PrometheusStatus struct { @@ -27,6 +28,8 @@ type PrometheusStatus struct { Flags map[string]string Rules string TargetPools map[string]*retrieval.TargetPool + + Birth time.Time } type StatusHandler struct { diff --git a/web/templates/status.html b/web/templates/status.html index c821cab545..2b029202a3 100644 --- a/web/templates/status.html +++ b/web/templates/status.html @@ -1,7 +1,18 @@ {{define "head"}}{{end}} {{define "content"}} -

Build Info

+

Runtime Information

+
+ + + + + + + +
Uptime{{.Birth}}
+
+

Build Information