mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
This PR adds architecture meta labels for EC2 instances Signed-off-by: Deepjyoti Mondal <djmdeveloper060796@gmail.com>
This commit is contained in:
parent
0c4ec8d9dd
commit
c38ca2ca95
|
@ -39,6 +39,7 @@ import (
|
|||
const (
|
||||
ec2Label = model.MetaLabelPrefix + "ec2_"
|
||||
ec2LabelAZ = ec2Label + "availability_zone"
|
||||
ec2LabelArch = ec2Label + "architecture"
|
||||
ec2LabelInstanceID = ec2Label + "instance_id"
|
||||
ec2LabelInstanceState = ec2Label + "instance_state"
|
||||
ec2LabelInstanceType = ec2Label + "instance_type"
|
||||
|
@ -219,6 +220,10 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
|||
labels[ec2LabelInstanceLifecycle] = model.LabelValue(*inst.InstanceLifecycle)
|
||||
}
|
||||
|
||||
if inst.Architecture != nil {
|
||||
labels[ec2LabelArch] = model.LabelValue(*inst.Architecture)
|
||||
}
|
||||
|
||||
if inst.VpcId != nil {
|
||||
labels[ec2LabelVPCID] = model.LabelValue(*inst.VpcId)
|
||||
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):
|
||||
|
||||
* `__meta_ec2_architecture`: the architecture of the instance
|
||||
* `__meta_ec2_availability_zone`: the availability zone in which the instance is running
|
||||
* `__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
|
||||
|
|
Loading…
Reference in a new issue