From 25353da8b8bef71f0052b2d71572364492c56ccf Mon Sep 17 00:00:00 2001 From: Lambda Date: Fri, 24 May 2024 16:20:00 +0000 Subject: [PATCH] sending.rs: record handler errors using Display --- src/service/sending.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/service/sending.rs b/src/service/sending.rs index 307824af..03593208 100644 --- a/src/service/sending.rs +++ b/src/service/sending.rs @@ -232,11 +232,12 @@ impl Service { } #[tracing::instrument( - skip(self, handler_span, current_transaction_status), + skip(self, result, handler_span, current_transaction_status), fields( current_status = ?current_transaction_status.get( &destination ), + error, ), )] fn handle_response( @@ -251,6 +252,10 @@ impl Service { // clone() is required for the relationship to show up in jaeger Span::current().follows_from(handler_span.clone()); + if let Err(e) = &result { + Span::current().record("error", e.to_string()); + } + match result { Ok(()) => { self.db.delete_all_active_requests_for(&destination)?;