traceloop / traceloop/openllmetry
Bedrock: global. cross-region inference profile resolves to vendor "global", dropping span attributes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.1k
- Avg merge
- 8d 14h
- Merged PRs (30d)
- 2
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at packages/opentelemetry-instrumentation-bedrock/opentelemetry/instrumentation/bedrock/init.py:1009 and inspect _cross_region_check alongside the established prefix handling from #2785. Add regression coverage for global. Claude Sonnet 4 inference profiles, then run the Bedrock instrumentation tests. Done means the vendor and model resolve correctly and span attributes are retained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100