-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Monitoring
-
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.