Answers: <p>CloudWatch metrics contain "dimensions" that loosely match InfluxDB's concept of "tags". The list of dimensions available for EC2 metrics is available in the <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html" rel="nofollow noreferrer">AWS documentation</a>. Instances tags are not available and I'm not sure what you mean by <code>env_variables</code> but since all that is supported is</p>
  
  <ul>
  <li>AutoScalingGroupName</li>
  <li>ImageId</li>
  <li>InstanceId</li>
  <li>InstanceType</li>
  </ul>
  
  <p>the answer is still going to be this is not possible.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-07-27T10:05:09.013Z
Answers: 2017-07-27T10:05:09.013Z
Answers: Robo
Body: <p>For monitoring purposes, we're pulling AWS/EC2 instances statistics data from CloudWatch and save it to InfluxDB. </p>
  
  <p>We're using <a href="https://github.com/influxdata/telegraf" rel="nofollow noreferrer">Telegraf</a> to do this. </p>
  
  <p>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) </p>
  
  <p>Is there a way to get this data when pulling the stats? Some other agent? A Lambda function? </p>
  
Comments: CC BY-SA 3.0
Comments: 2017-07-20T13:21:14.890Z
Comments: Are you looking for an aws cli call to make? If so, `aws ecs describe-task-definition` may be what you want for getting environment variables. I can write up a bit more about it if that's correct.
Comments: Alex
Comments: CC BY-SA 3.0
Comments: 2017-09-27T07:07:52.060Z
Comments: I am using https://totalcloud.io . It pulls data from CloudWatch including tags and some more. Check if it helps.
Comments: Veer Abheek Singh Manhas
Tags: <monitoring><amazon-ec2><amazon-cloudwatch>
Title: How to get EC2 instance tags when pulling CloudWatch data?
UserDisplayName: Yossale
ThreadText: # How to get EC2 instance tags when pulling CloudWatch data?
  
  (Asked by: username_0 on 2017-07-20)
  
  For monitoring purposes, we're pulling AWS/EC2 instances statistics data from CloudWatch and save it to InfluxDB.
  
  We're using [Telegraf](https://github.com/influxdata/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?
  
  **Tags:** monitoring, amazon-ec2, amazon-cloudwatch
  
  > **Comments:**
  > **username_1**: Are you looking for an aws cli call to make? If so, `aws ecs describe-task-definition` may be what you want for getting environment variables. I can write up a bit more about it if that's correct.  
  > **username_2**: I am using https://totalcloud.io . It pulls data from CloudWatch including tags and some more. Check if it helps.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2017-07-27. Score: 2
  
  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](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html). 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.
  
  
  ---
  
  