Your multi-agent system processes user requests using a pool of five identical worker agents running concurrently. You need to implement distributed tracing to debug cross-agent failures. A request for a complex analysis spawns three workers simultaneously. When the final response is wrong, you need to identify which worker introduced the error. What tracing design is necessary?
Select an answer to reveal the explanation.
Short Explanation
You need distributed tracing with trace and span IDs because it ties each worker's inputs, tool calls, and outputs back to the same user request. That gives you a causal chain from the bad final answer to the worker that introduced the error.
Full Explanation
The OpenTelemetry-style distributed tracing design is correct because distributed tracing with hierarchical trace and span IDs is the standard solution for attribution in concurrent multi-agent systems. The root trace ID correlates all activity for a single user request. Individual span IDs for each worker allow independent logging of inputs, tool calls, and outputs without collision. When the final response is wrong, the orchestrator's log of which worker outputs were used in synthesis provides the causal chain, and the worker's span log reveals what context and tool calls produced that output. Logging each worker's final output with a timestamp is wrong because timestamp comparison only establishes ordering, not causality; it cannot identify which worker's output was used in the final synthesis or what inputs that worker received. Running each worker three times and comparing outputs is wrong because it triples cost and latency and provides consistency measurement, not error attribution; a worker that consistently produces wrong outputs will be consistently wrong in three runs. Adding a confidence score to each worker's response is wrong because self-reported confidence scores are not reliable indicators of error; workers may be confidently wrong, and there is no standard for how different Claude instances calibrate confidence in structured outputs.