Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-515

Add Context to CommandMonitor Events

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.0.13
    • Affects Version/s: None
    • Component/s: Monitoring
    • Labels:
      None

      I'm working on adding Datadog APM tracing support to this library. The CommandMonitor looked like the easiest way to hook into the library. Would it be possible to add the relevant context to the CommandMonitor:

      type CommandMonitor struct {
          Started func(*CommandStartedEvent)
          Succeeded func(*CommandSucceededEvent)
          Failed func(*CommandFailedEvent)
      }

      type CommandStartedEvent struct {
          Command *bson.Document
          DatabaseName string
          CommandName string
          RequestID int64
          ConnectionID string
      }

      The event would become:

      type CommandStartedEvent struct {
          Context context.Context
          Command *bson.Document
          DatabaseName string
          CommandName string
          RequestID int64
          ConnectionID string
      }

      Passing the context through would help us to tie trace spans together.

      I believe this change is relatively minor, and I could work on a PR to implement it.

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            dd-caleb Caleb Doxsey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: