[GODRIVER-515] Add Context to CommandMonitor Events Created: 31/Jul/18 Updated: 28/Oct/23 Resolved: 06/Sep/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Monitoring |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.13 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Caleb Doxsey | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
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 { type CommandStartedEvent struct { The event would become: type CommandStartedEvent struct { 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. |
| Comments |
| Comment by Rathi Gnanasekaran [ 04/Sep/18 ] |
|
|
| Comment by Caleb Doxsey [ 08/Aug/18 ] |
|
I updated the PR to pass the context as the first argument to each callback function. |
| Comment by Caleb Doxsey [ 08/Aug/18 ] |
|
Hi Kris, Sure I can change it. I'll update my PR. Thanks,
|
| Comment by Kristofer Brandow (Inactive) [ 08/Aug/18 ] |
|
Hi dd-caleb, We've been thinking about how to incorporate APM information into the driver. I dislike placing a context on a struct, but how about passing it as a parameter to the functions? I think that would align better with how Go usually wants context.Context instances to be handled. --Kris |