@@ -175,6 +175,7 @@ fn get_fee_token(
175175}
176176
177177impl Service < ChainTypeSvm > {
178+ #[ tracing:: instrument( skip_all, err) ]
178179 async fn get_opportunity_create_for_quote (
179180 & self ,
180181 quote_create : entities:: QuoteCreate ,
@@ -377,7 +378,18 @@ impl Service<ChainTypeSvm> {
377378 }
378379 }
379380
380- #[ tracing:: instrument( skip_all) ]
381+ #[ tracing:: instrument(
382+ skip_all,
383+ err,
384+ fields(
385+ opportunity_id,
386+ auction_id,
387+ searcher_token,
388+ user_token,
389+ bid_ids,
390+ winner_bid
391+ )
392+ ) ]
381393 pub async fn get_quote ( & self , input : GetQuoteInput ) -> Result < entities:: Quote , RestError > {
382394 let referral_fee_info = self
383395 . unwrap_referral_fee_info (
@@ -407,8 +419,11 @@ impl Service<ChainTypeSvm> {
407419 opportunity : opportunity_create,
408420 } )
409421 . await ?;
422+ tracing:: Span :: current ( ) . record ( "opportunity_id" , opportunity. id . to_string ( ) ) ;
410423 let searcher_token = opportunity. sell_tokens [ 0 ] . clone ( ) ;
411424 let user_token = opportunity. buy_tokens [ 0 ] . clone ( ) ;
425+ tracing:: Span :: current ( ) . record ( "searcher_token" , format ! ( "{:?}" , searcher_token) ) ;
426+ tracing:: Span :: current ( ) . record ( "user_token" , format ! ( "{:?}" , user_token) ) ;
412427 if searcher_token. amount == 0 && user_token. amount == 0 {
413428 return Err ( RestError :: BadParameters (
414429 "Token amount cannot be zero" . to_string ( ) ,
@@ -432,7 +447,10 @@ impl Service<ChainTypeSvm> {
432447 permission_key : permission_key_svm. clone ( ) ,
433448 } )
434449 . await ;
435-
450+ tracing:: Span :: current ( ) . record (
451+ "bid_ids" ,
452+ tracing:: field:: display ( crate :: auction:: entities:: BidContainerTracing ( & bids) ) ,
453+ ) ;
436454 let total_bids = if bids. len ( ) < 10 {
437455 bids. len ( ) . to_string ( )
438456 } else {
@@ -467,6 +485,7 @@ impl Service<ChainTypeSvm> {
467485 }
468486 }
469487 let winner_bid = bids. first ( ) . expect ( "failed to get first bid" ) ;
488+ tracing:: Span :: current ( ) . record ( "winner_bid_id" , winner_bid. id . to_string ( ) ) ;
470489
471490 let ( _, swap_instruction) = auction_service
472491 . extract_express_relay_instruction (
@@ -495,6 +514,7 @@ impl Service<ChainTypeSvm> {
495514 let auction = auction_service
496515 . add_auction ( AddAuctionInput { auction } )
497516 . await ?;
517+ tracing:: Span :: current ( ) . record ( "auction_id" , auction. id . to_string ( ) ) ;
498518
499519 // Remove opportunity to prevent further bids
500520 // The handle auction loop will take care of the bids that were submitted late
0 commit comments