[DRIVERS-2106] Include local ephemeral port in APM command callbacks Created: 06/Jul/16 Updated: 08/Mar/23 |
|
| Status: | Backlog |
| Project: | Drivers |
| Component/s: | Command Logging and Monitoring |
| Fix Version/s: | None |
| Type: | Spec Change | Priority: | Minor - P4 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Driver Changes: | Needed | ||||||||||||||||
| Description |
|
Requested by James Blackburn in Python birds of feather session at MongoDB World 2016. (Notes here.) Useful to correlate APM callback invocations on the client with server log messages. |
| Comments |
| Comment by Kevin Albertson [ 17/Aug/21 ] |
We are not planning to expose the ephemeral server port because exposing the server connectionID on command monitoring events seems redundant. The lsid already is available in the full command exposed in the CommandStartedEvent. We could consider adding the lsid to CommandFailedEvent and CommandSucceededEvent, but we do not plan to do this on DRIVERS-1141. DRIVERS-1141 proposes only exposing the server-side connectionID to satisfy the requirements of MHOUSE-2311. |
| Comment by Jeffrey Yemin [ 22/Jan/18 ] |
|
The lsid is useful but isn't as ubiquitous in server log files as the connectionId. |
| Comment by Bernie Hackett [ 22/Jan/18 ] |
|
I think we can do all three. Ephemeral port is always available and can be included now, lsid for MongoDB 3.6+, and add connectionId once |
| Comment by A. Jesse Jiryu Davis [ 22/Jan/18 ] |
|
We can now log the logical session id ("lsid") in APM callbacks. It should be included by default in the command-started event data with no special work from us. Once all drivers and servers are upgraded, does lsid provide the functionality we wanted from ephemeral port or connectionId? |
| Comment by Jeffrey Yemin [ 22/Jan/18 ] |
|
Even more useful would be to include the server's connection id, as that's included in every log message, whereas the ephemeral port is only included in the log message for connection establishment. Given connection pooling in drivers, that log message has often rolled off the current log that is provided to TSEs. The Java driver both logs this and includes it in command monitoring, and it's saved TSEs' time more than once. See also |