Skip to content

telemetry: emit OTel span events for developer-role messages#5403

Merged
longcw merged 1 commit intolivekit:mainfrom
joaquinhuigomez:fix/otel-developer-role-event
Apr 10, 2026
Merged

telemetry: emit OTel span events for developer-role messages#5403
longcw merged 1 commit intolivekit:mainfrom
joaquinhuigomez:fix/otel-developer-role-event

Conversation

@joaquinhuigomez
Copy link
Copy Markdown
Contributor

_chat_ctx_to_otel_events only mapped system, user, and assistant roles, so ChatContext items with role="developer" were silently dropped from the OpenTelemetry span events and invisible to any downstream tracer.

This patch maps developer to EVENT_GEN_AI_SYSTEM_MESSAGE since OpenAI's developer role is the successor to system on the Chat Completions API and carries equivalent instructional content.

Fixes #5398

_chat_ctx_to_otel_events only mapped system/user/assistant roles, so
ChatContext items with role="developer" were silently dropped from the
OpenTelemetry span events and invisible to any downstream tracer.

Map developer to EVENT_GEN_AI_SYSTEM_MESSAGE since OpenAI's developer
role is the successor to system on the Chat Completions API and carries
equivalent instructional content.

Fixes livekit#5398
@longcw longcw merged commit 80bf23b into livekit:main Apr 10, 2026
16 checks passed
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.

developer-role messages silently dropped from OpenTelemetry span events

2 participants