Skip to content

feat(bedrock): Set gen_ai.input.messages attribute - #8242

Merged
alexander-alderman-webb merged 4 commits into
masterfrom
webb/bedrock/input-messages
Nov 11, 2026
Merged

alexander-alderman-webb merged 4 commits into
masterfrom
webb/bedrock/input-messages

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Transform parts to adhere to the OTel schema, omitting fields in the OTel parts where the information is not available.

https://github.com/open-telemetry/semantic-conventions-genai/blob/main/model/gen-ai/gen-ai-input-messages.json

Skip messages for which OTel does not have a well-defined part type.

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/input-messages branch 3 times, most recently from 068a53c to 6ec7171 Compare November 11, 2026 10:48
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review November 11, 2026 10:49
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner November 11, 2026 10:49

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 139110 passed | ⏭️ 7765 skipped | Total: 146875 | Pass Rate: 94.71% | Execution Time: 454m 59s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 82.69% (86 of 104 changed executable lines covered; target 80%).
Project statement coverage is 90.24% (unchanged from base (72a02b1) to head (3172ca7)).

Changed files with executable lines (1)
File Patch coverage Changed executable lines
sentry_sdk/integrations/boto3/_services/bedrock.py 82.69% 86/104 covered; missed: 183, 187, 192, 203, 204, 224, 225, 245, 246, 264, 265, 290, 291, 316, 317, 336, 345, 346; partial branches: 182, 186, 191, 202, 206, 208, 219, 239, 263, 289, 315, 331, 344, 352
Coverage diff
@@            Coverage Diff             @@
##        master     #8242       +/-##
==========================================
  Coverage    90.24%    90.24%        —%
==========================================
  Files          203       203         —
  Tracked lines     27125     27229      +104
  Branches     10142     10198       +56
==========================================
+ Hits         24478     24571       +93
- Misses        2647      2658       +11
- Partials      1541      1554       +13

Generated by Coverage Action

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, see one comment


if BOTOCORE_VERSION >= Version("1.34.131"):
messages.append(
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these extra messages the same as in the test above? Can we extract them to constants? Including the whole dicts in the tests makes them hard to read.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I want to bundle messages and expected transformed messages together so I've made it a fixture.

Base automatically changed from webb/bedrock/system-instructions to master November 11, 2026 12:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3172ca7. Configure here.

Comment thread sentry_sdk/_types.py Resolved
@alexander-alderman-webb
alexander-alderman-webb enabled auto-merge (squash) November 11, 2026 12:56
@alexander-alderman-webb
alexander-alderman-webb merged commit f35474a into master Nov 11, 2026
170 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/bedrock/input-messages branch November 11, 2026 12:59
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.

2 participants