Problem
Logs lack correlation IDs, making it hard to trace a request through the system:
INFO context_id=abc123 "Executing method"
INFO context_id=abc123 "WASM completed"
// Which request? Multiple concurrent requests have same context_id
Proposed Solution
- Generate request ID at entry point:
use uuid::Uuid;
async fn handle_request(...) {
let request_id = Uuid::new_v4();
let span = tracing::info_span!("request", %request_id, %context_id);
async move {
// All logs within this span include request_id
}.instrument(span).await
}
- Propagate through async boundaries:
tokio::spawn(async move {
// Inherit parent span
}.instrument(tracing::Span::current()));
Acceptance Criteria
Estimated Effort: 2-4 hours
Priority: P1 (Quick Win)
Problem
Logs lack correlation IDs, making it hard to trace a request through the system:
Proposed Solution
Acceptance Criteria
request_idrequest_idappears in all related logsEstimated Effort: 2-4 hours
Priority: P1 (Quick Win)