Add GCE Instance Status

This commit is contained in:
Dominik Schulz 2016-10-08 08:40:12 +02:00
parent 0cf8586136
commit c73aa82589

View file

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