Merge pull request #2063 from dominikschulz/gce_instance_status

Add GCE Instance Status
This commit is contained in:
Brian Brazil 2016-10-08 08:32:47 +01:00 committed by GitHub
commit a728f193de

View file

@ -40,6 +40,7 @@ const (
gceLabelPublicIP = gceLabel + "public_ip" gceLabelPublicIP = gceLabel + "public_ip"
gceLabelPrivateIP = gceLabel + "private_ip" gceLabelPrivateIP = gceLabel + "private_ip"
gceLabelInstanceName = gceLabel + "instance_name" gceLabelInstanceName = gceLabel + "instance_name"
gceLabelInstanceStatus = gceLabel + "instance_status"
gceLabelTags = gceLabel + "tags" gceLabelTags = gceLabel + "tags"
// Constants for instrumentation. // Constants for instrumentation.
@ -167,6 +168,7 @@ func (gd *GCEDiscovery) refresh() (tg *config.TargetGroup, err error) {
gceLabelProject: model.LabelValue(gd.project), gceLabelProject: model.LabelValue(gd.project),
gceLabelZone: model.LabelValue(inst.Zone), gceLabelZone: model.LabelValue(inst.Zone),
gceLabelInstanceName: model.LabelValue(inst.Name), gceLabelInstanceName: model.LabelValue(inst.Name),
gceLabelInstanceStatus: model.LabelValue(inst.Status),
} }
priIface := inst.NetworkInterfaces[0] priIface := inst.NetworkInterfaces[0]
labels[gceLabelNetwork] = model.LabelValue(priIface.Network) labels[gceLabelNetwork] = model.LabelValue(priIface.Network)