Add LiveKit Agents support#9
Closed
Hormold wants to merge 3 commits into
Closed
Conversation
Adds support for spans emitted by the livekit-agents Python SDK.
- src/spans/adapters/livekit.ts: extracts chat history from lk.chat_ctx
(handling message / function_call / function_call_output items) and
tool calls from lk.function_tool.{name,arguments,output,is_error}
- src/parse.ts: classifies llm_node spans as LLM_GENERATION via
(lk.chat_ctx + gen_ai.request.model); recognizes lk.function_tool.name
as a tool-name attribute alongside ai.toolCall.name / tool.name
- src/spans/normalize.ts: registers the two adapters
LiveKit Agents sets gen_ai.provider.name (newer OTel GenAI convention) rather than the older gen_ai.system. Without this fallback the provider column stays empty for every LiveKit span.
The standard opentelemetry-exporter-otlp-proto-http exporter always sends protobuf regardless of OTEL_EXPORTER_OTLP_PROTOCOL. Workshop was warning and dropping these bodies; this decodes them via protobufjs against an inline OTLP schema and converts to the JSON shape parseOtlpRequest already consumes.
Hormold
marked this pull request as ready for review
May 15, 2026 16:23
Contributor
|
Thank you for the PR! Included the changes into this release: https://github.com/raindrop-ai/workshop/releases/tag/v0.1.7 |
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.
Adds support for ingesting traces from the LiveKit Agents Python SDK.
What's added
src/spans/adapters/livekit.ts— turnslk.chat_ctxinto a chat-history view forllm_nodespans andlk.function_tool.*into tool-call data.src/parse.ts— classifies LiveKitllm_nodeasLLM_GENERATION(vialk.chat_ctx+gen_ai.request.model), picks uplk.function_tool.name, and recognizesgen_ai.provider.name.src/otlp-protobuf.ts— decodes protobuf OTLP requests so the stockopentelemetry-exporter-otlp-proto-httpexporter works directly. Workshop used to silently drop protobuf bodies.How to wire it up
Screenshots