Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bot] OpenAI Realtime API (WebSocket) not instrumented

Open
#130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
api, observability

Research direction

Start in the openai_2_15_0 module by inspecting how TracingHttpClient wraps HttpClient and how client.beta().realtime() establishes its WebSocket connection. Identify a stable WebSocket or RealtimeClient hook, then determine how session events and deltas can be captured. Done means Realtime sessions emit a span with input/output JSON and available token metrics, or the limitation is documented if no stable hook exists.

Written by the indexing model from the issue text.

Description

enhancement

Gap description

The openai-java SDK v2.15.0+ exposes a WebSocket-based Realtime API under client.beta().realtime(). The current instrumentation in openai_2_15_0 works by wrapping the SDK's HttpClient interface (execute / executeAsync), which only intercepts HTTP/HTTPS requests. WebSocket connections are established through a separate code path and are never passed through TracingHttpClient, so no span is created for any Realtime API session.

Affected surface

SDK API surface Transport
com.openai:openai-java:2.15.0+ client.beta().realtime() WebSocket (WSS)

Why it matters

Realtime API sessions carry voice and text generation work that is billable and latency-sensitive — exactly the kind of LLM execution Braintrust is designed to observe. Without instrumentation, users see a complete blind spot for this API even when all other OpenAI calls are traced.

Analogous gap already tracked

Issue #120 tracks the same problem for the Google GenAI Live (streaming) API, which also uses a persistent bidirectional connection that bypasses the HTTP-layer hook.

Suggested approach

  1. Identify the WebSocket-abstraction interface in openai-java (likely WebSocket or a RealtimeClient).
  2. Use ByteBuddy to intercept session open/message/close events, or wrap the WebSocket factory the same way TracingHttpClient wraps HttpClient.
  3. Accumulate audio/text deltas and emit a span on session close with braintrust.input_json / braintrust.output_json and token metrics where available.

Notes

  • This gap exists only in the openai_2_15_0 module; no other provider currently wraps a WebSocket transport.
  • If the upstream SDK does not yet expose a stable hook point, a note in the docs would at minimum set user expectations.
Dominant language
Java
Stars
21
Forks
5
Avg merge
2d 7h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from braintrustdata/braintrust-sdk-java

All issues in braintrustdata/braintrust-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.