[CXX-978] Add application name and driver version to the MongoDB handshake Created: 18/Jul/16  Updated: 13/Dec/16  Resolved: 19/Oct/16

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: None
Fix Version/s: 3.1.0

Type: New Feature Priority: Major - P3
Reporter: Hannes Magnusson Assignee: David Golden
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DRIVERS-304 MongoDB Handshake protocol Closed
Epic Link: C++11 Driver MongoDB 3.4 Support

 Description   

https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.rst

TL;DR: Every socket connecting to MongoDB MUST issue isMaster announcing itself to the server with the following pseudo document.
There is also new connection URI field appname the user can provide (client.application.name) which the server will write out in its logs and profile entries, making correlating server log entries to respective applications trivial.

isMaster({
    client: {
        /* OPTIONAL. If present, the "name" is REQUIRED */
        application: {
            name: "<string>"
        },
        /* REQUIRED, including all sub fields */
        driver: {
            name: "<string>",
            version: "<string>"
        },
        /* REQUIRED */
        os: {
            type: "<string>",         /* REQUIRED */
            name: "<string>",         /* OPTIONAL */
            architecture: "<string>", /* OPTIONAL */
            version: "<string>"       /* OPTIONAL */
        },
        /* OPTIONAL */
        platform: "<string>"
    }
})


mongoc has a way to set the wrapping driver name and version to MongoDB 3.4+.

The driver should call this function shortly after initializing mongoc



 Comments   
Comment by Githook User [ 29/Nov/16 ]

Author:

{u'name': u'ian boros', u'email': u'ian.boros@10gen.com'}

Message: CXX-978 registers driver name and version

Replaces and closes #509.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/f43fb9b3d907de8c4bbf4ac7355c0d289bf65423

Comment by David Golden [ 19/Oct/16 ]

Ticket was automatically moved to "Needs Triage" when the legacy "Resolved" status was deleted from our workflow template. Moving to Closed status instead.

Comment by Githook User [ 11/Oct/16 ]

Author:

{u'name': u'ian boros', u'email': u'ian.boros@10gen.com'}

Message: CXX-978 registers driver name and version

Replaces and closes #509.
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/f43fb9b3d907de8c4bbf4ac7355c0d289bf65423

Comment by Hannes Magnusson [ 10/Aug/16 ]

Note that the function was renamed before the 1.4.0 final release: https://github.com/mongodb/mongo-c-driver/commit/af286086a0db8c5a2bc66a0b35b1a91d42d520b4

Comment by Ian Boros [ 27/Jul/16 ]

Here's the pull request

https://github.com/mongodb/mongo-cxx-driver/pull/509

Comment by David Golden [ 26/Jul/16 ]

Marking this for 3.1.0-rc0 as that's where we're targeting all 3.4 features. I don't want to merge until after mongoc ships 1.4.0 and until we have a full spec for client metadata and decide on the C++11 driver API for it.

Is there a Github branch we can get a link to, though?

Comment by Hannes Magnusson [ 26/Jul/16 ]

He already did it to make sure the actual thing he created (POC for mongoc) worked for php and c++.
Your choice if you want to/when to merge it

Comment by Andrew Morrow (Inactive) [ 26/Jul/16 ]

ian.boros - I'd expect this to come in via the DRIVERS ticket process under DRIVERS-304. Until that happens, I'd prefer not to ticket it.

Generated at Wed Feb 07 22:00:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.