Merge pull request #1019 from mrwacky42/add-consul-service-id
Add Consul ServiceID to the discovery meta labels.
This commit is contained in:
commit
725a507206
|
@ -41,6 +41,7 @@ The following individuals have contributed code to this repository
|
|||
* Sam McLeod <sammcj@users.noreply.github.com>
|
||||
* Scott Worley <scottworley@scottworley.com>
|
||||
* Sergiusz 'q3k' Bazański <q3k@q3k.org>
|
||||
* Sharif Nassar <mrwacky42@gmail.com>
|
||||
* Sindre Myren <smyrman@gmail.com>
|
||||
* Stephan Erb <github@stephanerb.eu>
|
||||
* Stephen Shirley <kormat@gmail.com>
|
||||
|
|
|
@ -47,6 +47,8 @@ const (
|
|||
ConsulServicePortLabel = clientmodel.MetaLabelPrefix + "consul_service_port"
|
||||
// ConsulDCLabel is the name of the label containing the datacenter ID.
|
||||
ConsulDCLabel = clientmodel.MetaLabelPrefix + "consul_dc"
|
||||
// ConsulServiceIDLabel is the name of the label containing the service ID.
|
||||
ConsulServiceIDLabel = clientmodel.MetaLabelPrefix + "consul_service_id"
|
||||
)
|
||||
|
||||
// ConsulDiscovery retrieves target information from a Consul server
|
||||
|
@ -276,6 +278,7 @@ func (cd *ConsulDiscovery) watchService(srv *consulService, ch chan<- *config.Ta
|
|||
ConsulTagsLabel: clientmodel.LabelValue(tags),
|
||||
ConsulServiceAddressLabel: clientmodel.LabelValue(node.ServiceAddress),
|
||||
ConsulServicePortLabel: clientmodel.LabelValue(strconv.Itoa(node.ServicePort)),
|
||||
ConsulServiceIDLabel: clientmodel.LabelValue(node.ServiceID),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue