Browse Source

Add Consul ServiceID to the discovery meta labels.

pull/1019/head
Sharif Nassar 9 years ago
parent
commit
6cb519fe82
  1. 1
      AUTHORS.md
  2. 3
      retrieval/discovery/consul.go

1
AUTHORS.md

@ -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>

3
retrieval/discovery/consul.go

@ -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…
Cancel
Save