Summary
The Google GenAI Go SDK (google.golang.org/genai) exposes a Live API (client.Live.Connect()) for real-time bidirectional streaming via WebSocket. This repo does not instrument it at all. Braintrust documents Live API tracing support for Python, TypeScript, and Java, making Go the only SDK without coverage for this surface.
What is missing
Instrumentation for the genai Live API session lifecycle:
client.Live.Connect() — establishes a WebSocket session with a model
session.SendClientContent() — sends turn-based text/content
session.SendRealtimeInput() — sends real-time audio/video chunks
session.SendToolResponse() — responds to model-initiated tool calls
session.Receive() — receives server messages (ServerContent, ServerToolCall, ServerGoAway, etc.)
The current trace/contrib/genai/ integration works by wrapping http.RoundTripper, which only captures HTTP-based calls (generateContent, streamGenerateContent, embedContent, batchEmbedContents). The Live API uses WebSocket transport (github.com/gorilla/websocket) and bypasses the HTTP middleware entirely.
A new instrumentation approach would be needed — likely wrapping the *genai.Session or hooking into the LiveConnectConfig — to trace Live API interactions, capture tool calls during live sessions, and record token usage.
Note: The Live API is marked Preview in the Go SDK's doc comments, meaning it may have breaking changes. However, it is already GA in Gemini's Python and JavaScript SDKs and is actively documented by both Google and Braintrust.
Braintrust docs status
supported — The Braintrust Gemini integration docs state: "Braintrust also traces the Google GenAI interactions API, including the Live API exposed through client.aio.live.connect()." This confirms Live API tracing is a recognized Braintrust capability, but it is only available in non-Go SDKs today.
Upstream sources
Local repo files inspected
trace/contrib/genai/tracegenai.go — router only matches HTTP endpoints (:generateContent, :streamGenerateContent, :embedContent, :batchEmbedContents)
trace/contrib/genai/generatecontent.go — HTTP RoundTripper-based instrumentation
trace/contrib/genai/embedcontent.go — HTTP RoundTripper-based instrumentation
trace/contrib/genai/orchestrion.yml — auto-instrumentation wraps HTTPClient in ClientConfig, no Live API hook
examples/internal/genai/main.go — no Live API example
go.mod — depends on google.golang.org/genai (Live API is available in this module)
Summary
The Google GenAI Go SDK (
google.golang.org/genai) exposes a Live API (client.Live.Connect()) for real-time bidirectional streaming via WebSocket. This repo does not instrument it at all. Braintrust documents Live API tracing support for Python, TypeScript, and Java, making Go the only SDK without coverage for this surface.What is missing
Instrumentation for the genai Live API session lifecycle:
client.Live.Connect()— establishes a WebSocket session with a modelsession.SendClientContent()— sends turn-based text/contentsession.SendRealtimeInput()— sends real-time audio/video chunkssession.SendToolResponse()— responds to model-initiated tool callssession.Receive()— receives server messages (ServerContent,ServerToolCall,ServerGoAway, etc.)The current
trace/contrib/genai/integration works by wrappinghttp.RoundTripper, which only captures HTTP-based calls (generateContent,streamGenerateContent,embedContent,batchEmbedContents). The Live API uses WebSocket transport (github.com/gorilla/websocket) and bypasses the HTTP middleware entirely.A new instrumentation approach would be needed — likely wrapping the
*genai.Sessionor hooking into theLiveConnectConfig— to trace Live API interactions, capture tool calls during live sessions, and record token usage.Note: The Live API is marked Preview in the Go SDK's doc comments, meaning it may have breaking changes. However, it is already GA in Gemini's Python and JavaScript SDKs and is actively documented by both Google and Braintrust.
Braintrust docs status
supported — The Braintrust Gemini integration docs state: "Braintrust also traces the Google GenAI
interactionsAPI, including the Live API exposed throughclient.aio.live.connect()." This confirms Live API tracing is a recognized Braintrust capability, but it is only available in non-Go SDKs today.Upstream sources
Local repo files inspected
trace/contrib/genai/tracegenai.go— router only matches HTTP endpoints (:generateContent,:streamGenerateContent,:embedContent,:batchEmbedContents)trace/contrib/genai/generatecontent.go— HTTP RoundTripper-based instrumentationtrace/contrib/genai/embedcontent.go— HTTP RoundTripper-based instrumentationtrace/contrib/genai/orchestrion.yml— auto-instrumentation wrapsHTTPClientinClientConfig, no Live API hookexamples/internal/genai/main.go— no Live API examplego.mod— depends ongoogle.golang.org/genai(Live API is available in this module)