HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to get EC2 instance tags when pulling CloudWatch data?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
cloudwatchec2tagsinstancegethowpullingdatawhen

Problem

For monitoring purposes, we're pulling AWS/EC2 instances statistics data from CloudWatch and save it to InfluxDB.

We're using Telegraf to do this.

However, when pulling the data from Cloudwatch, it doesn't contain the instance tags or env_variables, only the standard instance fields (instance_id, for example)

Is there a way to get this data when pulling the stats? Some other agent? A Lambda function?

Solution

CloudWatch metrics contain "dimensions" that loosely match InfluxDB's concept of "tags". The list of dimensions available for EC2 metrics is available in the AWS documentation. Instances tags are not available and I'm not sure what you mean by env_variables but since all that is supported is

  • AutoScalingGroupName



  • ImageId



  • InstanceId



  • InstanceType



the answer is still going to be this is not possible.

Context

StackExchange DevOps Q#1570, answer score: 2

Revisions (0)

No revisions yet.