telegraf/plugins/processors/aws/ec2
Paweł Żak 9d9eb403a6
chore: Review of //nolint comments (#12088)
2022-10-26 12:06:08 +02:00
..
README.md chore: Embed sample configurations into README for processors (#11189) 2022-05-25 08:59:41 -06:00
ec2.go chore: Review of //nolint comments (#12088) 2022-10-26 12:06:08 +02:00
ec2_test.go feat: migrate processor plugins to new sample config format (#10913) 2022-04-06 14:49:41 -06:00
sample.conf chore(processors): migrate sample configs into separate files (#11125) 2022-05-18 11:29:43 -05:00

README.md

AWS EC2 Metadata Processor Plugin

AWS EC2 Metadata processor plugin appends metadata gathered from AWS IMDS to metrics associated with EC2 instances.

Configuration

# Attach AWS EC2 metadata to metrics
[[processors.aws_ec2]]
  ## Instance identity document tags to attach to metrics.
  ## For more information see:
  ## https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html
  ##
  ## Available tags:
  ## * accountId
  ## * architecture
  ## * availabilityZone
  ## * billingProducts
  ## * imageId
  ## * instanceId
  ## * instanceType
  ## * kernelId
  ## * pendingTime
  ## * privateIp
  ## * ramdiskId
  ## * region
  ## * version
  imds_tags = []

  ## EC2 instance tags retrieved with DescribeTags action.
  ## In case tag is empty upon retrieval it's omitted when tagging metrics.
  ## Note that in order for this to work, role attached to EC2 instance or AWS
  ## credentials available from the environment must have a policy attached, that
  ## allows ec2:DescribeTags.
  ##
  ## For more information see:
  ## https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTags.html
  ec2_tags = []

  ## Timeout for http requests made by against aws ec2 metadata endpoint.
  timeout = "10s"

  ## ordered controls whether or not the metrics need to stay in the same order
  ## this plugin received them in. If false, this plugin will change the order
  ## with requests hitting cached results moving through immediately and not
  ## waiting on slower lookups. This may cause issues for you if you are
  ## depending on the order of metrics staying the same. If so, set this to true.
  ## Keeping the metrics ordered may be slightly slower.
  ordered = false

  ## max_parallel_calls is the maximum number of AWS API calls to be in flight
  ## at the same time.
  ## It's probably best to keep this number fairly low.
  max_parallel_calls = 10

Example

Append accountId and instanceId to metrics tags:

[[processors.aws_ec2]]
  tags = [ "accountId", "instanceId"]
- cpu,hostname=localhost time_idle=42
+ cpu,hostname=localhost,accountId=123456789,instanceId=i-123456789123 time_idle=42