Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2575

Add collection name to all command logging and monitoring events

    • Needed

      Summary

      Add collection name (if available) to all command logging and monitoring events.

      Currently, no command events or logs contain the collection name. That can make using the command logging and monitoring events much more difficult if you need access to information that is spread across multiple events. For example, to use the duration values in CommandSucceededEvent or CommandFailedEvent to record metrics on per-collection command latencies, you need to manually extract the collection name from the command document. A much better experience is to include the database and collection names (if available) on all events or logs, making them individually much more useful.

      Inspired by a recent community forum post asking how to get the collection name from a command monitoring event. Also, see a similar request in GODRIVER-1371.

      Motivation

      Who is the affected end user?

      People using the command logging and monitoring feature who need access to collection name as well as the information in a "succeeded" or "failed" command event.

      How does this affect the end user?

      They must write a significant amount of logic to correlate events and extract information from raw command or reply BSON documents, requiring knowledge of the MongoDB wire protocol command structure.

      How likely is it that this problem or use case will occur?

      Based on the frequency of user requests, not many users are trying to use command monitoring and logging as described. However, that low frequency of requests may be due to users finding another way around due the high difficulty of correlating and extracting collection name.

      If the problem does occur, what are the consequences and how severe are they?

      Users may have to spend a significant amount of time to correlate and extract collection name. Correlating and extracting collection name via the command logging and monitoring APIs is significantly more error prone than adding the information while sending an operation, leading to possible bugs in client code.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      No.

      Acceptance Criteria

      A collectionName is specified on the CommandStartedEvent, CommandSucceededEvent, and CommandFailedEvent (and corresponding log messages) in the Command Logging and Monitoring spec.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: