Skip to content

Commit db51b10

Browse files
xgtcodeTRAE CLI
andauthored
Prefer Ark x-request-id for chat trace response IDs (#1230)
* fix(tracing): preserve provider response IDs across model APIs Co-authored-by: TRAE CLI <traecli@bytedance.com> * fix(tracing): preserve provider provenance across stream conversions Co-authored-by: TRAE CLI <traecli@bytedance.com> * fix(tracing): prefer Ark request id for chat spans * test(runtime): isolate tracing parity provider * test(piagent): refresh tracer for span capture * test(codex): isolate tracing span capture --------- Co-authored-by: TRAE CLI <traecli@bytedance.com>
1 parent 9c5b2ec commit db51b10

10 files changed

Lines changed: 1429 additions & 60 deletions

File tree

‎docs/content/docs/framework/observability.en.mdx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ VeADK's observability follows the [OpenTelemetry](https://opentelemetry.io/docs/
1414
- **Multi-agent coordination**: Analyzes the invocation relationships and data flow between agents in multi-agent scenarios;
1515
- **Content collection control**: Disable Agent, LLM, and tool input/output content collection with `observability.opentelemetry.trace_content` while keeping non-content trace data.
1616

17+
When tracing is enabled and the model returns a response ID, VeADK records its original value as `gen_ai.response.id` on the corresponding `call_llm` span. This covers streaming and non-streaming Chat, Ark Responses, and native ADK Gemini text calls. Use this ID to correlate a model response with the provider's logs. It remains available when content collection is disabled, and an ID received early in a stream is preserved if that stream fails or is cancelled.
18+
19+
If no provider response ID is available, the attribute is omitted. VeADK does not substitute HTTP request IDs, SDK-generated IDs, tool call IDs, or previous response IDs. Failed attempts retain their IDs on their own `model_request` spans; retries and fallbacks report the ID of the delivered response on `call_llm`.
20+
1721
## Supported Platforms
1822

1923
Through different data exporters, VeADK reports tracing data to multiple Volcengine and third-party platforms:

‎docs/content/docs/framework/observability.mdx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ VeADK 的可观测能力遵循 [OpenTelemetry](https://opentelemetry.io/docs/spe
1414
- **多 Agent 协调**:在多 Agent 协作场景中分析各 Agent 的调用关系与数据流向;
1515
- **内容采集控制**:可通过 `observability.opentelemetry.trace_content` 关闭 Agent、LLM 与工具输入输出内容采集,仅保留非内容 Trace 信息。
1616

17+
启用 Tracing 且模型返回响应 ID 时,VeADK 会将其原值记录到对应 `call_llm` span 的 `gen_ai.response.id` 属性中,覆盖 Chat、Ark Responses 和原生 ADK Gemini 文本调用的流式与非流式模式。你可以用该 ID 关联模型提供方的响应日志。关闭内容采集后仍会记录响应 ID;流式调用提前取得的 ID 在断流或取消后也会保留。
18+
19+
提供方未返回可取得的响应 ID 时,该属性会省略,不会用 HTTP request ID、SDK 自动生成的 ID、tool call ID 或历史响应 ID 替代。失败尝试的 ID 保留在其对应的 `model_request` span 中,重试或 fallback 后的 `call_llm` 记录实际交付响应的 ID。
20+
1721
## 支持的平台
1822

1923
VeADK 通过不同的数据导出器(Exporter),将 Tracing 数据上报至多个火山引擎及第三方平台:

0 commit comments

Comments
 (0)