Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[bot] OpenAI and Anthropic generation parameters not captured in span metadata

オープン
#83 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java
領域
observability

調査の方向性

braintrust-sdk/src/main/java/dev/braintrust/instrumentation/InstrumentationSemConv.java の tagOpenAIRequest と tagAnthropicRequest から始め、次に BraintrustApiClient.java の Google GenAI ハンドラーにおけるパラメータ抽出と比較します。既存の OpenAI および Anthropic のテストファイルを確認し、一覧にある生成パラメータとプロバイダー固有の設定のカバレッジを追加します。対応しているリクエストメタデータが一貫して取得され、テストでそれが検証されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

The OpenAI and Anthropic request taggers in InstrumentationSemConv only extract model and request routing info (request_path, request_base_uri, request_method) into span metadata. Generation parameters like temperature, max_tokens, tools, response_format, and provider-specific config like Anthropic's thinking are silently dropped.

In contrast, the Google GenAI handler in the same repo (BraintrustApiClient.tagSpan()) extracts temperature, topP, topK, maxOutputTokens, tools, toolConfig, safetySettings, responseMimeType, responseSchema, and more into metadata. This is an inconsistency within the repo — the Google GenAI handler provides materially more instrumentation detail for the same class of information.

What is missing

OpenAI — tagOpenAIRequest() (lines 78–108)

Currently captures only model in metadata. The following request parameters are silently dropped:

Field Purpose
temperature Sampling temperature
max_tokens / max_completion_tokens Output length limit
top_p Nucleus sampling
frequency_penalty, presence_penalty Repetition control
tools Tool/function definitions
response_format Structured output config (JSON mode, JSON Schema)
reasoning_effort Reasoning effort for o-series models
logprobs, top_logprobs Log probability settings
stop Stop sequences

For the Responses API, additional fields are missing: instructions, tools (with web_search, file_search, code_interpreter configs), reasoning (with effort and summary).

Anthropic — tagAnthropicRequest() (lines 163–205)

Currently captures only model in metadata. The following request parameters are silently dropped:

Field Purpose
max_tokens Output length limit (required parameter)
temperature Sampling temperature
top_p, top_k Sampling parameters
tools Tool definitions
thinking Extended thinking config (type, budget_tokens)
stop_sequences Stop sequences
metadata User-provided metadata (e.g., user_id)

The thinking config is particularly important: when a user enables extended thinking with a specific budget, this information is lost from the span. The Python SDK equivalent (issue braintrustdata/braintrust-sdk-python#107, now closed) captures thinking metadata.

Google GenAI — already captures these (for comparison)

BraintrustApiClient.tagSpan() (lines 64–95) extracts into metadata:

  • systemInstruction, tools, toolConfig, safetySettings, cachedContent
  • From generationConfig: temperature, topP, topK, candidateCount, maxOutputTokens, stopSequences, responseMimeType, responseSchema

Impact

Users viewing traces in Braintrust can see generation parameters for Google GenAI calls but not for OpenAI or Anthropic calls. This makes it impossible to understand model configuration from the trace alone for the two most commonly used providers.

Braintrust docs status

  • Braintrust tracing docs at https://www.braintrust.dev/docs/guides/tracing state that LLM spans show "the model, messages, parameters, token usage, and cost" — supported (parameters are documented as captured, but not implemented for OpenAI/Anthropic in this Java SDK)
  • The Braintrust OpenAI docs mention temperature handling for GPT-5 models, implying it is a tracked parameter: unclear

Upstream sources

Local files inspected

  • braintrust-sdk/src/main/java/dev/braintrust/instrumentation/InstrumentationSemConv.java — lines 78–108 (tagOpenAIRequest: only model extracted), lines 163–205 (tagAnthropicRequest: only model extracted)
  • braintrust-sdk/instrumentation/genai_1_18_0/src/main/java/com/google/genai/BraintrustApiClient.java — lines 64–95 (tagSpan: comprehensive parameter extraction into metadata)
  • braintrust-sdk/instrumentation/openai_2_8_0/src/test/java/dev/braintrust/instrumentation/openai/v2_8_0/BraintrustOpenAITest.java — no test asserts generation parameters in metadata
  • braintrust-sdk/instrumentation/anthropic_2_2_0/src/test/java/dev/braintrust/instrumentation/anthropic/v2_2_0/BraintrustAnthropicTest.java — no test asserts generation parameters in metadata
主要言語
Java
スター
21
フォーク
5
平均マージ
2日 7時間
マージ済み PR(30日)
8

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

braintrustdata/braintrust-sdk-java のほかの issue

braintrustdata/braintrust-sdk-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。