Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bot] OpenAI Realtime API (WebSocket) not instrumented

Aperta
#130 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java
Ambito
api, observability

Direzione di ricerca

Inizia nel modulo openai_2_15_0 esaminando come TracingHttpClient avvolge HttpClient e come client.beta().realtime() stabilisce la connessione WebSocket. Individua un hook stabile di WebSocket o RealtimeClient, quindi determina come acquisire gli eventi e i delta della sessione. Il lavoro è completato quando le sessioni Realtime emettono uno span con il JSON di input/output e le metriche dei token disponibili, oppure quando la limitazione è documentata se non esiste alcun hook stabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Java
Stelle
21
Fork
5
Merge medio
2g 7h
PR unite (30g)
8

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di braintrustdata/braintrust-sdk-java

Tutte le issue di braintrustdata/braintrust-sdk-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.