diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ab74962..59923e50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 3.1.0 (Unreleased) - [PR #118](https://github.com/rqlite/rqlite/pull/118): New rqlite CLI. Thanks @mkideal +- [PR #125](https://github.com/rqlite/rqlite/pull/125): Add Go runtime details to status endpoint. ## 3.0.1 (May 1st 2016) - [PR #117](https://github.com/rqlite/rqlite/pull/117): Use Raft advertise address, if exists, during join. diff --git a/http/service.go b/http/service.go index 7ed03ba8..b755eb33 100644 --- a/http/service.go +++ b/http/service.go @@ -12,6 +12,7 @@ import ( "net" "net/http" "os" + "runtime" "strings" "time" @@ -297,6 +298,15 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) { return } + rt := map[string]interface{}{ + "GOARCH": runtime.GOARCH, + "GOOS": runtime.GOOS, + "GOMAXPROCS": runtime.GOMAXPROCS(0), + "numCPU": runtime.NumCPU(), + "numGoroutine": runtime.NumGoroutine(), + "version": runtime.Version(), + } + httpStatus := map[string]interface{}{ "addr": s.Addr().String(), "auth": prettyEnabled(s.credentialStore != nil), @@ -310,9 +320,10 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) { // Build the status response. status := map[string]interface{}{ - "store": results, - "http": httpStatus, - "node": nodeStatus, + "runtime": rt, + "store": results, + "http": httpStatus, + "node": nodeStatus, } if !s.lastBackup.IsZero() { status["last_backup"] = s.lastBackup