observe-trace
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseObserve Trace
观测追踪
Collect distributed trace spans for a task and build a visual trace tree showing the execution flow, timing, and bottlenecks.
为任务收集分布式追踪跨度(spans),并构建可视化追踪树以展示执行流程、时间开销和瓶颈。
When to use
使用场景
When you need to understand how a task was executed across agents -- which spans ran, how long each took, where bottlenecks occurred, and how agents coordinated.
当你需要了解任务在多个Agent之间的执行方式时——包括哪些跨度(spans)已运行、每个跨度耗时多久、瓶颈出现在何处,以及Agent之间如何协作。
Steps
操作步骤
- Collect spans -- call to retrieve all spans matching the
mcp__claude-flow__agentdb_hierarchical-recallfrom the<task-id>namespaceobservability - Build trace tree -- organize spans into a parent-child hierarchy using references, with the root span at the top
parentSpanId - Calculate timing -- for each span, compute duration (endTime - startTime), and identify the critical path (longest chain of sequential spans)
- Identify bottlenecks -- flag spans where duration exceeds the p95 for that operation type, or where gaps between spans suggest idle time
- Synthesize -- call to combine span metadata into a narrative summary of the execution flow
mcp__claude-flow__agentdb_context-synthesize - Report -- display the trace tree with: span name, agent, duration, status (OK/ERROR), and bottleneck flag; include total trace duration and critical path duration
- 收集跨度(spans)——调用从
mcp__claude-flow__agentdb_hierarchical-recall命名空间中检索所有匹配observability的跨度<task-id> - 构建追踪树——利用引用将跨度组织成父子层级结构,根跨度位于顶部
parentSpanId - 计算时间开销——为每个跨度计算持续时间(endTime - startTime),并识别关键路径(最长的连续跨度链)
- 识别瓶颈——标记持续时间超过该操作类型p95值的跨度,或跨度之间存在间隙表明空闲时间的情况
- 合成总结——调用将跨度元数据合并为执行流程的叙述性摘要
mcp__claude-flow__agentdb_context-synthesize - 生成报告——展示包含以下信息的追踪树:跨度名称、Agent、持续时间、状态(正常/错误)和瓶颈标记;同时包含总追踪持续时间和关键路径持续时间
CLI alternative
CLI替代方案
bash
npx @claude-flow/cli@latest memory search --query "trace spans for task TASK_ID" --namespace observabilitybash
npx @claude-flow/cli@latest memory search --query "trace spans for task TASK_ID" --namespace observability