Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11246

Documenting support for mongo shell to send client.application.name in initial isMaster request

    XMLWordPrintableJSON

Details

    • 0.7
    • KANBAN BUCKET
    • true

    Description

      Documentation Request Summary:

      This change now has the mongo shell support setting a custom appname parameter. So now doing:

      mongo mongodb://localhost/test?appname=MyApp
      

      Sets a custom appname which appears in db.currentOp(), db.system.profile when profiling is enabled, and in the logs.

      Drivers already support this, but we have documented that the shell will always specify the appname as "MongoDB Shell" here: https://docs.mongodb.com/manual/reference/command/currentOp/#iddup.currentOp.appName
      and here: https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.appName
      This was correct before this change, but now that is only the default.

      Also I think we should add it to the connection string reference: https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options to add this under "Miscellaneous Configuration"

      Engineering Ticket Description:

      This likely involves adding an additional parameter to the Mongo object constructor and forwarding the metadata to the underlying DBClient instance.

      Connection handshake

      The isMaster handshake, as of MongoDB 3.4, supports a new argument, client, provided as a BSON object. This object has the following structure::

      {
          isMaster: 1,
          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>"
          }
      }
      

      https://github.com/mongodb/specifications/blob/5499fd336aaa8d91bdd7cb285fa661f512be72dd/source/mongodb-handshake/handshake.rst#connection-handshake

      Attachments

        Issue Links

          Activity

            People

              allison.moore@mongodb.com Allison Reinheimer Moore
              kay.kim@mongodb.com Kay Kim (Inactive)
              Jess Mokrzecki Jess Mokrzecki
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                4 years, 41 weeks, 4 days ago