Skip to content

Bedrock: global. cross-region inference profile resolves to vendor "global", dropping span attributes #4234

Description

@kimnamu

Thanks for OpenLLMetry — the Bedrock instrumentation has been solid for our cross-region setups.

What happens

AWS added the global. cross-region inference profile prefix (currently Claude Sonnet 4 — AWS docs). _cross_region_check recognizes us / us-gov / eu / apac but not global, so global.anthropic.claude-sonnet-4-... falls to the else branch and resolves to model_vendor="global" with the model name keeping its anthropic. prefix.

  • packages/opentelemetry-instrumentation-bedrock/opentelemetry/instrumentation/bedrock/__init__.py:1009

Impact

span_utils dispatches on model_vendor with no else clause (set_model_message_span_attributes, set_model_choice_span_attributes, _set_finish_reasons_unconditionally), so prompt, completion, and finish-reason attributes are silently dropped, and gen_ai.request.model is polluted with the anthropic. prefix — only on global. Claude Sonnet 4 traces.

Fix

Add "global" to the prefix list in _cross_region_check (the established list introduced in #2785). Happy to open a PR with a regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions