[bot] AWS Bedrock batch inference (CreateModelInvocationJob) is not instrumented at all
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- aws, java
調査の方向性
BraintrustAWSBedrock.java、AWSBedrockInstrumentationModule.java、BraintrustBedrockInterceptor.java、InstrumentationSemConv.java から始め、続いて BraintrustAWSBedrockTest.java と AWS Bedrock のコントロールプレーンのクライアント API を確認します。指定されたバッチジョブ操作について、リクエストとレスポンスの形式およびライフサイクルを含むカバレッジを追加し、送信、ステータス確認、一覧表示、停止について、対象を絞ったテストまたはカセットで検証します。
索引モデルが issue の本文から書いたものです。
説明
Summary
The aws_bedrock_2_30_0 module only ever wraps the Bedrock data-plane runtime client builders (software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClientBuilder / BedrockRuntimeAsyncClientBuilder), and only tags Converse/ConverseStream operations on that client (tracked separately in #134 for InvokeModel). AWS Bedrock's official batch inference API — submitted through the entirely separate control-plane client software.amazon.awssdk.services.bedrock.BedrockClient (CreateModelInvocationJob / GetModelInvocationJob / ListModelInvocationJobs / StopModelInvocationJob) — has no wrapping mechanism at all. This is a different Maven artifact/class hierarchy (bedrock vs. bedrockruntime) that this module never references, so unlike the Gemini Batches gap (#165, where calls at least reach the wrapper and get mis-tagged), a Bedrock batch inference job call today produces zero span — not even a generic or mis-tagged one.
What is missing
BraintrustBedrockInterceptor.javaline 55:private static final Set<String> INSTRUMENTED_OPERATIONS = Set.of("Converse", "ConverseStream");, enforced at lines 62–66 (beforeExecutionreturns immediately for any other operation name). This interceptor is only ever attached to aBedrockRuntimeClientBuilder/BedrockRuntimeAsyncClientBuilderin the first place (see next point), so it structurally cannot see batch-inference-job calls regardless of this allowlist.BraintrustAWSBedrock.java(lines 23–24, 53–54): both publicwrap()overloads are typed to accept onlyBedrockRuntimeClientBuilder/BedrockRuntimeAsyncClientBuilder. There is nowrap(BedrockClientBuilder)overload, so a manual user has no supported way to instrument the control-plane client that hosts batch inference at all.AWSBedrockInstrumentationModule.java(BedrockBuilderAdvice.build(), lines 74–83): the auto-instrumentationinstanceofchecks are likewise limited toBedrockRuntimeClientBuilder/BedrockRuntimeAsyncClientBuilder. ABedrockClientBuilder(control plane) passing throughSdkDefaultClientBuilder.build()falls through both branches untouched.InstrumentationSemConv.tagBedrockRequest()/tagBedrockResponse()only understand Converse-shaped JSON (messages,output.message,usage.inputTokens) — even if a batch job call were reached, there's no field extraction forCreateModelInvocationJobRequest/GetModelInvocationJobResponseshapes (jobArn,inputDataConfig/S3 URI,outputDataConfig/S3 URI,status,roleArn).- No test, cassette, or example anywhere in the repo references
CreateModelInvocationJob,GetModelInvocationJob,ModelInvocationJob, or thebedrock(non-bedrockruntime) client package — confirmed via repo-wide search. - No async submit → poll-status → retrieve-result lifecycle is modeled for this provider, unlike the (also-gapped, but at least structurally reachable) OpenAI (#164), Anthropic (#155), and Google GenAI (#165) batch APIs.
Braintrust docs status: not_found
Fetched https://www.braintrust.dev/docs/integrations/ai-providers/bedrock in full. It documents per-language tracing coverage for Converse/ConverseStream/InvokeModel/InvokeModelWithResponseStream across the TypeScript, Python, Go, and Java SDKs (explicitly noting for Java: "Other Bedrock operations such as InvokeModel and ApplyGuardrail are not traced" — consistent with #134). No mention anywhere on the page, for any language SDK, of batch inference / model invocation jobs / CreateModelInvocationJob. This is a documentation gap across the whole product, not just Java, but the Java SDK itself also has zero code path that could produce a span for this API even if docs existed.
Upstream sources
- AWS Bedrock batch inference user guide: https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference.html and https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-create.html — describes submitting a batch inference job against an S3 input file and retrieving results from S3 once the job completes.
- API reference: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelInvocationJob.html (also
GetModelInvocationJob,ListModelInvocationJobs,StopModelInvocationJob). - AWS SDK for Java v2 control-plane client:
software.amazon.awssdk.services.bedrock.BedrockClient#createModelInvocationJob— https://docs.aws.amazon.com/java/api/latest/software/amazon/awssdk/services/bedrock/BedrockClient.html and https://docs.aws.amazon.com/java/api/latest/software/amazon/awssdk/services/bedrock/model/CreateModelInvocationJobRequest.html — this is a distinct Maven artifact (software.amazon.awssdk:bedrock) from the already-instrumentedsoftware.amazon.awssdk:bedrockruntime.
Local repo files inspected
braintrust-sdk/instrumentation/aws_bedrock_2_30_0/src/main/java/dev/braintrust/instrumentation/awsbedrock/v2_30_0/BraintrustBedrockInterceptor.java— line 55 (INSTRUMENTED_OPERATIONS), lines 62–66 (allowlist enforcement), imports at lines 31–32 (bedrockruntime.model.ConverseRequest/ConverseStreamRequestonly)braintrust-sdk/instrumentation/aws_bedrock_2_30_0/src/main/java/dev/braintrust/instrumentation/awsbedrock/v2_30_0/BraintrustAWSBedrock.java— lines 23–24 and 53–54 (wrap()overload signatures, bothbedrockruntimebuilder types only)braintrust-sdk/instrumentation/aws_bedrock_2_30_0/src/main/java/dev/braintrust/instrumentation/awsbedrock/v2_30_0/auto/AWSBedrockInstrumentationModule.java— lines 74–83 (BedrockBuilderAdvice.build()instanceofchecks limited tobedrockruntimebuilders)braintrust-sdk/src/main/java/dev/braintrust/instrumentation/InstrumentationSemConv.java—tagBedrockRequest()/tagBedrockResponse()handle only Converse-shaped bodiesbraintrust-sdk/instrumentation/aws_bedrock_2_30_0/src/test/java/dev/braintrust/instrumentation/awsbedrock/v2_30_0/BraintrustAWSBedrockTest.java— all tests useConverseRequest/ConverseStreamRequest; no batch-job test exists- Repo-wide search for
ModelInvocationJob,CreateModelInvocationJob, and thesoftware.amazon.awssdk.services.bedrock.(control-plane) package — zero matches outside this issue - Existing related/non-duplicate issues reviewed: #134 (Bedrock
InvokeModelembeddings — same module, different operation, not batch), #165 (Google GenAI Batches — different provider), #155 (Anthropic Message Batches — different provider), #164 (OpenAI Batch API — different provider)
- 主要言語
- Java
- スター
- 21
- フォーク
- 5
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 8
環境構築
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
objectionary/eo#9182 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
objectionary/hone-maven-plugin#1293 ·
メンテナーはふだん 1 日以内に返信
-
1.severity: security
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NixOS/nixpkgs#569828 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
MaikuB/flutter_appauth#683 ·