diff --git a/cmd/hw/main.go b/cmd/hw/main.go index 2212c99..a9b1b2f 100644 --- a/cmd/hw/main.go +++ b/cmd/hw/main.go @@ -27,6 +27,7 @@ func main() { r := hw.V{ Hostname: hn, V: hw.Version, + G: hw.Git, } if err := json.NewEncoder(w).Encode(r); err != nil { log.Printf("json: %+v", err) diff --git a/cmd/hwc/main.go b/cmd/hwc/main.go index 33d33be..baa2c99 100644 --- a/cmd/hwc/main.go +++ b/cmd/hwc/main.go @@ -20,6 +20,7 @@ var success *prometheus.CounterVec type state struct { Hostname string `json:"hostname"` V string `json:"version"` + G string `json:"git"` sync.RWMutex Counts map[string]int `json:"counts"` @@ -84,6 +85,7 @@ func main() { fetcher := state{ Hostname: hn, V: hw.Version, + G: hw.Git, Counts: map[string]int{}, } go fetcher.update(target) diff --git a/hw.go b/hw.go index aedec73..0b19009 100644 --- a/hw.go +++ b/hw.go @@ -3,6 +3,7 @@ package hw import "net/http" var Version = "unset" +var Git = "unset" // OK simply return 200 func OK(w http.ResponseWriter, req *http.Request) {} @@ -11,4 +12,5 @@ func OK(w http.ResponseWriter, req *http.Request) {} type V struct { Hostname string `json:"hostname"` V string `json:"version"` + G string `json:"git"` }