Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[bot] OpenAI Realtime API (WebSocket) not instrumented

Đang mở
#130 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
api, observability

Hướng nghiên cứu

Bắt đầu trong module openai_2_15_0 bằng cách kiểm tra cách TracingHttpClient bao bọc HttpClient và cách client.beta().realtime() thiết lập kết nối WebSocket. Xác định một hook ổn định của WebSocket hoặc RealtimeClient, sau đó xác định cách có thể thu thập các sự kiện và delta của phiên. Công việc được xem là hoàn tất khi các phiên Realtime phát ra một span chứa JSON đầu vào/đầu ra và các chỉ số token hiện có, hoặc khi giới hạn được ghi lại nếu không tồn tại hook ổn định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Java
Star
21
Fork
5
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
8

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của braintrustdata/braintrust-sdk-java

Tất cả issue của braintrustdata/braintrust-sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.