@@ -98,7 +98,7 @@ impl VectorResultsProducer {
9898 metrics:: histogram!( "vector_producer.send_batch.duration" , "uptime_region" => region, "histogram" => "timer" ) . record ( start. elapsed ( ) . as_secs_f64 ( ) ) ;
9999 result
100100 } {
101- tracing:: error!( error = ? e, "vector_batch.send_failed" ) ;
101+ tracing:: error!( error = % e, "vector_batch.send_failed" ) ;
102102 }
103103 }
104104
@@ -112,7 +112,7 @@ impl VectorResultsProducer {
112112 )
113113 . await
114114 {
115- tracing:: error!( error = ? e, "final_batch.send_failed" ) ;
115+ tracing:: error!( error = % e, "final_batch.send_failed" ) ;
116116 }
117117 }
118118
@@ -129,7 +129,9 @@ impl ResultsProducer for VectorResultsProducer {
129129 // Send the serialized result to the worker task
130130 if self . sender . send ( json) . is_err ( ) {
131131 tracing:: error!( "event.send_failed_channel_closed" ) ;
132- return Err ( ExtractCodeError :: VectorError ) ;
132+ return Err ( ExtractCodeError :: VectorError {
133+ msg : "send failed channel closed" . to_owned ( ) ,
134+ } ) ;
133135 }
134136 self . pending_items
135137 . fetch_add ( 1 , std:: sync:: atomic:: Ordering :: Relaxed ) ;
@@ -165,7 +167,7 @@ async fn send_batch(
165167 . header ( "Content-Type" , "application/json" )
166168 . body ( body. clone ( ) )
167169 . build ( )
168- . map_err ( |_e | ExtractCodeError :: VectorError ) ?;
170+ . map_err ( |e | ExtractCodeError :: VectorError { msg : e . to_string ( ) } ) ?;
169171 let req_id = req. req_id ( ) . clone ( ) ;
170172 let response = client. execute ( req) . await ;
171173 let stats = hyper:: stats:: consume_request_stats ( req_id) ;
@@ -221,7 +223,9 @@ async fn send_batch(
221223 }
222224 }
223225 if !retry_vector_errors_forever {
224- return Err ( ExtractCodeError :: VectorError ) ;
226+ return Err ( ExtractCodeError :: VectorError {
227+ msg : "retries exhausted" . to_owned ( ) ,
228+ } ) ;
225229 }
226230 sleep ( delay) . await ;
227231 }
0 commit comments