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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With