[bot] Google GenAI video generation (generateVideos / Veo) traced with materially less detail than text generation
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
BraintrustApiClient.java、特に tagSpan と4つのトランスポートオーバーライドから始め、次に BraintrustGenAITest.java と Google GenAI の generateVideos および getVideosOperation API を調べてください。動画生成に関する対象を絞ったカバレッジを追加し、リクエストの詳細、span の分類、利用可能なメトリクス、長時間実行オペレーションのポーリングが意図した忠実度で表現されていることを検証してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
The Google GenAI Java SDK (com.google.genai, v1.18.0, the version this module targets) exposes Models.generateVideos(...) (Veo video-generation models) and the associated long-running-operation polling API (client.operations.getVideosOperation(...)). Braintrust's Java GenAI instrumentation intercepts these calls only incidentally, through a generic HTTP-transport hook that was designed for generateContent. The result is spans that are silently mislabeled and largely empty for video generation — not a total absence of spans, but instrumentation with materially less detail/fidelity than the documented generate_content path.
What is missing
BraintrustApiClient (braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java) intercepts every HTTP call made by the SDK by overriding the transport-level methods on ApiClient:
request(String, String, String, Optional<HttpOptions>)— line 186request(String, String, byte[], Optional<HttpOptions>)— line 210asyncRequest(String, String, String, Optional<HttpOptions>)— line 239asyncRequest(String, String, byte[], Optional<HttpOptions>)— line 277
Because this hook is transport-level, a generateVideos call (and each operations.getVideosOperation poll of the resulting long-running operation) does produce a span — but tagSpan (lines 50–161) was written exclusively for the generateContent request/response shape:
- Line 156 unconditionally sets
braintrust.span_attributesto{"type": "llm"}for every call this client makes, including video-generation calls, which are not LLM chat-completion calls. - Lines 65–76 and 81–95 only promote
model/systemInstruction/tools/toolConfig/safetySettings/cachedContentandgenerationConfig.{temperature,topP,topK,candidateCount,maxOutputTokens,stopSequences,responseMimeType,responseSchema}intobraintrust.metadata/input_json.generateVideosrequests use an entirely different shape (instances/parametersorprompt/image/video+ aGenerateVideosConfigwith fields likenumberOfVideos,durationSeconds,aspectRatio,enhancePrompt,personGeneration) — none of these fields are extracted, soinput_jsonfor a video-generation span is effectively empty. - Lines 127–149 only look for
usageMetadata.{promptTokenCount,candidatesTokenCount,totalTokenCount,cachedContentTokenCount}to populatebraintrust.metrics. Video-generation responses have no such field, so metrics are silently skipped (not wrong, just absent) while the span is still taggedtype: llm. generateVideosreturns aGenerateVideosOperationthat is notdoneimmediately; the caller pollsclient.operations.getVideosOperation(...)repeatedly until completion. Each poll produces its own disconnected span (named via URL-derivedgetOperation, e.g.get_videos_operation) rather than being correlated to the originating video-generation request — there is no long-running-operation span model, unlike the single request/response span Braintrust produces forgenerate_content.
There is no reference anywhere in this module (or its tests) to generateVideos, GenerateVideosOperation, GenerateVideosConfig, Veo, or getVideosOperation — confirmed via full-directory grep of braintrust-sdk/instrumentation/genai_1_18_0/.
Braintrust docs status
Checked https://www.braintrust.dev/docs/integrations/ai-providers/gemini (current as of this audit):
- Java section documents only content-generation spans (
generate_content, sync/async) andgenerateContentStream, with request metadata (model, contents, generation config), response, and token metrics. - No mention of video generation,
generateVideos, or Veo models for any language (Java, Python, TypeScript, Go). - Status: not_found — video generation tracing is undocumented for Java (and for every other language) in the current docs.
Upstream sources
- Google GenAI Java SDK repo: https://github.com/googleapis/java-genai —
Modelsclass exposesgenerateVideos(String model, GenerateVideosSource source, GenerateVideosConfig config)andgenerateVideos(String model, String prompt, Image image, Video video, GenerateVideosConfig config). - SDK README usage example (video generation via Veo, polling
operation.done()/client.operations.getVideosOperation): https://github.com/googleapis/java-genai/blob/main/README.md - SDK CHANGELOG entries for video generation support (e.g. "Add backwards compatibility for generateVideos in Java SDK", "Add support for Veo frame interpolation and video extension"): https://github.com/googleapis/java-genai/blob/main/CHANGELOG.md
- Gemini API Veo docs (request/response/config shape —
GenerateVideosConfigfields likenumberOfVideos,durationSeconds,aspectRatio): https://ai.google.dev/gemini-api/docs/veo - Java Veo 3 walkthrough (async polling pattern): https://glaforge.dev/posts/2025/09/10/generating-videos-in-java-with-veo3/
Local files inspected
braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java— full file read;tagSpan(lines 50–161) and the four transport overrides (lines 186, 210, 239, 277) are the only interception points, and are generateContent-shaped.braintrust-sdk/instrumentation/genai_1_18_0/src/test/java/dev/braintrust/instrumentation/genai/v1_18_0/BraintrustGenAITest.java— only tests syncgenerateContent; no video-generation test coverage.- Full-directory grep of
braintrust-sdk/instrumentation/genai_1_18_0/forgenerateImages|GenerateImages|predictLongRunning|generate_videos|video— zero matches.
- 主要言語
- Java
- スター
- 21
- フォーク
- 5
- 平均マージ
- 2日 34分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
braintrustdata/braintrust-sdk-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
braintrustdata/braintrust-sdk-java の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/skywalking#14120 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
HMCL-dev/HMCL#6943 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
micronaut-projects/micronaut-core#13677 ·
メンテナーはふだん 1 日以内に返信
-
new feature
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/rocketmq-dashboard#5594 ·
メンテナーはふだん 3 日以内に返信