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

feat: add driverInfo to mongodb component #2779

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Jul 8, 2024

Description

What is changing?

NODE-6240

Hello! 👋🏻 I am adding driverInfo to the MongoClient construction in the MongoDBAtlas component.

What is the motivation for this change?

This field is intended for libraries wrapping the driver to push relevant information to the client metadata sent along with the initial handshake during connection creation. This information can be viewed in server logs to assist with debugging the source of a connection issue. It also provides data for determining what combined use cases the driver is supporting (ex. mongoose).

Ideally, I would like to set the Flowise version in addition to the name, I found a getVersion helper in server/ but not something similar in components/, could I port that over? or is there a preferred way to obtain the version?

@HenryHengZJ
Copy link
Contributor

thanks for the update!

yeah for now you can copy the same function from server, currently components have no access to functions in server

@nbbeeken
Copy link
Contributor Author

Hey @HenryHengZJ, let me know if what I have works, happy to add coverage or make changes to align with the project, thanks for taking a look!

@HenryHengZJ
Copy link
Contributor

that should works, have you tried if you are able to see the version from your side (Mongo)

@nbbeeken
Copy link
Contributor Author

Took me a bit to get setup, but yes!

Here's a sample server log line:

{"t":{"$date":"2024-07-12T16:43:18.650-04:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn1","msg":"client metadata","attr":{"remote":"127.0.0.1:52726","client":"conn1","doc":{"driver":{"name":"nodejs|Flowise","version":"6.3.0|1.8.5"},"platform":"Node.js v18.20.4, LE","os":{"name":"darwin","architecture":"arm64","version":"23.5.0","type":"Darwin"}}}}

The important bit being this part:

{"driver":{"name":"nodejs|Flowise","version":"6.3.0|1.8.5"}

@HenryHengZJ
Copy link
Contributor

awesome thanks @nbbeeken !

@HenryHengZJ HenryHengZJ merged commit 9e88c45 into FlowiseAI:main Jul 15, 2024
2 checks passed
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 this pull request may close these issues.

2 participants