
书名:《Agent Runtime 工程化:从工具调用循环到可恢复执行系统》
作者:陈堂会
章节:第九章 可观测与 Trace / 9.2 必须记录的字段
电子版系列:查看完整目录
第九章 可观测与 Trace:9.2 必须记录的字段
模型 span:
- provider;
- model;
- prompt tokens;
- completion tokens;
- latency;
- finish reason;
- tool call 数量;
- 是否触发上下文降级;
- response id 或 continuation metadata。
工具 span:
- tool name;
- args 摘要或脱敏后参数;
- risk level;
- approval id;
- duration;
- success/failure;
- retry count;
- output size;
- truncation 状态。
权限 span:
- policy;
- preview;
- decision;
- actor;
- reason;
- timestamp。
Context Builder span:
- budget;
- used tokens;
- dropped items;
- summarized items;
- included files;
- excluded files;
- debug report path。
这些字段构成失败诊断的证据链。

