LLM monetary costs are recorded with no currency — ingest OTel GenAI gen_ai.usage.cost.currency
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
Start in apps/opik-backend/.../domain/mapping/otel/GenAIMappingRules.java, reading the existing gen_ai.usage.cost rule and its COST/METADATA handling. Then inspect OpenTelemetryMapperTest.java, especially genAiUsageCostExtractedIntoTotalEstimatedCost, and add coverage for gen_ai.usage.cost with gen_ai.usage.cost.currency. Done means the currency is retained alongside the amount without changing totalEstimatedCost or gen_ai.cost.* behavior.
索引モデルが issue の本文から書いたものです。
説明
Costs without a unit of account
Opik already collects LLM monetary costs, in two shapes:
-
A pre-computed total from
gen_ai.usage.cost, routed to the span's
totalEstimatedCost:// apps/opik-backend/.../domain/mapping/otel/GenAIMappingRules.java .rule("gen_ai.usage.cost").source(SOURCE) .outcome(OpenTelemetryMappingRule.Outcome.COST).spanType(SpanType.llm).build(),guarded by
genAiUsageCostExtractedIntoTotalEstimatedCostin
OpenTelemetryMapperTest.java(the fix for the earlier bug where a double cost
was "routed there and silently dropped"). -
gen_ai.cost.*attributes (total_cost/input_cost/output_cost) captured
into span metadata (OpenTelemetryMapperTest.java).
In both paths the value is a bare number. Nothing records what currency it is in. For
anyone who self-hosts Opik, ingests traces billed in a non-USD currency, or compares
cost across deployments, the number is uninterpretable and cross-deployment cost
reconciliation is impossible.
The standard direction
The OpenTelemetry GenAI semantic-conventions working group is standardizing this
exactly (there is no OTel convention for GenAI cost today; each vendor rolls its own).
The open proposal
add per-operation cost conventions (gen_ai.usage.cost.*) #443
defines:
gen_ai.usage.cost.amount(double) — the monetary cost at recording timegen_ai.usage.cost.currency(string) — the ISO 4217 code, conditionally required when amount is setgen_ai.usage.cost.source(enumprovider | local) — provenance
So the attribute a trace should carry beside gen_ai.usage.cost is
gen_ai.usage.cost.currency, and the OTel GenAI mapper is the natural place to map it.
Suggested scope
Consider ingesting gen_ai.usage.cost.currency alongside the existing
gen_ai.usage.cost handling in GenAIMappingRules.java (map it to COST/METADATA so
the unit rides with the amount), and keeping the value additive — no change to the
totalEstimatedCost number or to gen_ai.cost.* behavior. A test alongside
genAiUsageCostExtractedIntoTotalEstimatedCost asserting that a span with
gen_ai.usage.cost + gen_ai.usage.cost.currency retains both the amount and its unit
would lock it in.
Why it helps
- Cost becomes interpretable: the number names its unit of account (USD today, any ISO
4217 code later) without changing the amount logic. - Brings the backend's handling in line with the emerging OTel GenAI standard, where
currency is required whenever an amount is set. - Matters to any per-trace cost-accounting or billing workflow that consumes Opik
spans.
Happy to open a PR on the backend mapper with tests if this scope looks right.
- 主要言語
- Python
- スター
- 22.4k
- フォーク
- 1.8k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 483
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
comet-ml/opik のほかの issue
-
Bug Integrations Python-SDK
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
comet-ml/opik#9101 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Streamed tool calls missing from track_litellm traces対応中かも @pcbeingused333 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
comet-ml/opik#9089 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Streamed Gemini traces lose function calls (and text next to them)再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンBug Integrations Python-SDK
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
comet-ml/opik#9069 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: JSON encoder does not detect cycles in native containers対応中かも @Kayvan-Zahiri が 2 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
comet-ml/opik#9206 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[FR]: Add Pixeltable integration page (OpenTelemetry)対応中かも @pierrebrunelle が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
comet-ml/opik#9204 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Arekkazu/sgpmp-backend#744 ·
メンテナーはふだん 1 日以内に返信
-
agent/reviewer
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
projectbluefin/utah-packages#634 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue help wanted
難易度 2/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
home-assistant/core#188613 ·
メンテナーはふだん 1 日以内に返信
-
Websiteオープンgood first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
TanbirRamim/open-source-radar#314 ·
メンテナーはふだん 1 日以内に返信