mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-07 06:37:17 +02:00
discovery/ec2: Add primary_subnet_id label
Signed-off-by: José Martínez <xosemp@gmail.com>
This commit is contained in:
parent
5e4a33c890
commit
791c13b142
@ -45,6 +45,7 @@ const (
|
|||||||
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"
|
||||||
|
ec2LabelPrimarySubnetID = ec2Label + "primary_subnet_id"
|
||||||
ec2LabelSubnetID = ec2Label + "subnet_id"
|
ec2LabelSubnetID = ec2Label + "subnet_id"
|
||||||
ec2LabelTag = ec2Label + "tag_"
|
ec2LabelTag = ec2Label + "tag_"
|
||||||
ec2LabelVPCID = ec2Label + "vpc_id"
|
ec2LabelVPCID = ec2Label + "vpc_id"
|
||||||
@ -256,6 +257,7 @@ func (d *Discovery) refresh() (tg *targetgroup.Group, err error) {
|
|||||||
|
|
||||||
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)
|
||||||
|
|
||||||
// Deduplicate VPC Subnet IDs maintaining the order of the network interfaces returned by EC2.
|
// Deduplicate VPC Subnet IDs maintaining the order of the network interfaces returned by EC2.
|
||||||
var subnets []string
|
var subnets []string
|
||||||
|
@ -401,6 +401,7 @@ The following meta labels are available on targets during [relabeling](#relabel_
|
|||||||
* `__meta_ec2_instance_id`: the EC2 instance ID
|
* `__meta_ec2_instance_id`: the EC2 instance ID
|
||||||
* `__meta_ec2_instance_state`: the state of the EC2 instance
|
* `__meta_ec2_instance_state`: the state of the EC2 instance
|
||||||
* `__meta_ec2_instance_type`: the type of the EC2 instance
|
* `__meta_ec2_instance_type`: the type of the EC2 instance
|
||||||
|
* `__meta_ec2_primary_subnet_id`: the subnet ID of the primary network interface, if available
|
||||||
* `__meta_ec2_private_ip`: the private IP address of the instance, if present
|
* `__meta_ec2_private_ip`: the private IP address of the instance, if present
|
||||||
* `__meta_ec2_public_dns_name`: the public DNS name of the instance, if available
|
* `__meta_ec2_public_dns_name`: the public DNS name of the instance, if available
|
||||||
* `__meta_ec2_public_ip`: the public IP address of the instance, if available
|
* `__meta_ec2_public_ip`: the public IP address of the instance, if available
|
||||||
|
Loading…
Reference in New Issue
Block a user