[DRIVERS-2613] Logging if connection establishment exceeds a given threshold Created: 24/Apr/23  Updated: 26/Apr/23

Status: Backlog
Project: Drivers
Component/s: CMAP, Logging
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Alex Bevilacqua Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Driver Changes: Needed

 Description   

Something similar was introduced for the MongoDB Server with SERVER-64964, however this change was limited to only the server's components. Drivers could also introduce a similar feature to capture and display information when connection establishment exceeds a set threshold.

For example, the server introduced slowConnectionThresholdMillis which defaults to 100ms, and when exceeded will output a log entry that contains details about:

  • DNS Resolution Time
  • TCP Connection Time
  • TLS Handshake Time
  • Authentication Time


 Comments   
Comment by Bailey Pearson [ 26/Apr/23 ]

Adding connection establishment metrics to our CMAP events and logging events seems like a good idea.  We can attach connection establishment information to `ConnectionReady` events.

A few open questions:

  • Which portions of connection establishment can drivers measure and which should they measure?
  • Should this behavior configurable by a flag or should we always attach connection establishment metrics?
Comment by Jeffrey Yemin [ 24/Apr/23 ]

Just FYI for some socket API's (e.g. Java) the driver can't measure TCP handshake time independent of TLS handshake time, because TLS is abstracted from the calling code behind a common API.

Generated at Thu Feb 08 08:26:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.