docs(ai-agents): Update gen_ai span attributes to match current spec#17670
Open
obostjancic wants to merge 8 commits intomasterfrom
Open
docs(ai-agents): Update gen_ai span attributes to match current spec#17670obostjancic wants to merge 8 commits intomasterfrom
obostjancic wants to merge 8 commits intomasterfrom
Conversation
Update all manual instrumentation docs and shared include files to align with the current developer spec. Replace deprecated attribute names (gen_ai.request.messages, gen_ai.response.text, gen_ai.tool.input) with current ones (gen_ai.input.messages, gen_ai.output.messages, gen_ai.tool.call.arguments). Mark gen_ai.operation.name as required, add missing attributes (gen_ai.system, gen_ai.response.model, gen_ai.response.finish_reasons, gen_ai.system_instructions, gen_ai.pipeline.name), add span hierarchy documentation, and add streaming pattern for Node.js. Refs TET-2272 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Keep the existing "AI Request" heading and gen_ai.request op to avoid unnecessary churn. The new attributes and hierarchy docs are the substantive changes. Co-Authored-By: Claude <noreply@anthropic.com>
Restore original lowercase "span" in headings and original span name "request o3-mini" in JS example. Co-Authored-By: Claude <noreply@anthropic.com>
…type, add pipeline.name Use op="gen_ai.chat" in all AI Request span examples to match the OTel semantic convention well-known value for chat completions. Fix gen_ai.response.finish_reasons to use string type consistently. Add gen_ai.pipeline.name to invoke-agent-span attributes table. Co-Authored-By: Claude <noreply@anthropic.com>
- Remove gen_ai.request.model and gen_ai.agent.name from common attributes table (spec only requires gen_ai.operation.name and gen_ai.system as common) - Add missing gen_ai.system values: az.ai.inference, gcp.gen_ai, ibm.watsonx.ai - Promote gen_ai.response.model to required for AI Client spans - Add gen_ai.pipeline.name and gen_ai.agent.name to AI Client span prose - Add missing attributes: gen_ai.request.seed, gen_ai.request.top_k, gen_ai.response.id, gen_ai.response.time_to_first_token, gen_ai.response.tokens_per_second - Add Cost section (gen_ai.cost.*) to AI Client and Invoke Agent spans - Update browser/react-native manual instrumentation include to use current attributes instead of deprecated ones Co-Authored-By: Claude <noreply@anthropic.com>
…ge format
Use gpt-4o instead of claude-sonnet-4-20250514 in span hierarchy ASCII
diagrams for readability. Update message format in browser/react-native
manual instrumentation to use {role, parts} schema.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace deprecated gen_ai attributes with current spec equivalents: - gen_ai.request.messages -> gen_ai.input.messages - gen_ai.response.text -> gen_ai.output.messages - gen_ai.response.tool_calls -> gen_ai.output.messages - gen_ai.tool.input -> gen_ai.tool.call.arguments - gen_ai.tool.output -> gen_ai.tool.call.result - gen_ai.request.available_tools -> gen_ai.tool.definitions - op gen_ai.request -> gen_ai.chat - operation.name "summarize" -> "chat" Co-Authored-By: Claude <noreply@anthropic.com>
- Python span-metrics example: gen_ai.generate_text -> gen_ai.chat (generate_text is not a well-defined operation name) - Event payloads: mention gen_ai.input.messages as the current name alongside the deprecated gen_ai.request.messages Co-Authored-By: Claude <noreply@anthropic.com>
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.
Update all manual instrumentation docs and shared include files to align with the current developer spec.
gen_ai.request.messages→gen_ai.input.messages,gen_ai.response.text→gen_ai.output.messages,gen_ai.tool.input→gen_ai.tool.call.arguments, etc.)gen_ai.operation.nameas required — this is what powers the AI dashboardsgen_ai.system,gen_ai.response.model,gen_ai.response.finish_reasons,gen_ai.system_instructions,gen_ai.pipeline.name,gen_ai.response.streamingop="gen_ai.request"→op="gen_ai.chat"in all code examplesinvoke_agent,chat, andexecute_toolneststartInactiveSpan) for Node.js{role, parts}schema in examplesPlatforms affected: Python, Node.js, Ruby (via shared includes + per-platform examples).
Refs TET-2272