@@ -268,15 +268,16 @@ where
268
268
move |s| {
269
269
Runner :: new ( scheduler ( s) , move |request| {
270
270
let request = request. clone ( ) ;
271
+ let reconciler_span = info_span ! ( "reconciling object" , "object.ref" = %request. obj_ref, object. reason = tracing:: field:: Empty ) ;
271
272
match store. get ( & request. obj_ref ) {
272
273
Some ( obj) => {
273
- let reconciler_span = info_span ! ( "reconciling object" , "object.ref" = %request . obj_ref , object . reason = % request. reason) ;
274
+ reconciler_span. record ( " object.reason" , & tracing :: field :: display ( & request. reason ) ) ;
274
275
reconciler_span. in_scope ( || reconciler ( obj, context. clone ( ) ) )
275
276
. into_future ( )
276
- . instrument ( reconciler_span)
277
+ . instrument ( reconciler_span. clone ( ) )
277
278
// Reconciler errors are OK from the applier's PoV, we need to apply the error policy
278
279
// to them separately
279
- . map ( |res| Ok ( ( request. obj_ref , res) ) )
280
+ . map ( |res| Ok ( ( request. obj_ref , res, reconciler_span ) ) )
280
281
. left_future ( )
281
282
} ,
282
283
None => future:: err (
@@ -295,14 +296,14 @@ where
295
296
)
296
297
. on_complete ( async { tracing:: debug!( "applier runner-merge terminated" ) } )
297
298
// finally, for each completed reconcile call:
298
- . and_then ( move |( obj_ref, reconciler_result) | {
299
+ . and_then ( move |( obj_ref, reconciler_result, reconciler_span ) | {
299
300
let ( ReconcilerAction { requeue_after } , requeue_reason) = match & reconciler_result {
300
301
Ok ( action) =>
301
302
// do what user told us
302
303
( action. clone ( ) , ReconcileReason :: ReconcilerRequestedRetry ) ,
303
304
Err ( err) =>
304
305
// reconciler fn call failed
305
- ( error_policy ( err, err_context. clone ( ) ) , ReconcileReason :: ErrorPolicyRequestedRetry ) ,
306
+ ( reconciler_span . in_scope ( || error_policy ( err, err_context. clone ( ) ) ) , ReconcileReason :: ErrorPolicyRequestedRetry ) ,
306
307
} ;
307
308
let mut scheduler_tx = scheduler_tx. clone ( ) ;
308
309
async move {
@@ -486,12 +487,11 @@ where
486
487
/// To watch the full set of `Child` objects in the given `Api` scope, you can use [`ListParams::default`].
487
488
///
488
489
/// [`OwnerReference`]: k8s_openapi::apimachinery::pkg::apis::meta::v1::OwnerReference
489
- pub fn owns < Child : Clone + Resource < DynamicType = ( ) > + DeserializeOwned + Debug + Send + ' static > (
490
+ pub fn owns < Child : Clone + Resource < DynamicType = ( ) > + DeserializeOwned + Debug + Send + ' static > (
490
491
self ,
491
492
api : Api < Child > ,
492
493
lp : ListParams ,
493
- ) -> Self
494
- {
494
+ ) -> Self {
495
495
self . owns_with ( api, ( ) , lp)
496
496
}
497
497
@@ -529,7 +529,7 @@ where
529
529
/// to watch - in the Api's configured scope - and run through the custom mapper.
530
530
/// To watch the full set of `Watched` objects in given the `Api` scope, you can use [`ListParams::default`].
531
531
pub fn watches <
532
- Other : Clone + Resource < DynamicType = ( ) > + DeserializeOwned + Debug + Send + ' static ,
532
+ Other : Clone + Resource < DynamicType = ( ) > + DeserializeOwned + Debug + Send + ' static ,
533
533
I : ' static + IntoIterator < Item = ObjectRef < K > > ,
534
534
> (
535
535
self ,
0 commit comments