Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-978

Add application name and driver version to the MongoDB handshake

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.0
    • Affects Version/s: None
    • Component/s: Implementation
    • Labels:
      None

      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

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: