Repository navigation
Deprecate bedrock instrumentation - #5266
DylanRussell wants to merge 10 commits into
Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-11-11 16:42 UTC Two things need attention:
Status above doesn't look right?
|
|
@DylanRussell I've asked codex to review the difference and spotted the following (2. was about cohere R models but these are gone):
1. Nova streaming: most response telemetry disappears This affects Contrib explicitly handles these envelopes and accumulates text, tool calls, finish reason, and usage. The standalone InvokeModel stream parser (/home/rm/src/opentelemetry-python-genai/instrumentation/opentelemetry-instrumentation-genai-bedrock/src/opentelemetry/instrumentation/genai/bedrock/stream.py:297) decodes the JSON, but its branches recognize Anthropic events and several legacy response formats. None recognize Nova’s envelopes. For the example above:
Tool calls in Nova streams are also missed. The span can finish successfully despite having no response details, so ordinary error monitoring would not reveal the loss. This gap is specific to Nova through InvokeModel streaming. Standalone’s separate ConverseStream parser handles these event shapes. Its InvokeModel streaming tests cover Anthropic, Titan, and some legacy formats, but contain no Nova case. The fix would require handling Nova envelopes in this parser, potentially sharing the existing Converse stream accumulation logic, with text, tool-call, usage, and capture-disabled tests. 3. Nova request settings: nested top-p and stop sequences disappear For an InvokeModel request containing: Contrib extracts all three settings. Standalone’s request extractor (/home/rm/src/opentelemetry-python-genai/instrumentation/opentelemetry-instrumentation-genai-bedrock/src/opentelemetry/instrumentation/genai/bedrock/extractors.py:469):
The resulting telemetry omits: This affects both streaming and non-streaming InvokeModel paths because they share the request extractor. Converse and ConverseStream use a different extractor and capture these settings. The correction is small: add the missing nested aliases while preserving valid zero values and existing precedence. 4. Mistral request settings: Mistral’s InvokeModel request can contain: Contrib explicitly maps Other recognized settings and the response remain available; the missing output is the stop-sequences attribute. This also affects both InvokeModel variants. The existing Mistral request test does not include Opened open-telemetry/opentelemetry-python-genai#1077 and open-telemetry/opentelemetry-python-genai#1076 for 3. and 4. 1. seems to be handled by open-telemetry/opentelemetry-python-genai#1016 |
Description
Deprecate the Amazon Bedrock extension in
opentelemetry-instrumentation-botocorein favor ofopentelemetry-instrumentation-genai-bedrock.Key changes:
DeprecationWarningwhen_BedrockRuntimeExtensionis initialized.opentelemetry-instrumentation-genai-bedrockis installed and active; if so, suppress the extension's handled operations in__init__so botocore only emits standard AWS SDK RPC spans, avoiding duplicate GenAI spans, events, and metrics.README.rstwith deprecation notice pointing users to the new package.Fixes Deprecate
bedrockinstrumentation package once new instrumentation inopentelemetry-python-genaiis ready #4999Type of change
Checklist:
tox -e precommittox -e typecheck