Move timing fields into span (#35833)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-08-07 16:07:33 -07:00 committed by GitHub
parent 50482a6bc2
commit 913e9adf90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 149 additions and 122 deletions

View file

@ -422,23 +422,8 @@ impl Peer {
receiver_id: ConnectionId,
request: T,
) -> impl Future<Output = Result<T::Response>> {
let request_start_time = Instant::now();
let elapsed_time = move || request_start_time.elapsed().as_millis();
tracing::info!("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(),
"error forwarding request"
)
})
.inspect_ok(move |_| {
tracing::info!(
waiting_for_host_ms = elapsed_time(),
"finished forwarding request"
)
})
}
fn request_internal<T: RequestMessage>(