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

fix (inputs/mongodb) readme: correct connection URI #10075

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

anti32
Copy link
Contributor

@anti32 anti32 commented Nov 8, 2021

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 :))

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Nov 8, 2021

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Nov 8, 2021
@anti32
Copy link
Contributor Author

anti32 commented Nov 8, 2021

!signed-cla

@sspaink
Copy link
Contributor

sspaink commented Nov 8, 2021

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.

@sspaink
Copy link
Contributor

sspaink commented Nov 8, 2021

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

@anti32
Copy link
Contributor Author

anti32 commented Nov 8, 2021

I found that correct URL after few days debugging and compiling. Final answer was found somewhere from Golang MongoDB driver source code

Copy link
Contributor

@sspaink sspaink left a 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!

@sspaink sspaink merged commit 62a05b2 into influxdata:master Nov 10, 2021
powersj pushed a commit that referenced this pull request Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants