Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[bot] OpenAI Realtime API (WebSocket) not instrumented

Abierto
#130 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
java

Línea de trabajo

Comienza en el módulo openai_2_15_0 inspeccionando cómo TracingHttpClient envuelve a HttpClient y cómo client.beta().realtime() establece su conexión WebSocket. Identifica un hook estable de WebSocket o RealtimeClient y determina después cómo se pueden capturar los eventos y deltas de la sesión. Se considera completado cuando las sesiones Realtime emiten un span con JSON de entrada/salida y las métricas de tokens disponibles, o cuando se documenta la limitación si no existe un hook estable.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Java
Estrellas
21
Forks
5
Merge medio
2 d 7 h
PR fusionados (30 d)
8

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de braintrustdata/braintrust-sdk-java

Todos los issues de braintrustdata/braintrust-sdk-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.