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

config: set default region for EC2 SD #2789

Merged
merged 2 commits into from
Jun 12, 2017

Conversation

mtanda
Copy link
Contributor

@mtanda mtanda commented Jun 1, 2017

If Prometheus is running on EC2, most of the case region might be same region where Prometheus is running.
I want to set default region for the case.

@mtanda mtanda force-pushed the aws_default_region branch from f18fa37 to a1ddab4 Compare June 1, 2017 16:40
@mtanda
Copy link
Contributor Author

mtanda commented Jun 6, 2017

I forgot to mention maintainers.

@brian-brazil Would you check this PR?

Copy link
Contributor

@fabxc fabxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change seems fine to me in general if that's how AWS clients work with regions in general.

config/config.go Outdated
@@ -1126,7 +1128,13 @@ func (c *EC2SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
return err
}
if c.Region == "" {
return fmt.Errorf("EC2 SD configuration requires a region")
sess := session.Must(session.NewSession())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like this could panic if something goes wrong. Better to check potential errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtanda
Copy link
Contributor Author

mtanda commented Jun 6, 2017

Change seems fine to me in general if that's how AWS clients work with regions in general.

I think..., the aws-sdk-go should assure that.

@mtanda
Copy link
Contributor Author

mtanda commented Jun 12, 2017

@fabxc @brian-brazil How I can proceed this PR?
I should fix something?

@fabxc
Copy link
Contributor

fabxc commented Jun 12, 2017

My bad, looks all good. Thanks!

@fabxc fabxc merged commit 9ba61df into prometheus:master Jun 12, 2017
@mtanda
Copy link
Contributor Author

mtanda commented Jun 12, 2017

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants