Repository navigation
Make round trip time accessible through streaminfo - #24656
Conversation
Signed-off-by: AlanDiaz <[email protected]>
Signed-off-by: AlanDiaz <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
Resolving merge conflict Signed-off-by: AlanDiaz <[email protected]>
ggreenway
left a comment
There was a problem hiding this comment.
I think it makes sense to expose this, but I'm not sure if it's a good idea to latch the value right after the connection is setup. At least on linux, the TCP_INFO syscall that provides this provides a smoothed RTT, and it may not be very smoothed right after connection setup (very few round trips at that point). Also, the RTT can vary over the life of the connection. If this is being logged on a specific http connection, we'd want to sample the RTT near-in-time to when that particular request happened. Maybe it would make more sense to latch this in Http::StreamDecoderFilter::onStreamComplete() or near that time.
/wait-any
| virtual void setJA3Hash(const absl::string_view ja3_hash) PURE; | ||
|
|
||
| /** | ||
| * @param milliseconds of round trip time of previous connection |
It makes sense. The eventual goal is to log the RTT in the access log. I agree that ideally it should be done at the end of the HTTP request or TCP connection, right before access log is to be emitted. We will need to deal with the fact that H/1 requests can be framed be connection closure and at this point RTT may not be available but this may be too far of an edge case. Would it be ok if these additional samples are implemented in a follow-up PR, to make it easier to iterate on this change? |
I think a lot of the code in this PR will have to be changed/reverted to get to that solution, so if we agree that we should change to sampling sometime during the request (beginning or end of request probably) then I'm not sure it makes sense to merge this as-is. |
Hmm, do you have a different approach for making RTT accessible in StreamInfo? I did not think we will need to change much, since both HCM or FilterManager or TCP proxy have access to the Network::Connection that had |
I agree that accessing it via stream_info through the |
Signed-off-by: AlanDiaz <[email protected]>
| stream.completeRequest(); | ||
|
|
||
| // Set roundtrip time in connectionInfoSetter before OnStreamComplete | ||
| absl::optional<std::chrono::milliseconds> t = read_callbacks_->connection().lastRoundTripTime(); |
There was a problem hiding this comment.
Please add a test that validates this happens before log() is called.
Signed-off-by: AlanDiaz <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: AlanDiaz <[email protected]>
Signed-off-by: AlanDiaz <[email protected]>
Signed-off-by: AlanDiaz [email protected]
Commit Message: Make round trip time accessible through stream info
Additional Description: Make the last round trip time of the previous handshake accessible through stream info. This will allow us to make it accessible in access logs,
Risk Level: Low
Testing: Added an integration test in filter integration test that adds roundtriptime to the header and checks if it exists
Docs Changes: NA
Release Notes: NA
Platform Specific Features: NA
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]