Skip to content

docs(ai-agents): Update gen_ai span attributes to match current spec#17670

Open
obostjancic wants to merge 8 commits intomasterfrom
ognjenbostjancic/tet-2272-update-manual-instrumentation-gen_ai-docs-with-new
Open

docs(ai-agents): Update gen_ai span attributes to match current spec#17670
obostjancic wants to merge 8 commits intomasterfrom
ognjenbostjancic/tet-2272-update-manual-instrumentation-gen_ai-docs-with-new

Conversation

@obostjancic
Copy link
Copy Markdown
Member

Update all manual instrumentation docs and shared include files to align with the current developer spec.

  • Replace deprecated attributes (gen_ai.request.messagesgen_ai.input.messages, gen_ai.response.textgen_ai.output.messages, gen_ai.tool.inputgen_ai.tool.call.arguments, etc.)
  • Mark gen_ai.operation.name as required — this is what powers the AI dashboards
  • Add missing attributes: gen_ai.system, gen_ai.response.model, gen_ai.response.finish_reasons, gen_ai.system_instructions, gen_ai.pipeline.name, gen_ai.response.streaming
  • Fix op="gen_ai.request"op="gen_ai.chat" in all code examples
  • Add span hierarchy docs showing how invoke_agent, chat, and execute_tool nest
  • Add streaming pattern (startInactiveSpan) for Node.js
  • Update message format to new {role, parts} schema in examples

Platforms affected: Python, Node.js, Ruby (via shared includes + per-platform examples).

Refs TET-2272

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>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 7, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment May 7, 2026 2:04pm
sentry-docs Ready Ready Preview, Comment May 7, 2026 2:04pm

Request Review

obostjancic and others added 2 commits May 7, 2026 15:05
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>
Comment thread includes/tracing/ai-agents-module/ai-client-span.mdx Outdated
…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>
Comment thread includes/tracing/ai-agents-module/ai-client-span.mdx
obostjancic and others added 4 commits May 7, 2026 15:38
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant