mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 10:58:25 +00:00
Add the list of Raft peers to Consul's Stats
``` % consul info [snip] raft: [snip] raft_peers = 127.0.0.1:8300 [snip] ``` Poached from: Nomad Project
This commit is contained in:
parent
5a1f60f85a
commit
6cf21fbbe9
@ -11,6 +11,7 @@ import (
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -743,6 +744,11 @@ func (s *Server) Stats() map[string]map[string]string {
|
||||
"serf_wan": s.serfWAN.Stats(),
|
||||
"runtime": runtimeStats(),
|
||||
}
|
||||
if peers, err := s.raftPeers.Peers(); err == nil {
|
||||
stats["raft"]["raft_peers"] = strings.Join(peers, ",")
|
||||
} else {
|
||||
s.logger.Printf("[DEBUG] server: error getting raft peers: %v", err)
|
||||
}
|
||||
return stats
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user