Add more information to our logs (#35557)

Add more logging to collab in order to help diagnose throughput issues.

IMPORTANT: Do not deploy this PR without pinging me.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Mikayla Maki 2025-08-04 18:37:10 -07:00 committed by GitHub
parent 669c57b45f
commit 6c83a3bcde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 61 additions and 39 deletions

View file

@ -422,8 +422,26 @@ impl Peer {
receiver_id: ConnectionId,
request: T,
) -> impl Future<Output = Result<T::Response>> {
let request_start_time = Instant::now();
let payload_type = T::NAME;
let elapsed_time = move || request_start_time.elapsed().as_millis();
tracing::info!(payload_type, "start forwarding request");
self.request_internal(Some(sender_id), receiver_id, request)
.map_ok(|envelope| envelope.payload)
.inspect_err(move |_| {
tracing::error!(
waiting_for_host_ms = elapsed_time(),
payload_type,
"error forwarding request"
)
})
.inspect_ok(move |_| {
tracing::info!(
waiting_for_host_ms = elapsed_time(),
payload_type,
"finished forwarding request"
)
})
}
fn request_internal<T: RequestMessage>(