Skip to content

feat(semconv): add google decision.system/provider and llm.system for the Gemini Decisions API - #4470

Merged
MoraVigoMalusardi merged 1 commit into
mainfrom
mora/decision-google-semconv
Nov 25, 2026
Merged

MoraVigoMalusardi merged 1 commit into
mainfrom
mora/decision-google-semconv

Conversation

@MoraVigoMalusardi

Copy link
Copy Markdown
Contributor

Closes #4288.

Adds the well-known google value to decision.system and decision.provider for Google's Gemini Decisions API (gemini-decision-1), and adds google ("Gemini Developer API") to llm.system so the decision value has an llm.system counterpart to alias.

Note on the issue vs. current main

The issue references spec/decision_spans.md and spec/semantic_conventions.md, but main has since migrated the semantic conventions to a Weaver codegen pipeline. The source of truth is now the model under semantic conventions/model/; the prose spec, the registry docs, and all four language packages (Python, Go, TypeScript, Java) are generated from it. So the substantive change here is two model YAML files; everything else is regenerated via make -C semantic-conventions generate.

Design decision: google added to llm.system

Every decision.system value must alias an llm.system value. llm.system had vertexai but no google, and vertexai is wrong for this API because it is Developer-API-only. Per the issue's open question, I kept the alias invariant intact by adding google to llm.system and aliasing decision.system = google to it. llm.provider already had google, so
decision.provider = google aliases the existing value.

@MoraVigoMalusardi
MoraVigoMalusardi requested review from a team as code owners November 25, 2026 20:26
@MoraVigoMalusardi MoraVigoMalusardi added the factory-review to be reviewed by the software factory label Nov 25, 2026
@openinference-factory

openinference-factory Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The factory recommends ❌ Request changes for 37c9406 and labeled this pull request factory-request-changes. Read the review · session sesn_018fnGRU4U5Z5ASWZ43vtM2w

cc @MoraVigoMalusardi

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@arizeai/openinference-core

npm i https://pkg.pr.new/@arizeai/openinference-core@4470

@arizeai/openinference-genai

npm i https://pkg.pr.new/@arizeai/openinference-genai@4470

@arizeai/openinference-instrumentation-anthropic

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-anthropic@4470

@arizeai/openinference-instrumentation-bedrock

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-bedrock@4470

@arizeai/openinference-instrumentation-bedrock-agent-runtime

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-bedrock-agent-runtime@4470

@arizeai/openinference-instrumentation-beeai

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-beeai@4470

@arizeai/openinference-instrumentation-claude-agent-sdk

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-claude-agent-sdk@4470

@arizeai/openinference-instrumentation-langchain

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-langchain@4470

@arizeai/openinference-instrumentation-langchain-v0

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-langchain-v0@4470

@arizeai/openinference-instrumentation-mcp

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-mcp@4470

@arizeai/openinference-instrumentation-openai

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-openai@4470

@arizeai/openinference-instrumentation-openai-agents

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-openai-agents@4470

@arizeai/openinference-instrumentation-typesafe

npm i https://pkg.pr.new/@arizeai/openinference-instrumentation-typesafe@4470

@arizeai/openinference-semantic-conventions

npm i https://pkg.pr.new/@arizeai/openinference-semantic-conventions@4470

@arizeai/openinference-tanstack-ai

npm i https://pkg.pr.new/@arizeai/openinference-tanstack-ai@4470

@arizeai/openinference-vercel

npm i https://pkg.pr.new/@arizeai/openinference-vercel@4470

commit: 37c9406

@openinference-factory openinference-factory Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Factory review of 37c9406: Request changes

Fit is Partial: the PR says it closes #4288 but leaves two of the issue's spec items undone.

Fit Checks Tests Blocking Non-blocking Risk Depth
❌ Partial ⚠️ Not run ✅ Pass ✅ 0 ⚠️ 1 ⚠️ Low ⚠️ Deep

Needs attention

  • ❌ Fit: says "Closes #4288", but spec/spans/decision.md neither notes the future Vertex AI row as an open item nor settles the input_tokens_by_modality question
  • ⚠️ Checks (Not run): Java :openinference-semantic-conventions:test (Gradle can't resolve plugins offline); Go go test needs a Go 1.25 toolchain, which the sandbox can't download (passes on Go 1.24 in a temp copy). Passed: tox -e ci-semconv, weaver check-generated, test, check-parity and check (against the main baseline), JS build, type:check, lint and fmt:check, and pnpm run -r test. One langchain streaming test times out the same way on main.
  • ⚠️ Non-blocking: GenAI dual-write has no mapping for the new llm.system=google (no diff line)
  • ⚠️ Risk (Low): backwards compatibility: new members on LLMSystem, DecisionSystem and DecisionProvider can break a consumer's exhaustive switch; additive otherwise
  • ⚠️ Depth (Deep): changes the semantic-conventions model, spec/, and the public enums of all four semconv packages
Details

Intent: Add the well-known value google to decision.system and decision.provider for the Gemini Decisions API (gemini-decision-1). Also add google ("Gemini Developer API") to llm.system, so the decision value aliases an llm.system value (#4288).
Fit: The model changes and the regenerated Python, JS, Go and Java enums, registry docs and spec tables do what the PR body describes. The spec gains the Gemini bullet, the system/provider row, the token mapping and the note that the response does not echo the model.
Fit (gaps): #4288 also asks to note that the Vertex AI row (likely google/google) is an open item for when Vertex support ships. It asks to settle input_tokens_by_modality too: drop it for now or propose decision.token_count.input_details.<modality>. Neither appears in spec/spans/decision.md.
Fit (fix): Add both notes to spec/spans/decision.md (one sentence each near the Gemini bullet or the System versus Provider table). Alternatively, change "Closes #4288" to a reference so the issue stays open for them.
Fit (other items): The optional cleanup of the stale OpenAI bullet is optional, so it is not counted. The Vercel checklist item already holds on this commit: normalizeDecisionProviderName (js/packages/openinference-vercel/src/utils.ts:1212-1215) maps google.decision to google.
Verified: tox run -e ci-semconv passed: ruff format, ruff check, mypy, and 23 tests.
Verified: With main's trace/__init__.py in place, the three updated test_enums.py value tests fail, so the added assertions cover the change.
Verified: Weaver 0.28.0 (pinned): make check-generated reports every generated file up to date with the model. make test passed, make check-parity reported no unexpected drift, and make check BASELINE_REGISTRY=<main model> passed every policy, including the backwards-compatibility ones.
Verified: JS: pnpm run -r build, pnpm run type:check, pnpm run lint and pnpm run fmt:check passed.
Verified: pnpm run -r --no-bail test passed except langchain's "should add attributes to llm spans when streaming". That test times out identically on main (the sandbox has no network), so it is unrelated. The semconv package has no JS tests.
Verified: Go: gofmt is clean, and go test passes in a temp copy with the go directive lowered to 1.24.
Not verified: Java SemanticConventionsTest: Gradle needs the network to resolve plugins.
Not verified: Go on the required 1.25 toolchain.
Not verified: The Python instrumentor matrix that CI runs for a semconv change. Instrumentor code does not change, and no Python or JS code references the new members.
Findings without a diff line: Non-blocking. google is now a well-known llm.system value, but neither GenAI converter maps it when llm.provider is absent.
Finding evidence (Python): python/openinference-instrumentation/src/openinference/instrumentation/_genai_conversion.py:311-317 only handles system == VERTEXAI without a provider. A span with only llm.system=google falls through to return system or provider (line 351) and emits gen_ai.provider.name=google.
Finding evidence (JS): js/packages/openinference-core/src/trace/genai/getGenAIAttributes.ts:85-91 (PROVIDER_NAME_BY_SYSTEM) has no LLMSystem.GOOGLE entry, so it emits the same raw google. google is not an OTel well-known provider name.
Finding fix: Map system google to gcp.gemini (the OTel value for the Gemini Developer API; _genai_attributes.py:67), or to gcp.gen_ai to match the llm.provider=google branch. Add a test in each language, or open a follow-up issue.
Risk: side effects none, performance none, backwards compatibility low, from the Python and JS reviewers.
Risk (pre-existing): Both reviewers note that LangChain (Python _tracer.py:1632-1634, JS langSmithParams.ts:62-64) and llama-index already map the Gemini Developer API to vertexai. That predates this PR and is not counted, but it is worth a follow-up now that google exists.

Graded against the review criteria.

@openinference-factory openinference-factory Bot added factory-request-changes The factory review recommends requesting changes and removed factory-review to be reviewed by the software factory labels Nov 25, 2026
@MoraVigoMalusardi
MoraVigoMalusardi merged commit 2d10c59 into main Nov 25, 2026
178 checks passed
@MoraVigoMalusardi
MoraVigoMalusardi deleted the mora/decision-google-semconv branch November 25, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

factory-request-changes The factory review recommends requesting changes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[instrumentation] add the Gemini Decisions API (gemini-decision-1) to decision spans and the well-known google decision values

2 participants