@@ -6,7 +6,7 @@ use tokio::{
6
6
sync:: { mpsc, oneshot} ,
7
7
task,
8
8
} ;
9
- use tracing:: warn;
9
+ use tracing:: { info , warn, Instrument as _ } ;
10
10
11
11
pub struct Database {
12
12
db : Connection ,
@@ -172,7 +172,11 @@ impl Handle {
172
172
. drop_error_details ( )
173
173
. context ( SendStartRequestSnafu ) ?;
174
174
175
- rx. await . context ( RecvStartRequestSnafu ) ?. map_err ( Into :: into)
175
+ let id = rx. await . context ( RecvStartRequestSnafu ) ??;
176
+
177
+ info ! ( request_id = id. 0 , "Started request" ) ;
178
+
179
+ Ok ( id)
176
180
}
177
181
178
182
async fn attempt_start_request (
@@ -198,7 +202,11 @@ impl Handle {
198
202
. drop_error_details ( )
199
203
. context ( SendEndRequestSnafu ) ?;
200
204
201
- rx. await . context ( RecvEndRequestSnafu ) ?. map_err ( Into :: into)
205
+ rx. await . context ( RecvEndRequestSnafu ) ??;
206
+
207
+ info ! ( request_id = id. 0 , "Ended request" ) ;
208
+
209
+ Ok ( ( ) )
202
210
}
203
211
204
212
async fn attempt_end_request ( & self , id : Id , how : How ) {
@@ -245,7 +253,7 @@ impl Drop for EndGuardInner {
245
253
let Self ( id, how, ref mut handle) = * self ;
246
254
if let Ok ( h) = tokio:: runtime:: Handle :: try_current ( ) {
247
255
if let Some ( handle) = handle. take ( ) {
248
- h. spawn ( async move { handle. attempt_end_request ( id, how) . await } ) ;
256
+ h. spawn ( async move { handle. attempt_end_request ( id, how) . await } . in_current_span ( ) ) ;
249
257
}
250
258
}
251
259
}
0 commit comments