From dedb633c626156bf851c8db5ba25aa18c6f13fa2 Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Wed, 27 May 2026 12:04:31 +0200 Subject: [PATCH] mr-668: emit info! for graph routing decision `tracing::Span::current().record("graph_id", ...)` in the routing middleware silently no-ops here: no upstream `#[tracing::instrument]` on the handlers declares a `graph_id` field, and `TraceLayer::new_for_http` doesn't either. The recorded value never lands anywhere visible. Replace with an explicit `info!(graph_id = %handle.key.graph_id, "graph routed")` event so operators can grep logs and correlate requests with the active graph. In single mode the value is the sentinel `"default"`. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/omnigraph-server/src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/omnigraph-server/src/lib.rs b/crates/omnigraph-server/src/lib.rs index 13d0244..ee19c01 100644 --- a/crates/omnigraph-server/src/lib.rs +++ b/crates/omnigraph-server/src/lib.rs @@ -1388,10 +1388,12 @@ async fn resolve_graph_handle( } }; - // Record the graph id on the current tracing span for per-request - // observability. Operators correlating logs across requests reach for - // this field; in single mode it's the sentinel `default`. - tracing::Span::current().record("graph_id", handle.key.graph_id.as_str()); + // Per-request observability. `Span::current().record` would silently + // no-op here because no upstream `#[tracing::instrument(...)]` macro + // declares a `graph_id` field; emit an explicit event instead so the + // routing decision actually lands in logs. In single mode the value + // is the sentinel `default`. + info!(graph_id = %handle.key.graph_id, "graph routed"); request.extensions_mut().insert(handle); Ok(next.run(request).await)