fix(log): adding span metadata to tokio spawned futures (#4118)

This commit is contained in:
Shankar Singh C
2024-03-27 11:46:22 +05:30
committed by GitHub
parent 7f5ad621a1
commit 070622125f
13 changed files with 115 additions and 84 deletions

View File

@ -31,6 +31,7 @@ use actix_web::{
};
use http::StatusCode;
use hyperswitch_interfaces::secrets_interface::secret_state::SecuredSecret;
use router_env::tracing::Instrument;
use routes::AppState;
use storage_impl::errors::ApplicationResult;
use tokio::sync::{mpsc, oneshot};
@ -192,7 +193,7 @@ pub async fn start_server(conf: settings::Settings<SecuredSecret>) -> Applicatio
.workers(server.workers)
.shutdown_timeout(server.shutdown_timeout)
.run();
tokio::spawn(receiver_for_error(rx, server.handle()));
let _task_handle = tokio::spawn(receiver_for_error(rx, server.handle()).in_current_span());
Ok(server)
}