Repository navigation
feat(semconv): add google decision.system/provider and llm.system for the Gemini Decisions API - #4470
Conversation
|
The factory recommends ❌ Request changes for 37c9406 and labeled this pull request |
@arizeai/openinference-core
@arizeai/openinference-genai
@arizeai/openinference-instrumentation-anthropic
@arizeai/openinference-instrumentation-bedrock
@arizeai/openinference-instrumentation-bedrock-agent-runtime
@arizeai/openinference-instrumentation-beeai
@arizeai/openinference-instrumentation-claude-agent-sdk
@arizeai/openinference-instrumentation-langchain
@arizeai/openinference-instrumentation-langchain-v0
@arizeai/openinference-instrumentation-mcp
@arizeai/openinference-instrumentation-openai
@arizeai/openinference-instrumentation-openai-agents
@arizeai/openinference-instrumentation-typesafe
@arizeai/openinference-semantic-conventions
@arizeai/openinference-tanstack-ai
@arizeai/openinference-vercel
commit: |
There was a problem hiding this comment.
❌ 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 | ✅ Pass | ✅ 0 |
Needs attention
- ❌ Fit: says "Closes #4288", but
spec/spans/decision.mdneither notes the future Vertex AI row as an open item nor settles theinput_tokens_by_modalityquestion ⚠️ Checks (Not run): Java:openinference-semantic-conventions:test(Gradle can't resolve plugins offline); Gogo testneeds 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, weavercheck-generated,test,check-parityandcheck(against the main baseline), JS build,type:check,lintandfmt:check, andpnpm run -r test. One langchain streaming test times out the same way on main.⚠️ Non-blocking: GenAI dual-write has no mapping for the newllm.system=google(no diff line)⚠️ Risk (Low): backwards compatibility: new members onLLMSystem,DecisionSystemandDecisionProvidercan 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.
Closes #4288.
Adds the well-known
googlevalue todecision.systemanddecision.providerfor Google's Gemini Decisions API (gemini-decision-1), and addsgoogle("Gemini Developer API") tollm.systemso the decision value has anllm.systemcounterpart to alias.Note on the issue vs. current
mainThe issue references
spec/decision_spans.mdandspec/semantic_conventions.md, butmainhas since migrated the semantic conventions to a Weaver codegen pipeline. The source of truth is now the model undersemantic 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 viamake -C semantic-conventions generate.Design decision:
googleadded tollm.systemEvery
decision.systemvalue must alias anllm.systemvalue.llm.systemhadvertexaibut nogoogle, andvertexaiis wrong for this API because it is Developer-API-only. Per the issue's open question, I kept the alias invariant intact by addinggoogletollm.systemand aliasingdecision.system = googleto it.llm.provideralready hadgoogle, sodecision.provider = googlealiases the existing value.