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

Metrics are not sending to specific region #281

Closed
jtran0721 opened this issue May 21, 2024 · 1 comment · Fixed by #282
Closed

Metrics are not sending to specific region #281

jtran0721 opened this issue May 21, 2024 · 1 comment · Fixed by #282

Comments

@jtran0721
Copy link

Hi, I would like some help with sending metrics to different region rather than us-east-1. I ran this command

docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_DEFAULT_REGION="ap-southeast-1" --rm bk-agent-metrics -token $token -interval 30s -queue mac:build -backend cloudwatch -cloudwatch-region "ap-southeast-1”

I couldn't see metrics in "ap-southeast-1" but they exist in "us-east-1". Do you know why is this happening?

Thank you

@DrJosh9000
Copy link
Contributor

Hi @jtran0721, I think you found a bug!

case "cloudwatch":
region := *clwRegion
if envRegion := os.Getenv(`AWS_REGION`); region == "" && envRegion != "" {
region = envRegion
} else {
region = `us-east-1`
}

Since you're passing -cloudwatch-region, region != "", so the code ends up in the else, which overrides it with us-east-1. That's pretty clearly wrong, and has been since that code was added!

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 a pull request may close this issue.

2 participants