sap1ens
sap1ens

Reputation: 2957

AWS Cloudwatch: how to fetch custom metrics from AWS Elastic Beanstalk

I'm using latest version of AWS SDK for JavaScript.

I need to get some metrics from AWS Cloudwatch with getMetricStatistics method (http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatch.html#getMetricStatistics-property). To use this method, you need to specify Dimensions field.

It works fine if I specify dimensions like this:

{Name: 'InstanceId', Value: SOME_INSTANCE_ID_HERE}

But with Elastic Beanstalk you can't rely on InstanceId, because it might create/destroy instances when it needs. So I tried to use different dimension:

{Name: 'InstanceName', Value: NAME_FROM_ELB}

But it doesn't work. I'm trying to find another way/dimension to access ELB metrics.

Upvotes: 3

Views: 619

Answers (1)

sap1ens
sap1ens

Reputation: 2957

Finally got a reply from AWS: there is no way to do it, you have to use InstanceId as a dimension. You can get it dynamically using EC2 metadata.

Upvotes: 2

Related Questions