From 1f71caf23f480f734fc13c5cd4253f6fa0f3edb3 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Wed, 7 Mar 2018 16:14:46 +0100 Subject: [PATCH] Add golang runtime information to status page. (#3914) --- web/ui/bindata.go | 6 +++--- web/ui/templates/status.html | 12 ++++++++++++ web/web.go | 23 +++++++++++++++-------- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/web/ui/bindata.go b/web/ui/bindata.go index b53f689a9..a9e2805d6 100644 --- a/web/ui/bindata.go +++ b/web/ui/bindata.go @@ -246,12 +246,12 @@ func webUiTemplatesServiceDiscoveryHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "web/ui/templates/service-discovery.html", size: 2528, mode: os.FileMode(420), modTime: time.Unix(1519677297, 0)} + info := bindataFileInfo{name: "web/ui/templates/service-discovery.html", size: 2528, mode: os.FileMode(420), modTime: time.Unix(1519919461, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _webUiTemplatesStatusHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x55\xc1\x8e\xdb\x20\x14\xbc\xfb\x2b\x5e\x39\xae\xea\x20\xed\xb1\x22\x48\xcd\xa6\x6a\x2b\xf5\x50\xa5\x4d\xf7\x4c\xcc\x4b\x40\x75\x20\x02\x92\x6d\x84\xf8\xf7\x0a\x27\x76\x6c\x29\xbb\xd9\xca\x87\xee\x25\x61\x60\x34\xf3\x98\x07\x38\x46\x89\x6b\x6d\x10\x88\x42\x21\x49\x4a\xec\x5d\x59\x82\xd1\x7f\xa0\x2c\x79\x8c\x68\x64\x4a\x45\x71\x61\x55\xd6\x04\x34\x81\xa4\x54\x00\x30\xa9\x0f\x50\xd5\xc2\xfb\x69\xb3\x20\xb4\x41\x57\xae\xeb\xbd\x96\x84\x17\x00\x00\x4c\xdd\x83\x96\x53\xe2\xf6\x26\xe8\x2d\x12\xbe\x38\x0d\xe0\xab\x59\x5b\xb7\x15\x41\x5b\xc3\xa8\xba\x3f\xb3\x83\x58\xd5\xd8\x2a\x9e\x40\xf3\x5b\x56\xd6\x48\x34\x1e\xe5\x19\xaf\xac\x93\xe8\x3a\xe8\x83\xd3\xbb\x0e\x29\x7b\x40\x77\x2e\x20\x8b\xae\xac\x3c\xb6\x28\x63\x77\x01\x19\x2a\xbe\xdc\xe5\x9a\x18\x0d\x6a\xb8\x22\x79\x8c\x93\x99\x76\x41\x4d\x96\x3f\x1f\x52\x62\x34\xc8\x9e\x10\xed\x2b\x5d\x91\x7d\xb4\xee\xb7\x36\x1b\x98\x6b\x87\x55\xb0\xee\xf8\x8c\xc3\xc3\xe3\xfc\x25\x6d\x46\x7b\x3b\x60\xb4\xd9\x23\x2f\x06\xf1\xae\xf6\xba\x96\xfa\x12\x29\xe1\xb3\x3c\xf3\xa6\x52\x06\x5f\xd9\x1d\x4e\x89\xb3\x4f\x84\xff\x42\xe7\x9b\xa2\xae\x06\x72\x5e\x6d\xff\xff\x35\xf8\x81\xd3\x02\x0f\xfa\x15\x56\x2d\x6d\x94\xd7\xcc\x09\x53\xa9\x1b\x4e\x27\xd2\x38\x9f\xdc\xdc\xa5\x47\x77\xcb\xaa\xe5\x8d\x77\x9b\x8b\xf0\xdc\x05\x19\xb8\x65\xde\x28\xb7\xcf\xf6\x75\x67\xa3\xe3\x8d\xbc\x3a\xa2\x46\x17\xb6\xc2\x88\x0d\x3a\x4f\xf8\xc7\x3e\xfc\xbf\x77\xa6\x79\x43\x3e\x19\xb9\xb3\xda\x84\x61\x1a\xc3\x44\x63\x74\xc2\x6c\x10\x26\x83\xe2\x9b\x17\xfa\xaa\x70\x8c\xf4\x0e\xfa\x5c\x58\x2e\xbe\x79\x10\xf5\x93\x38\x7a\x50\xe2\x80\xf0\xa3\x52\xb8\xc5\xf7\xf0\xc5\xfa\x00\xc2\x48\xf8\x2e\x72\x9f\x30\xc0\x1d\xed\x09\x77\x5d\x39\xf1\x53\xfa\x40\x29\x13\xa0\x1c\xae\xa7\x64\x38\x1d\xe3\x24\x8b\xa5\x44\x78\x37\x64\x54\x64\x90\xb5\x5f\x3e\x33\xed\x87\xe8\x46\x57\x19\x95\xfa\xc0\x8b\x96\xfd\x37\x00\x00\xff\xff\x3e\x79\x94\x2b\xdc\x06\x00\x00") +var _webUiTemplatesStatusHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x55\xc1\x8e\xda\x30\x10\xbd\xe7\x2b\xa6\x3e\xae\x1a\x2c\xed\xb1\x0a\x91\x76\xa1\xa2\x95\xda\xee\x8a\x2d\xdd\x5e\x4d\x3c\x10\xab\xc1\x46\x63\x87\x2d\xb2\xfc\xef\x55\x02\x09\x89\x04\xcb\x52\x0e\xed\x25\xf1\xf3\x3c\xbd\x37\x9a\x19\xdb\xde\x4b\x5c\x28\x8d\xc0\x72\x14\x92\x85\x90\xbc\x8b\x63\xd0\xea\x37\xc4\x71\xea\x3d\x6a\x19\x42\x14\x1d\x58\x99\xd1\x0e\xb5\x63\x21\x44\x00\x89\x54\x1b\xc8\x0a\x61\xed\xb0\x0e\x08\xa5\x91\xe2\x45\x51\x2a\xc9\xd2\x08\x00\x20\xc9\x6f\x41\xc9\x21\xa3\x52\x3b\xb5\x42\x96\x4e\x77\x0b\xf8\xac\x17\x86\x56\xc2\x29\xa3\x13\x9e\xdf\xee\xd9\x4e\xcc\x0b\x6c\x14\x77\xa0\xfe\xc6\x99\xd1\x12\xb5\x45\xb9\xc7\x73\x43\x12\xa9\x85\xd6\x91\x5a\xb7\x28\x37\x1b\xa4\x7d\x02\x95\xe8\xdc\xc8\x6d\x83\x2a\x4c\x07\x50\xc1\x3c\x9d\xad\xab\x9c\x12\xee\xf2\x7e\x44\xa6\xde\x0f\xee\x15\xb9\x7c\x30\xfb\x3e\x0a\x21\xe1\x4e\x76\x84\x78\x57\xe9\x88\xec\xb3\xa1\x5f\x4a\x2f\x61\xac\x08\x33\x67\x68\x7b\xc2\x61\xf4\x3c\xbe\x58\xfb\x5b\xb9\x9a\x23\x81\x59\xc0\xd2\x90\x29\x9d\xd2\x68\x4f\xc8\x4f\x1a\xc2\xc8\x94\xda\x5d\xec\x34\x79\xf8\x7a\xf7\xf3\x71\xfa\x30\x7a\x3a\xa5\xdf\x12\xfe\x42\x7b\x32\x3a\xa9\x3a\x79\xb5\xe2\x09\xef\xf4\x35\xe1\x75\xe7\xd3\xa8\x37\x74\xf3\x52\x15\x52\x1d\x06\x8d\xa5\xf7\xd5\xce\x7f\x35\x7b\x60\x33\xb3\xc6\x21\x23\xf3\xc2\xd2\x1f\x48\xb6\x4e\xea\x68\x45\xf6\xd1\xe6\x7f\x69\xb1\x7b\x4e\x53\xdc\xa8\x37\x58\x35\xb4\xab\xbc\xee\x49\xe8\x2c\x3f\xe3\xb4\x23\x5d\xe7\x53\x35\x77\x66\x91\xce\x59\x35\xbc\xeb\xdd\xc6\xc2\x9d\xba\x36\x7a\x6e\x15\xef\x2a\xb7\x89\x79\xdb\x6c\xb4\xbc\x2b\x8f\x8e\x28\x90\xdc\x4a\x68\xb1\x44\xb2\x2c\xbd\xeb\xc2\x7f\x7b\x66\xea\x7b\xe3\xa3\x96\x6b\xa3\xb4\xeb\x57\xa3\x5f\x51\xef\x49\xe8\x25\xc2\xa0\x97\x7c\xfd\x6e\x1d\x15\xf6\x9e\xdf\x40\x97\x0b\xb3\xe9\x17\x0b\xa2\x78\x11\x5b\x0b\xb9\xd8\x20\x3c\x65\x39\xae\xf0\x3d\x7c\x32\xd6\x81\xd0\x12\x1e\x45\xd5\x27\x74\x70\xc3\x3b\xc2\x6d\x57\x76\xfc\x10\x3e\x70\x9e\x08\xc8\x09\x17\x43\xd6\xdf\xf6\x7e\x50\x89\x85\xc0\xd2\x76\x99\x70\x51\x81\x4a\xfb\xf5\x99\x69\x9e\xe7\x33\x5d\x4d\xb8\x54\x9b\x34\x6a\xd8\x7f\x02\x00\x00\xff\xff\x6f\x51\x02\x01\xf2\x07\x00\x00") func webUiTemplatesStatusHtmlBytes() ([]byte, error) { return bindataRead( @@ -266,7 +266,7 @@ func webUiTemplatesStatusHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "web/ui/templates/status.html", size: 1756, mode: os.FileMode(420), modTime: time.Unix(1499247906, 0)} + info := bindataFileInfo{name: "web/ui/templates/status.html", size: 2034, mode: os.FileMode(420), modTime: time.Unix(1520343824, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/web/ui/templates/status.html b/web/ui/templates/status.html index 1a05907a3..dd4022002 100644 --- a/web/ui/templates/status.html +++ b/web/ui/templates/status.html @@ -13,6 +13,18 @@ Working Directory {{.CWD}} + + Number of goroutines + {{.GoroutineCount}} + + + GOMAXPROCS + {{.GOMAXPROCS}} + + + GOGC + {{.GOGC}} + diff --git a/web/web.go b/web/web.go index f1d1095b7..82f343df1 100644 --- a/web/web.go +++ b/web/web.go @@ -28,6 +28,7 @@ import ( "os" "path" "path/filepath" + "runtime" "sort" "strings" "sync" @@ -556,15 +557,21 @@ func (h *Handler) graph(w http.ResponseWriter, r *http.Request) { func (h *Handler) status(w http.ResponseWriter, r *http.Request) { h.executeTemplate(w, "status.html", struct { - Birth time.Time - CWD string - Version *PrometheusVersion - Alertmanagers []*url.URL + Birth time.Time + CWD string + Version *PrometheusVersion + Alertmanagers []*url.URL + GoroutineCount int + GOMAXPROCS int + GOGC string }{ - Birth: h.birth, - CWD: h.cwd, - Version: h.versionInfo, - Alertmanagers: h.notifier.Alertmanagers(), + Birth: h.birth, + CWD: h.cwd, + Version: h.versionInfo, + Alertmanagers: h.notifier.Alertmanagers(), + GoroutineCount: runtime.NumGoroutine(), + GOMAXPROCS: runtime.GOMAXPROCS(0), + GOGC: os.Getenv("GOGC"), }) }