-
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 settings for go sql.DB settings #11551
Conversation
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 @reimda for the fix. I only have a comment about option naming to make it consistent with the sql
input plugin...
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 jumping on this one!
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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 @reimda! Looks good to me.
resolves #11498
The golang SQL API exposes a few settings related to pooled connections. (see https://pkg.go.dev/database/sql#DB) These settings need to be changed for some SQL drivers to connect reliably to some databases.
This PR adds telegraf settings that mirror the golang sql settings. This allows users to set them through telegraf.conf and be able to connect to databases that require specific settings.
The golang sql settings have defaults and since telegraf didn't set the settings, it was using the defaults. I mirrored the default values in the new telegraf settings. This should make the sql output behave the same as before.