google/cloudprober

Failed to publish metrics to cloudwatch: MissingRegion: could not find region configuration

TPXP opened this issue · 3 comments

TPXP commented

Describe the bug
When setting up CloudProber on an AWS instance with th IAM role for publishing metrics to CloudWatch, metrics are not created due to the following error

cloudprober[136487]: E1013 13:47:55.748736  136487 cloudwatch.go:112] [cloudprober.cloudwatch] Failed to publish metrics to cloudwatch: MissingRegion: could not find region configuration

Cloudprober Version

# cloudprober -version
v0.11.3

To Reproduce
Steps to reproduce the behavior:

  1. Create a VM in ElasticSearch with an IAM policy allowing it to push metrics in CloudWatch
  2. Start cloudprober

Additional context
This issue only occurs when using an IAM role for an instance since other AWS credentials specify the region (see https://docs.aws.amazon.com/sdk-for-go/api/aws/session/). A workaround is to set the region in an environment variable: AWS_REGION=ap-northeast-1.

We may want to add configuration options to pass the AWS credentials and region from CloudProber's configuration file though, at least add a note in the documentation.

Thanks, I can pick this up, over next few days

This should now be fixed through #672. @TPXP, can you give it a try and reopen this issue if it is not fixed for you yet.