Skip to content

feat: add MongoDB driver handshake metadata - #1937

Open
alexbevi wants to merge 1 commit into
docarray:mainfrom
alexbevi:add-client-metadata
Open

feat: add MongoDB driver handshake metadata#1937
alexbevi wants to merge 1 commit into
docarray:mainfrom
alexbevi:add-client-metadata

Conversation

@alexbevi

Copy link
Copy Markdown

Activates the pre-existing driver=DriverInfo(...) call in _connect_to_mongodb_atlas, so that MongoDB server-side telemetry (db.currentOp, Atlas dashboards, mongos/d logs) can identify traffic from DocArray applications.

On first connection, mongod emits a client metadata log entry. With this change the entry will look like:

{"t":{"$date":"2026-07-21T09:15:42.123+00:00"},"s":"I","c":"NETWORK","id":51800,"ctx":"conn1","msg":"client metadata","attr":{"remote":"192.168.1.10:54321","client":"conn1","negotiatedCompressors":[],"doc":{"driver":{"name":"PyMongo|DocArray","version":"4.9.2|0.41.0"},"os":{"type":"Darwin","name":"Darwin","architecture":"arm64","version":"26.5.2"},"platform":"CPython 3.10.3.final.0"}}}

The PyMongo|DocArray naming follows the MongoDB handshake specification for layered driver attribution.

Signed-off-by: Alex Bevilacqua <alex@alexbevi.com>
@alexbevi
alexbevi force-pushed the add-client-metadata branch from a66142d to 196a6bb Compare July 21, 2026 16:23
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.

1 participant