-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call GetMetricData api per region instead of per instance #11882
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments. From what I understand you launch a bunch of metric queries (for every EC2 instance) with the same call.
I'm wondering if it's possible to launch a query for all instance ids, without setting dimensions in it?
@exekias Sorry I definitely need to put in more explanation here. So the goal for this PR is to reduce the number of I guess one more thing we can do is to remove the for loop for regions for |
This is already an improvement, I'm ok to getting this in and experiment more later. I want to play a little bit with the cloudwatch metricset for better understanding. Left a comment, let's tackle that and this is ready to go |
I spent some more time testing if we can make cloudwatch api calls without specifying ec2 instanceID. Unfortunately the answer is no. I also checked if we can make cloudwatch api calls without region specified, the answer is no too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing the additional testing!
I think we can skip backport for this one, as it's not fixing a critical bug but improving the behavior |
In current ec2 metricset code, we are constructing metricDataQueries per region per instance for GetMetricData cloudwatch api call. Because we have some metadata from DescribeInstances api call for each instance to add into each event. It will be more efficient/cheaper to improve ec2 metricset to construct metricDataQueries per region but not per instance.
closes #11820