-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat: add proxy support for outputs/cloudwatch (#11388) #11399
Conversation
@scholz thanks for looking into this! Would it make sense to completely switch to |
@srebhan : thanks for the suggestion. I will take another look at it asap. |
Ok I removed some code and switched to httpconfig. As said in the issue I am new to go so bear with me for any oddities I may have inserted. Also note that it seems that now timeouts only happen in the httpclient create context and therefore errors looks different (and I think less informative) than before: previously when the proxy host wasnt responding the error was this: now it's this: What would be a good way to improve this? Would it help to reintroduce the timeout variable in the aws struct and define it to some shorter time than the ctx timeout? |
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.
Looks good to me. Thanks for the nice work @scholz!
Regarding the error message, I don't immediately see where the difference comes from, but it might make sense to track it down and fix it for common/http
... Any ideas? If so, it should be a new PR... Thanks again for your contribution!
// Disable logging | ||
options.ClientLogMode = 0 |
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.
It looks like disabling logging is unrelated to this PR's goal of adding proxy http connections. Is this necessary or could we just accept NewFromConfig's default?
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.
Thanks for reviewing. When I did the first iteration, I used the proxy code from the cloudwatch input plugin. That's how that option landed there.
Looking at the docs (https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/logging/ ;https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#ClientLogMode) it seems that the logging is off by default. So its probably safe to remove it.
I will remove it from the code, rebuild and run another check tomorrow. And depending on the result updat the pull request.
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 🥳 This pull request decreases the Telegraf binary size by -2.53 % for linux amd64 (new size: 142.4 MB, nightly size 146.1 MB) 📦 Click here to get additional PR build artifactsArtifact URLs |
Required for all PRs:
resolves #11388
Used proxy code from inputs/cloudwatch to add proxy to outputs cloudwatch.
Did extensive (manual) testing to confirm functionality; will add details to issue.