Anthropic: emit gen_ai.provider.name instead of deprecated gen_ai.system#111
Conversation
289ea1a to
f38e7e5
Compare
|
|
There was a problem hiding this comment.
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=anthropicin request span attributes instead of deprecatedgen_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. |
|
Can you please sign the certificate approving your contribution. Thanks a lot for your contribution. |
Signed-off-by: FugoP <264910004+AgentGymLeader@users.noreply.github.com> Assisted-by: OpenAI Codex Assisted-by: Claude Opus 4.8
f38e7e5 to
08e06df
Compare
|
Rebased on main and fixed the async test that broke in the merge queue — the extractor now emits |
|
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. 🙏 |
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 togen_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.systememission. Withweaveron PATH, both Anthropic conformance scenarios now pass,pyrightis 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_SYSTEMreferences 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.systemrather 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.