From 7e9549b3986585aede0904391f81cd1e084695c2 Mon Sep 17 00:00:00 2001 From: Javier Kohen Date: Fri, 10 Aug 2018 11:11:03 -0400 Subject: [PATCH] Added __meta_gce_instance_id discovery label Populated from instance.ID. I will follow up with a change to the documentation. Signed-off-by: Javier Kohen --- discovery/gce/gce.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discovery/gce/gce.go b/discovery/gce/gce.go index b92336d0d..32a5b52b5 100644 --- a/discovery/gce/gce.go +++ b/discovery/gce/gce.go @@ -40,6 +40,7 @@ const ( gceLabelSubnetwork = gceLabel + "subnetwork" gceLabelPublicIP = gceLabel + "public_ip" gceLabelPrivateIP = gceLabel + "private_ip" + gceLabelInstanceID = gceLabel + "instance_id" gceLabelInstanceName = gceLabel + "instance_name" gceLabelInstanceStatus = gceLabel + "instance_status" gceLabelTags = gceLabel + "tags" @@ -209,6 +210,7 @@ func (d *Discovery) refresh() (tg *targetgroup.Group, err error) { labels := model.LabelSet{ gceLabelProject: model.LabelValue(d.project), gceLabelZone: model.LabelValue(inst.Zone), + gceLabelInstanceID: model.LabelValue(inst.Id), gceLabelInstanceName: model.LabelValue(inst.Name), gceLabelInstanceStatus: model.LabelValue(inst.Status), gceLabelMachineType: model.LabelValue(inst.MachineType),