Add unique id counter to request tracing span. (fixes #112)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-22 21:11:25 +00:00
parent ed0b3c764e
commit cbe34affa3
2 changed files with 17 additions and 4 deletions

View File

@@ -15,7 +15,18 @@ use tracing::Span;
use tuwunel_core::{Result, debug, debug_error, debug_warn, err, error, trace};
use tuwunel_service::Services;
#[tracing::instrument(name = "request", level = "debug", skip_all)]
#[tracing::instrument(
name = "request",
level = "debug",
skip_all,
fields(
id = %services
.server
.metrics
.requests_count
.fetch_add(1, Ordering::Relaxed)
)
)]
pub(crate) async fn handle(
State(services): State<Arc<Services>>,
req: http::Request<axum::body::Body>,