mirror of https://github.com/prometheus/prometheus
Expose ec2_instance_state
parent
e5c633ed14
commit
f6fbcf9aa2
|
@ -35,6 +35,7 @@ const (
|
||||||
ec2Label = model.MetaLabelPrefix + "ec2_"
|
ec2Label = model.MetaLabelPrefix + "ec2_"
|
||||||
ec2LabelAZ = ec2Label + "availability_zone"
|
ec2LabelAZ = ec2Label + "availability_zone"
|
||||||
ec2LabelInstanceID = ec2Label + "instance_id"
|
ec2LabelInstanceID = ec2Label + "instance_id"
|
||||||
|
ec2LabelInstanceState = ec2Label + "instance_state"
|
||||||
ec2LabelPublicDNS = ec2Label + "public_dns_name"
|
ec2LabelPublicDNS = ec2Label + "public_dns_name"
|
||||||
ec2LabelPublicIP = ec2Label + "public_ip"
|
ec2LabelPublicIP = ec2Label + "public_ip"
|
||||||
ec2LabelPrivateIP = ec2Label + "private_ip"
|
ec2LabelPrivateIP = ec2Label + "private_ip"
|
||||||
|
@ -122,6 +123,7 @@ func (ed *EC2Discovery) refresh() (*config.TargetGroup, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
labels[ec2LabelAZ] = model.LabelValue(*inst.Placement.AvailabilityZone)
|
labels[ec2LabelAZ] = model.LabelValue(*inst.Placement.AvailabilityZone)
|
||||||
|
labels[ec2LabelInstanceState] = model.LabelValue(*inst.State.Name)
|
||||||
|
|
||||||
if inst.VpcId != nil {
|
if inst.VpcId != nil {
|
||||||
labels[ec2LabelVPCID] = model.LabelValue(*inst.VpcId)
|
labels[ec2LabelVPCID] = model.LabelValue(*inst.VpcId)
|
||||||
|
|
Loading…
Reference in New Issue