Skip to content

feat(telemetry): add canonical GenAI provider names#105

Merged
dialupdisaster merged 1 commit into
mainfrom
feat/genai-provider-name
Jul 16, 2026
Merged

feat(telemetry): add canonical GenAI provider names#105
dialupdisaster merged 1 commit into
mainfrom
feat/genai-provider-name

Conversation

@dialupdisaster

Copy link
Copy Markdown
Contributor

Summary

  • normalize known opencode provider IDs to canonical gen_ai.provider.name values
  • preserve unknown and custom provider IDs unchanged
  • add the canonical attribute to LLM spans and api_request/api_error logs without changing existing raw provider attributes
  • cover Bedrock, Azure OpenAI, Gemini, Vertex AI, Mistral AI, xAI, and fallback behavior

This also provides a shared genAiProviderName helper for GenAI metrics such as the histogram proposed in #102.

Testing

  • bun run typecheck
  • bun test (311 passing)
  • bun run lint
  • bun run check:jsdoc-coverage
  • git diff --check

@github-actions

Copy link
Copy Markdown
Contributor
  • [P2] src/util.ts:27 — Plain-object lookup includes inherited properties. Custom IDs such as __proto__, constructor, or toString return non-string prototype values instead of being preserved, producing invalid OTel attributes. Use an own-property check, null-prototype object, or Map, and add a regression test.

Unable to run checks because bun is unavailable in this environment.

@dialupdisaster dialupdisaster merged commit 4c7e539 into main Jul 16, 2026
7 checks passed
@dialupdisaster dialupdisaster deleted the feat/genai-provider-name branch July 16, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant