Add tokio task id to router request span fields.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-02-04 08:06:52 +00:00
parent 36d13619dd
commit ec1359ea5e

View File

@@ -10,7 +10,7 @@ use axum::{
}; };
use futures::FutureExt; use futures::FutureExt;
use http::{Method, StatusCode, Uri}; use http::{Method, StatusCode, Uri};
use tokio::time::sleep; use tokio::{task, time::sleep};
use tracing::Span; use tracing::Span;
use tuwunel_core::{Result, debug, debug_error, debug_warn, err, error, trace}; use tuwunel_core::{Result, debug, debug_error, debug_warn, err, error, trace};
use tuwunel_service::Services; use tuwunel_service::Services;
@@ -21,6 +21,7 @@ use tuwunel_service::Services;
skip_all, skip_all,
err(Debug, level = "debug") err(Debug, level = "debug")
fields( fields(
task = %task::id(),
id = %services id = %services
.server .server
.metrics .metrics
@@ -72,6 +73,9 @@ pub(crate) async fn handle(
parent = parent, parent = parent,
skip_all, skip_all,
ret(level = "trace"), ret(level = "trace"),
fields(
task = %task::id(),
)
)] )]
#[cfg_attr(not(debug_assertions), expect(unused_variables))] #[cfg_attr(not(debug_assertions), expect(unused_variables))]
async fn execute( async fn execute(