Skip to content

feat(bedrock): emit streaming latency span attrs - #36

Merged
sayonfortify merged 1 commit into
fr-v0.52.6.xfrom
codex/bedrock-streaming-latency-attrs
Jun 19, 2026
Merged

feat(bedrock): emit streaming latency span attrs#36
sayonfortify merged 1 commit into
fr-v0.52.6.xfrom
codex/bedrock-streaming-latency-attrs

Conversation

@sayonfortify

Copy link
Copy Markdown

Adds FortifyRoot streaming latency span attributes for Bedrock streaming paths.

  • Sets fortifyroot.llm.streaming.time_to_first_token_ms and fortifyroot.llm.streaming.time_to_generate_ms on Invoke-with-response-stream and ConverseStream spans.
  • Measures request-start -> first text and first text -> completion using the existing streaming wrappers.
  • Leaves attrs absent for empty streams/non-streaming calls; no fake zero values.
  • Keeps existing safety masking, guardrail, usage, prompt-caching, event emission, and span-end behavior intact.
  • Adds deterministic unit coverage for Invoke and Converse wrappers, including empty-stream omission.

Validation:

  • python3 -m py_compile for changed Bedrock source/test files
  • PYTHONPATH=packages/opentelemetry-instrumentation-bedrock:packages/opentelemetry-instrumentation-fortifyroot:packages/opentelemetry-semantic-conventions-ai conda run -n py3.12 python -m pytest packages/opentelemetry-instrumentation-bedrock/tests/test_safety_hooks.py -q
    • 22 passed
  • git diff --check clean

Next per vendoring SOP after merge: tag the fork, then run ocelle-py/scripts/vendor.sh from the tag before the Ocelle vendored PR.

@sayonfortify
sayonfortify merged commit 82ff991 into fr-v0.52.6.x Jun 19, 2026
10 checks passed
@sayonfortify
sayonfortify deleted the codex/bedrock-streaming-latency-attrs branch June 19, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant