mirror of https://github.com/prometheus/prometheus
This PR adds architecture meta labels for EC2 instances Signed-off-by: Deepjyoti Mondal <djmdeveloper060796@gmail.com>pull/7068/head
parent
0c4ec8d9dd
commit
c38ca2ca95
|
@ -39,6 +39,7 @@ import (
|
||||||
const (
|
const (
|
||||||
ec2Label = model.MetaLabelPrefix + "ec2_"
|
ec2Label = model.MetaLabelPrefix + "ec2_"
|
||||||
ec2LabelAZ = ec2Label + "availability_zone"
|
ec2LabelAZ = ec2Label + "availability_zone"
|
||||||
|
ec2LabelArch = ec2Label + "architecture"
|
||||||
ec2LabelInstanceID = ec2Label + "instance_id"
|
ec2LabelInstanceID = ec2Label + "instance_id"
|
||||||
ec2LabelInstanceState = ec2Label + "instance_state"
|
ec2LabelInstanceState = ec2Label + "instance_state"
|
||||||
ec2LabelInstanceType = ec2Label + "instance_type"
|
ec2LabelInstanceType = ec2Label + "instance_type"
|
||||||
|
@ -219,6 +220,10 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
labels[ec2LabelInstanceLifecycle] = model.LabelValue(*inst.InstanceLifecycle)
|
labels[ec2LabelInstanceLifecycle] = model.LabelValue(*inst.InstanceLifecycle)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if inst.Architecture != nil {
|
||||||
|
labels[ec2LabelArch] = model.LabelValue(*inst.Architecture)
|
||||||
|
}
|
||||||
|
|
||||||
if inst.VpcId != nil {
|
if inst.VpcId != nil {
|
||||||
labels[ec2LabelVPCID] = model.LabelValue(*inst.VpcId)
|
labels[ec2LabelVPCID] = model.LabelValue(*inst.VpcId)
|
||||||
labels[ec2LabelPrimarySubnetID] = model.LabelValue(*inst.SubnetId)
|
labels[ec2LabelPrimarySubnetID] = model.LabelValue(*inst.SubnetId)
|
||||||
|
|
|
@ -426,6 +426,7 @@ the public IP address with relabeling.
|
||||||
|
|
||||||
The following meta labels are available on targets during [relabeling](#relabel_config):
|
The following meta labels are available on targets during [relabeling](#relabel_config):
|
||||||
|
|
||||||
|
* `__meta_ec2_architecture`: the architecture of the instance
|
||||||
* `__meta_ec2_availability_zone`: the availability zone in which the instance is running
|
* `__meta_ec2_availability_zone`: the availability zone in which the instance is running
|
||||||
* `__meta_ec2_instance_id`: the EC2 instance ID
|
* `__meta_ec2_instance_id`: the EC2 instance ID
|
||||||
* `__meta_ec2_instance_lifecycle`: the lifecycle of the EC2 instance, set only for 'spot' or 'scheduled' instances, absent otherwise
|
* `__meta_ec2_instance_lifecycle`: the lifecycle of the EC2 instance, set only for 'spot' or 'scheduled' instances, absent otherwise
|
||||||
|
|
Loading…
Reference in New Issue