mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
agent: added metadata information about servers into consul service description (#5455)
This allows have information about servers from HTTP APIs without using the command line.
This commit is contained in:
parent
d3d92d76f3
commit
4eb73973b6
@ -1363,6 +1363,17 @@ func (s *Server) handleAliveMember(member serf.Member) error {
|
|||||||
ID: structs.ConsulServiceID,
|
ID: structs.ConsulServiceID,
|
||||||
Service: structs.ConsulServiceName,
|
Service: structs.ConsulServiceName,
|
||||||
Port: parts.Port,
|
Port: parts.Port,
|
||||||
|
Weights: &structs.Weights{
|
||||||
|
Passing: 1,
|
||||||
|
Warning: 1,
|
||||||
|
},
|
||||||
|
Meta: map[string]string{
|
||||||
|
"raft_version": strconv.Itoa(parts.RaftVersion),
|
||||||
|
"serf_protocol_current": strconv.FormatUint(uint64(member.ProtocolCur), 10),
|
||||||
|
"serf_protocol_min": strconv.FormatUint(uint64(member.ProtocolMin), 10),
|
||||||
|
"serf_protocol_max": strconv.FormatUint(uint64(member.ProtocolMax), 10),
|
||||||
|
"version": parts.Build.String(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to join the consul server
|
// Attempt to join the consul server
|
||||||
|
Loading…
x
Reference in New Issue
Block a user