mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
tsweb: add vars for unix process start time and version
To be scraped in the Go expvar JSON format, as a string is involved. For a future tool to record when processes restarted exactly, and at what version. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
246fa67e56
commit
51976ab3a2
@ -28,9 +28,12 @@ import (
|
||||
"tailscale.com/metrics"
|
||||
"tailscale.com/net/tsaddr"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/version"
|
||||
)
|
||||
|
||||
func init() {
|
||||
expvar.Publish("process_start_unix_time", expvar.Func(func() interface{} { return timeStart.Unix() }))
|
||||
expvar.Publish("version", expvar.Func(func() interface{} { return version.Long }))
|
||||
expvar.Publish("counter_uptime_sec", expvar.Func(func() interface{} { return int64(Uptime().Seconds()) }))
|
||||
expvar.Publish("gauge_goroutines", expvar.Func(func() interface{} { return runtime.NumGoroutine() }))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user