Skip to content
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

Add regions parameter in aws module config #11956

Merged
merged 10 commits into from
May 2, 2019
Merged

Add regions parameter in aws module config #11956

merged 10 commits into from
May 2, 2019

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Apr 26, 2019

This PR is to add regions in config for aws module. With regions, we give users the ability to specify what are the regions they want to collect cloudwatch metrics from for different AWS services. regions is optional, when there is no regions in the config, the code will get a full list of AWS regions and loop through all of them.

Please see #11932 for more details.

@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review April 26, 2019 20:03
@kaiyan-sheng kaiyan-sheng requested review from a team as code owners April 26, 2019 20:03
@kaiyan-sheng kaiyan-sheng self-assigned this Apr 26, 2019
@kaiyan-sheng kaiyan-sheng added Team:Integrations Label for the Integrations team Metricbeat Metricbeat labels Apr 26, 2019
@kaiyan-sheng
Copy link
Contributor Author

One concern I have is, will the change consider a breaking change? If so, we can keep the original config default_region and add regions on top of that.

@exekias
Copy link
Contributor

exekias commented Apr 29, 2019

This is a breaking change, IMHO it should be ok because we offer a new way to configure it. In any case it should be also added to the breaking changes list in the changelog

@jsoriano
Copy link
Member

This is a breaking change, IMHO it should be ok because we offer a new way to configure it. In any case it should be also added to the breaking changes list in the changelog

Could we keep the old option for backwards compatibility as a synonym of setting regions to a single value?

@exekias
Copy link
Contributor

exekias commented Apr 29, 2019

@kaiyan-sheng to comment here, but If I understood this correctly, default_region was something different from setting a single region. Default region is only used to get the list of regions, we then iterate over them to fetch metrics.

It's more about initialization. I guess it's not a very important setting, although it may be needed in some cases, hence the fallback to take the first region from the list?

@kaiyan-sheng
Copy link
Contributor Author

@kaiyan-sheng to comment here, but If I understood this correctly, default_region was something different from setting a single region. Default region is only used to get the list of regions, we then iterate over them to fetch metrics.

It's more about initialization. I guess it's not a very important setting, although it may be needed in some cases, hence the fallback to take the first region from the list?

@exekias Yes, default_region is an optional parameter in config currently and it's only for getting the full list of regions from AWS. It just need a value to start the first AWS query and it doesn't matter which region it's default to. But we do need a default value before DescribeRegions API call can be made.

@kaiyan-sheng
Copy link
Contributor Author

This is a breaking change, IMHO it should be ok because we offer a new way to configure it. In any case it should be also added to the breaking changes list in the changelog

Could we keep the old option for backwards compatibility as a synonym of setting regions to a single value?

@jsoriano Do you mean keep default_region in the config and if user set default_region, then only collect metrics from that default_region? That's also a changing behavior from previous version hmmm

@kaiyan-sheng
Copy link
Contributor Author

jenkins, test this please

@jsoriano
Copy link
Member

This is a breaking change, IMHO it should be ok because we offer a new way to configure it. In any case it should be also added to the breaking changes list in the changelog

Could we keep the old option for backwards compatibility as a synonym of setting regions to a single value?

@jsoriano Do you mean keep default_region in the config and if user set default_region, then only collect metrics from that default_region? That's also a changing behavior from previous version hmmm

I misinterpreted default_region. I wanted to ask if keeping both options is a possibility, so we don't introduce a breaking change.
Now, understanding better default_region, we may still want to keep it to select a region to do this first API call.

@kaiyan-sheng
Copy link
Contributor Author

@exekias @jsoriano I added default_region back to the config and moved changelog from breaking changes session to added session. Originally I was thinking to remove default_region completely in the future release. But looking at https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html, it might be good to keep default_region just to be consistent with aws cli configuration example.

@kaiyan-sheng kaiyan-sheng merged commit a23e4d0 into elastic:master May 2, 2019
@kaiyan-sheng kaiyan-sheng deleted the add_regions_config branch May 2, 2019 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants