Skip to content

Anthropic: emit gen_ai.provider.name instead of deprecated gen_ai.system#111

Open
AgentGymLeader wants to merge 1 commit into
open-telemetry:mainfrom
AgentGymLeader:fix/anthropic-gen-ai-provider-name
Open

Anthropic: emit gen_ai.provider.name instead of deprecated gen_ai.system#111
AgentGymLeader wants to merge 1 commit into
open-telemetry:mainfrom
AgentGymLeader:fix/anthropic-gen-ai-provider-name

Conversation

@AgentGymLeader

Copy link
Copy Markdown

Fixes #39.

Anthropic spans were still emitting the deprecated gen_ai.system, which makes the latest GenAI conformance check fail. This switches the span attribute to gen_ai.provider.name=anthropic, matching the generated semconv enum and the provider-name pattern already used elsewhere in the repo.

I also un-skipped the two Anthropic conformance scenarios that were only skipped for the legacy gen_ai.system emission. With weaver on PATH, both Anthropic conformance scenarios now pass, pyright is clean, and the regular latest-version Anthropic test env passes.

I checked the rest of the Anthropic package as well: there are no remaining gen_ai.system / GEN_AI_SYSTEM references in spans, metrics, sync/async, or streaming paths, so the emission stays consistent.

This targets the latest/experimental conformance path and does not change any legacy-default behavior. I dropped gen_ai.system rather than dual-emitting it because the latest semantic convention should emit the latest attribute, but I'm happy to keep both during the migration window if maintainers prefer that.

Copilot AI review requested due to automatic review settings June 6, 2026 11:50
@AgentGymLeader AgentGymLeader requested a review from a team as a code owner June 6, 2026 11:50
@AgentGymLeader AgentGymLeader force-pushed the fix/anthropic-gen-ai-provider-name branch from 289ea1a to f38e7e5 Compare June 6, 2026 11:50
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 6, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: AgentGymLeader / name: FugoP (f38e7e5)

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Anthropic GenAI span attribute emission to use the newer gen_ai.provider.name attribute instead of the deprecated gen_ai.system, and aligns tests/conformance accordingly.

Changes:

  • Emit gen_ai.provider.name=anthropic in request span attributes instead of deprecated gen_ai.system.
  • Update sync span attribute assertions to validate the new attribute/key.
  • Re-enable conformance scenarios by removing legacy-attribute skip markers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_sync_messages.py Updates span assertions to validate gen_ai.provider.name instead of deprecated gen_ai.system.
instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_conformance.py Removes skip marks so conformance scenarios now run with the updated attribute behavior.
instrumentation/opentelemetry-instrumentation-genai-anthropic/src/opentelemetry/instrumentation/genai/anthropic/messages_extractors.py Switches emitted attribute from gen_ai.system to gen_ai.provider.name in request attributes.
instrumentation/opentelemetry-instrumentation-genai-anthropic/.changelog/111.fixed Adds changelog entry documenting the attribute change.

@eternalcuriouslearner

Copy link
Copy Markdown
Contributor

Can you please sign the certificate approving your contribution. Thanks a lot for your contribution.

@lmolkova lmolkova added this pull request to the merge queue Jun 13, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 13, 2026
Signed-off-by: FugoP <264910004+AgentGymLeader@users.noreply.github.com>

Assisted-by: OpenAI Codex

Assisted-by: Claude Opus 4.8
@AgentGymLeader AgentGymLeader force-pushed the fix/anthropic-gen-ai-provider-name branch from f38e7e5 to 08e06df Compare June 15, 2026 19:57
@AgentGymLeader

Copy link
Copy Markdown
Author

Rebased on main and fixed the async test that broke in the merge queue — the extractor now emits gen_ai.provider.name, and test_async_messages.py still asserted the old gen_ai.system. Green locally. Ready to re-queue whenever.

@AgentGymLeader

Copy link
Copy Markdown
Author

Hi @lmolkova and team! The PR has received approvals — thank you! It looks like only EasyCLA has run so far. Could someone please help trigger the required CI checks when you have a moment? Really appreciate the reviews and your time. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic instrumentation: instrumentation conformance

5 participants