Skip to content

Commit

Permalink
Add Consul ServiceID to the discovery meta labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharif Nassar committed Aug 20, 2015
1 parent ac0be60 commit 6cb519f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions retrieval/discovery/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
})
}

Expand Down

0 comments on commit 6cb519f

Please sign in to comment.