Repository navigation
feat(tracing): capture protocol response IDs for model calls - #1237
Merged
Merged
Conversation
Record the provider-returned response ID for the three wire formats VeADK consumes: - Responses API: top-level id, or response.id on created/in_progress/ terminal events - Chat Completions: id on the completion and on every stream chunk - Messages: top-level message id, or message.id on message_start (the raw value LiteLLM would otherwise replace with a synthesized chatcmpl- id) The ID is published as a new veadk.response.id span attribute on the attempt span and the enclosing ADK model span, plus one new [llm-dispatch] log line per attempt. Existing gen_ai.response.id / X-Request-Id handling and all existing log lines are untouched. Extraction treats blank or non-string IDs, missing fields and empty response/message objects as absent, and isolates extraction/span/log failures so telemetry cannot fail a model call. Logged IDs are sanitized to one bounded line; spans keep the raw value. Coverage: 100% of changed executable lines and all new branches. Opt-in live E2E covers Ark and DeepSeek for all three formats in streaming and non-streaming modes.
CodeQL py/incomplete-url-substring-sanitization flagged the mock network
guard: startswith("https://mock.local") accepts lookalike hosts such as
mock.local.evil.com. Compare the parsed scheme and host, and cover the
rejected shapes with a regression test.
yaozheng-fang
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Record the provider-returned response ID for the three wire formats VeADK consumes:
The ID is published as a new veadk.response.id span attribute on the attempt span and the enclosing ADK model span, plus one new [llm-dispatch] log line per attempt. Existing gen_ai.response.id / X-Request-Id handling and all existing log lines are untouched.
Extraction treats blank or non-string IDs, missing fields and empty response/message objects as absent, and isolates extraction/span/log failures so telemetry cannot fail a model call. Logged IDs are sanitized to one bounded line; spans keep the raw value.
Coverage: 100% of changed executable lines and all new branches. Opt-in live E2E covers Ark and DeepSeek for all three formats in streaming and non-streaming modes.