Skip to content

feat(semconv): add span-root input.audio and output.audio SpanAttributes - #3708

Draft
caroger wants to merge 14 commits into
mainfrom
feat/span-root-audio-semconv
Draft

caroger wants to merge 14 commits into
mainfrom
feat/span-root-audio-semconv

Conversation

@caroger

@caroger caroger commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #3700 (docs/audio-video-semconv). Merge that first.

Test plan

  • Python test_attributes.py TestSpanAttributes includes input.audio.* and output.audio.*
  • GOWORK=off go test . in go/openinference-semantic-conventions
  • openai-agents test_audio_emitted_by_default and test_attribute_keys_snapshot_on_full_turn
  • Confirm feat(semconv): add audio and video semantic conventions #3700 still has no span-root SpanAttributes, no public span-root spec section, no openai_realtime.md / openai_realtime_audio_demo.py, and no published OPENINFERENCE_HIDE_*_AUDIO/VIDEO settings

Publish video on message.contents next to images, complete the audio
content-block shape, and document openai-agents input.audio.* as the
voice-session convention rather than rewriting those spans onto
llm.input_messages.
Land the published keys in Python, JS, Java, and Go so instrumentors
can compose message_content.audio.audio.url and
message_content.video.video.url from constants instead of string
literals.
Export synthetic Gemini video, OpenAI chat audio, and openai-agents
realtime spans so reviewers can compare today's capture with the
proposed keys in Phoenix.
Document the _realtime.py event and finalize path, keep input.audio.url singular per span, and list the AudioAttributes constant swap for the instrumentor follow-up.
Infer video MIME from the URL instead of a published attribute. Over-limit
audio and video externalize or redact. Prefer the OpenAI realtime .done
transcript when a response is interrupted.
AudioAttributes is url and transcript only. Consumers infer MIME from the URL path or a data URI prefix, same as video.
Publish chat message_content.audio and message_content.video only. openai-agents realtime input.audio.* stays instrumentor-local until named SpanAttributes land.
Name the voice-session keys on SpanAttributes instead of a prefix rule. Point openai-agents realtime at those constants. USER and AUDIO kinds stay unpublished.
The span-root keys are named SpanAttributes now. Keep the event mapping tables in sync.
@pkg-pr-new

pkg-pr-new Bot commented Sep 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@arizeai/openinference-core

npm i https://pkg.pr.new/@arizeai/openinference-core@3708

@arizeai/openinference-genai

npm i https://pkg.pr.new/@arizeai/openinference-genai@3708

@arizeai/openinference-instrumentation-anthropic

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-anthropic@3708

@arizeai/openinference-instrumentation-bedrock

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-bedrock@3708

@arizeai/openinference-instrumentation-bedrock-agent-runtime

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-bedrock-agent-runtime@3708

@arizeai/openinference-instrumentation-beeai

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-beeai@3708

@arizeai/openinference-instrumentation-claude-agent-sdk

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-claude-agent-sdk@3708

@arizeai/openinference-instrumentation-langchain

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-langchain@3708

@arizeai/openinference-instrumentation-langchain-v0

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-langchain-v0@3708

@arizeai/openinference-instrumentation-mcp

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-mcp@3708

@arizeai/openinference-instrumentation-openai

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-openai@3708

@arizeai/openinference-instrumentation-openai-agents

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-openai-agents@3708

@arizeai/openinference-semantic-conventions

npm i https://pkg.pr.new/@arizeai/openinference-semantic-conventions@3708

@arizeai/openinference-tanstack-ai

npm i https://pkg.pr.new/@arizeai/openinference-tanstack-ai@3708

@arizeai/openinference-vercel

npm i https://pkg.pr.new/@arizeai/openinference-vercel@3708

commit: 62fec17

Comment on lines +220 to +236
export const INPUT_AUDIO_URL =
`${SemanticAttributePrefixes.input}.${SemanticAttributePrefixes.audio}.${AudioAttributesPostfixes.url}` as const;
export const INPUT_AUDIO_MIME_TYPE =
`${SemanticAttributePrefixes.input}.${SemanticAttributePrefixes.audio}.${AudioAttributesPostfixes.mime_type}` as const;
export const INPUT_AUDIO_TRANSCRIPT =
`${SemanticAttributePrefixes.input}.${SemanticAttributePrefixes.audio}.${AudioAttributesPostfixes.transcript}` as const;
/**
* The output of any span
*/
export const OUTPUT_VALUE = `${SemanticAttributePrefixes.output}.value` as const;
export const OUTPUT_MIME_TYPE = `${SemanticAttributePrefixes.output}.mime_type` as const;
export const OUTPUT_AUDIO_URL =
`${SemanticAttributePrefixes.output}.${SemanticAttributePrefixes.audio}.${AudioAttributesPostfixes.url}` as const;
export const OUTPUT_AUDIO_MIME_TYPE =
`${SemanticAttributePrefixes.output}.${SemanticAttributePrefixes.audio}.${AudioAttributesPostfixes.mime_type}` as const;
export const OUTPUT_AUDIO_TRANSCRIPT =
`${SemanticAttributePrefixes.output}.${SemanticAttributePrefixes.audio}.${AudioAttributesPostfixes.transcript}` as const;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 6 new constants are not covered by any tests. Go and Python both received corresponding test updates in this PR (e.g., go/openinference-semantic-conventions/semconv_test.go and python/openinference-semantic-conventions/tests/openinference/semconv/test_attributes.py), but there are no tests for the JS semantic conventions package at all.

Per CLAUDE.md: "Include tests for new features and bug fixes"

Consider adding a test file (e.g., src/trace/SemanticConventions.test.ts) that asserts the string values of the new constants, matching the pattern used in Go and Python.

Comment on lines +247 to +252
public static final String INPUT_AUDIO_URL =
SemanticAttributePrefixes.INPUT
+ "."
+ SemanticAttributePrefixes.AUDIO
+ "."
+ AudioAttributesPostfixes.URL;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 6 new Java constants have no corresponding test coverage. The Go and Python packages both received test updates for these same constants in this PR, but the Java openinference-semantic-conventions package has no test directory (src/test/ doesn't exist).

Per CLAUDE.md: "Include tests for new features and bug fixes"

Consider adding a src/test/java/com/arize/semconv/trace/SemanticConventionsTest.java that asserts the string values of the constants (following the pattern in go/openinference-semantic-conventions/semconv_test.go).

…ollow-up

Chat-only PR 3700 should not ship the openai-agents event map or the USER-span demo.
…conv

Keep openai_realtime.md and the realtime demo on this follow-up after 3700 dropped them.
Comment on lines +338 to +348
#### Span-root audio (voice sessions)

For realtime or live voice spans that are not chat message lists. These are named `SpanAttributes` (`INPUT_AUDIO_URL` is `input.audio.url`). Each span carries at most one audio payload (no `input.audio.<index>`). Span kinds `USER` and `AUDIO` stay unpublished.

- `input.audio.url` - User audio URL or WAV data URI
- `input.audio.mime_type` - User audio MIME type
- `input.audio.transcript` - User audio transcript
- `output.audio.url` - Assistant audio URL or WAV data URI
- `output.audio.mime_type` - Assistant audio MIME type
- `output.audio.transcript` - Assistant audio transcript

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The six new span-root audio attributes are documented here as a subsection bullet list, but they're missing from the main Reserved Attributes table where all other published SpanAttributes constants are catalogued (see lines 136–143).

Every comparable published attribute has a row in that table — including the parent audio.url / audio.mime_type / audio.transcript keys and the peer input.value / output.value / input.mime_type / output.mime_type keys. The six new constants are the only newly-promoted SpanAttributes without a main-table entry, making the spec inconsistent and incomplete for consumers who reference that table to discover all reserved attributes.

Consider adding rows for each of the six attributes to the main table, e.g.:

| `input.audio.url`       | String | `https://storage.com/audio.wav` | URL or WAV data URI of user audio for a voice session |
| `input.audio.mime_type` | String | `audio/wav`                     | MIME type of the user audio                            |
| `input.audio.transcript`| String | `"Hello, how are you?"`         | Transcript of the user audio                           |
| `output.audio.url`      | String | `https://storage.com/audio.wav` | URL or WAV data URI of assistant audio for a voice session |
| `output.audio.mime_type`| String | `audio/wav`                     | MIME type of the assistant audio                       |
| `output.audio.transcript`| String | `"I'm doing well, thanks."`    | Transcript of the assistant audio                      |

…Config

Shared mask() still only handles images. Do not list OPENINFERENCE_HIDE_*_AUDIO/VIDEO or BASE64_AUDIO/VIDEO_MAX_LENGTH as usable settings until TraceConfig implements them.
…conv

Keep span-root SpanAttributes on this follow-up. Leave audio/video hide flags and size gates out of the published configuration table until TraceConfig implements them.
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Base automatically changed from docs/audio-video-semconv to main September 10, 2026 01:19
@mikeldking
mikeldking marked this pull request as draft September 10, 2026 02:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant