[bot] OpenAI Realtime API (WebSocket) not instrumented
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ả
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
- Identify the WebSocket-abstraction interface in
openai-java(likelyWebSocketor aRealtimeClient). - Use ByteBuddy to intercept session open/message/close events, or wrap the WebSocket factory the same way
TracingHttpClientwrapsHttpClient. - Accumulate audio/text deltas and emit a span on session close with
braintrust.input_json/braintrust.output_jsonand token metrics where available.
Notes
- This gap exists only in the
openai_2_15_0module; 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của braintrustdata/braintrust-sdk-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Tất cả issue của braintrustdata/braintrust-sdk-java
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wso2/dpdp-accelerator#287 ·