1
0
Fork 0

Merge pull request #889 from rqlite/os-stats

Add OS state to status/ output
master
Philip O'Toole 3 years ago committed by GitHub
commit be1468d3cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,7 @@
### Implementation changes and bug fixes ### Implementation changes and bug fixes
- [PR #885](https://github.com/rqlite/rqlite/pull/885): Improved responses on HTTP 500. - [PR #885](https://github.com/rqlite/rqlite/pull/885): Improved responses on HTTP 500.
- [PR #888](https://github.com/rqlite/rqlite/pull/888): Expose stats about BoltDB on the `status/` endpoint. - [PR #888](https://github.com/rqlite/rqlite/pull/888): Expose stats about BoltDB on the `status/` endpoint.
- [PR #889](https://github.com/rqlite/rqlite/pull/889): Add OS-level information to `status/` output.
## 6.4.3 (September 8th 2021) ## 6.4.3 (September 8th 2021)
### Implementation changes and bug fixes ### Implementation changes and bug fixes

@ -586,6 +586,20 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) {
"version": runtime.Version(), "version": runtime.Version(),
} }
oss := map[string]interface{}{
"pid": os.Getpid(),
"ppid": os.Getppid(),
"page_size": os.Getpagesize(),
}
executable, err := os.Executable()
if err == nil {
oss["executable"] = executable
}
hostname, err := os.Hostname()
if err == nil {
oss["hostname"] = hostname
}
httpStatus := map[string]interface{}{ httpStatus := map[string]interface{}{
"bind_addr": s.Addr().String(), "bind_addr": s.Addr().String(),
"auth": prettyEnabled(s.credentialStore != nil), "auth": prettyEnabled(s.credentialStore != nil),
@ -599,6 +613,7 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) {
// Build the status response. // Build the status response.
status := map[string]interface{}{ status := map[string]interface{}{
"os": oss,
"runtime": rt, "runtime": rt,
"store": storeStatus, "store": storeStatus,
"http": httpStatus, "http": httpStatus,

Loading…
Cancel
Save