diff --git a/AUTHORS.md b/AUTHORS.md index eae5395a9..5b1fdac2f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -41,6 +41,7 @@ The following individuals have contributed code to this repository * Sam McLeod * Scott Worley * Sergiusz 'q3k' BazaƄski +* Sharif Nassar * Sindre Myren * Stephan Erb * Stephen Shirley diff --git a/retrieval/discovery/consul.go b/retrieval/discovery/consul.go index df44af7e4..945e23db4 100644 --- a/retrieval/discovery/consul.go +++ b/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), }) }