README
¶
EC2 Tagger Processor
The EC2 Tagger Processor can be used to scrape metadata from IMDS in EC2 instances or ECS EC2 or EKS EC2 and add the metadata to the data point attributes
Status | |
---|---|
Stability | [stable] |
Supported pipeline types | metrics |
Distributions | [amazon-cloudwatch-agent] |
Amazon Authentication
The EC2 Tagger Processor uses a credential chain for Authentication with the EC2 API endpoint. In the following order the plugin will attempt to authenticate.
- STS Credentials if Role ARN is specified
- Explicit credentials from 'access_key' and 'secret_key'
- Shared profile from 'profile' (https://stackoverflow.com/a/66121705)
The next will be the default credential chain from AWS SDK Go
- Environment Variables
- Share Credentials Files with default profile
- ECS Task IAM Role
- EC2 Instance Profile
The IAM User or Role making the calls must have permissions to call the EC2 DescribeTags API.
Processor Configuration:
The following receiver configuration parameters are supported.
Name | Description | Supported Value | Default |
---|---|---|---|
refresh_interval_seconds |
is the frequency for the plugin to refresh the EC2 Instance Tags and ebs Volumes associated with this Instance. | "0s" | "0s" |
ec2_metadata_tags |
is the option to specify which tags to be scraped from IMDS and add to datapoint attributes | ["InstanceId", "ImageId", "InstanceType"] | [] |
ec2_instance_tag_keys |
is the option to specific which EC2 Instance tags to be scraped associated with this instance. | ["aws:autoscaling:groupName", "Name"] | [] |
disk_device_tag_key |
is the option to Specify which tags to use to get the specified disk device name from input metric | [] | [] |
Documentation
¶
Index ¶
Constants ¶
View Source
const ( AttributeVolumeId = "VolumeId" ValueAppendDimensionVolumeId = "${aws:VolumeId}" )
Variables ¶
View Source
var SupportedAppendDimensions = map[string]string{
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",
"InstanceType": "${aws:InstanceType}",
}
View Source
var (
TypeStr, _ = component.NewType("ec2tagger")
)
Functions ¶
func NewFactory ¶ added in v1.300025.0
Types ¶
type Config ¶ added in v1.300025.0
type Config struct { RefreshIntervalSeconds time.Duration `mapstructure:"refresh_interval_seconds"` EC2MetadataTags []string `mapstructure:"ec2_metadata_tags"` EC2InstanceTagKeys []string `mapstructure:"ec2_instance_tag_keys"` EBSDeviceKeys []string `mapstructure:"ebs_device_keys,omitempty"` //The tag key in the metrics for disk device DiskDeviceTagKey string `mapstructure:"disk_device_tag_key,omitempty"` // unlike other AWS plugins, this one determines the region from ec2 metadata not user configuration AccessKey string `mapstructure:"access_key,omitempty"` SecretKey string `mapstructure:"secret_key,omitempty"` RoleARN string `mapstructure:"role_arn,omitempty"` Profile string `mapstructure:"profile,omitempty"` Filename string `mapstructure:"shared_credential_file,omitempty"` Token string `mapstructure:"token,omitempty"` IMDSRetries int `mapstructure:"imds_retries,omitempty"` }
type MetadataProvider ¶ added in v1.300025.0
type MetadataProvider interface { Get(ctx context.Context) (ec2metadata.EC2InstanceIdentityDocument, error) Hostname(ctx context.Context) (string, error) InstanceID(ctx context.Context) (string, error) }
func NewMetadataProvider ¶ added in v1.300025.0
func NewMetadataProvider(p client.ConfigProvider, retries int) MetadataProvider
Source Files
¶
Click to show internal directories.
Click to hide internal directories.