feat(trace-aliyun): GenAI spans for LLM TTFT, agent ReAct, tools, and failed LLM nodes - #39339
Open
123liuziming wants to merge 4 commits into
Open
feat(trace-aliyun): GenAI spans for LLM TTFT, agent ReAct, tools, and failed LLM nodes#39339123liuziming wants to merge 4 commits into
123liuziming wants to merge 4 commits into
Conversation
…agent nodes - Record gen_ai.response.time_to_first_token (nanoseconds) on LLM spans for both workflow LLM nodes and message traces - Emit AGENT-kind spans (instead of TASK) for agent-strategy nodes with invoke_agent operation name, agent name and token usage - Parse the agent execution log in outputs to build per-round ReAct STEP spans and their child LLM call spans, anchoring monotonic timestamps to the node start time Change-Id: I178ab61a36389b1698e7dda64836877d9507b51f Co-developed-by: Cursor <noreply@cursor.com>
crazywoola
marked this pull request as draft
July 21, 2026 06:43
Agent ReAct tool invocations were misclassified as LLM because CALL logs also set metadata.provider. Classify CALL labels as TOOL and keep Thought entries as LLM. Co-authored-by: Cursor <cursoragent@cursor.com>
…enAI Fall back to node inputs/error when process_data is empty on invoke failure. Replace legacy tool.* attributes with gen_ai.tool.* semantic conventions. Co-authored-by: Cursor <cursoragent@cursor.com>
123liuziming
marked this pull request as ready for review
July 28, 2026 11:43
Author
|
@TreyDong @laipz8200 Hey, could you review my PR when you have a chance? |
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.
Important
Fixes #<issue number>.Summary
Improve Aliyun Trace (
trace-aliyun) so workflow/agent telemetry better matches GenAI semantic conventions and is more useful when model or tool calls fail.LLM
gen_ai.response.time_to_first_token(nanoseconds) on workflow LLM spans and message LLM spans when TTFT is available.process_dataempty), fall back to nodeinputs/error/error_typeso attributes such asgen_ai.request.model,gen_ai.provider.name,gen_ai.prompt, andgen_ai.completionare still populated when possible.gen_ai.input.messagesstill depends onprocess_data.prompts, which is only written after a successful invoke today.Agent / ReAct
AGENTspans (instead ofTASK) for agent-strategy nodes, withgen_ai.operation.name=invoke_agent, agent name, and token usage.STEPspans and child call spans, anchoring monotonic log timestamps to the node start time.LLMCALL …→TOOL(previously misclassified as LLM because CALL logs also setmetadata.provider)Tool
gen_ai.span.kind=TOOL,gen_ai.operation.name=execute_toolgen_ai.tool.name,gen_ai.tool.type,gen_ai.tool.description,gen_ai.tool.call.id,gen_ai.tool.call.arguments,gen_ai.tool.call.resulttool_trace, workflow tool nodes, and agent ReAct CALL spans.tool.name/tool.description/tool.parameterskeys.Tests
Screenshots
tool.*keysgen_ai.tool.*Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint godsFrom Cursor