-
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
fix (inputs/mongodb) readme: correct connection URI #10075
Conversation
Thanks so much for the pull request! |
!signed-cla |
😄 This pull request doesn't change the Telegraf binary size 📦 Looks like new artifacts were built from this PR. Expand this list to get them here! 🐯Artifact URLs |
Thanks for updating the docs! Is there a documentation link you could add where you found this correct URL? Maybe it would help users as well. |
Don't worry about the linter failure in the checks, it checks the entire file not just the parts you changed. I went ahead and resolved the linter issues in a separate PR: #10077 |
I found that correct URL after few days debugging and compiling. Final answer was found somewhere from Golang MongoDB driver source code |
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.
Found this relevant stackoverflow question: https://stackoverflow.com/questions/60765600/why-isnt-connect-option-in-mongo-connection-string-documented
Looks like it is only documented in the MongoDB Go Driver, because its only supported there at the moment: https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo?utm_source=godoc#example-Connect-Direct
Not sure how helpful adding that link to the document would be, just updating the example URL like you did probably will suffice. Thanks!
(cherry picked from commit 62a05b2)
Required for all PRs:
Since v1.19.2 telegraf collects PRIMARY MongoDB metrics via SECONDARY servers by default. By that it means you are not able to get SECONDARY server metrics with default configuration. To fix that,
?connection=direct
should be used in conection string URL. Hopefully that README.md fix saves lot of debugging time in future for other users :))