René's URL Explorer Experiment


Title: feat(boto3): Instrument Bedrock Runtime Converse calls as gen_ai spans by sentry-junior[bot] · Pull Request #8186 · getsentry/sentry-python · GitHub

Open Graph Title: feat(boto3): Instrument Bedrock Runtime Converse calls as gen_ai spans by sentry-junior[bot] · Pull Request #8186 · getsentry/sentry-python

X Title: feat(boto3): Instrument Bedrock Runtime Converse calls as gen_ai spans by sentry-junior[bot] · Pull Request #8186 · getsentry/sentry-python

Description: Description This is the first of 3 stacked PRs that add AWS Bedrock Runtime gen_ai instrumentation to Boto3Integration, so Bedrock calls appear in AI Agents monitoring. Spans, ops, and attributes match the JS SDK's aws-sdk Bedrock Runtime extension (packages/server-utils/src/integrations/aws-sdk/services/bedrock-runtime.ts). This PR covers Converse, using the existing _services extension registry: span chat {modelId}, op gen_ai.chat, gen_ai.provider.name = aws.bedrock request model, max tokens, temperature, top_p, stop sequences (new SPANDATA.GEN_AI_REQUEST_STOP_SEQUENCES), finish reasons, and token usage adds a get_span_name() hook to _ServiceExtension Decisions the diff doesn't show: Origin auto.ai.boto3, not the generic auto.http.boto3. It follows the trace-origin spec (auto..). JS uses auto.ai.aws_sdk for the same spans. Other bedrock-runtime operations keep the generic HTTP span. Prompt/response capture honors the data_collection option. When data_collection is set, data_collection.gen_ai.inputs gates system instructions, input messages, and tool definitions, and data_collection.gen_ai.outputs gates output messages (text, reasoning, tool calls). Each is gated independently. Without data_collection, both require send_default_pii and the new Boto3Integration(include_prompts=True) option, which defaults to True. JS capture is in progress in getsentry/sentry-javascript#26118. Tool definitions are gated on inputs in both modes. This differs from Anthropic and OpenAI, which always record tool definitions when data_collection isn't set (a legacy branch kept until send_default_pii is deprecated). Input messages are truncated like Anthropic and OpenAI. When should_truncate_gen_ai_input() is true (gen_ai spans sent in transactions), truncate_and_annotate_messages reduces the history to the last message. The text, tool call arguments, and tool results of that message's parts are then capped at MAX_SINGLE_MESSAGE_CONTENT_CHARS in total, with the same ... suffix, in the Bedrock code: the shared helper only caps a top-level content, not parts. The original-length _meta annotation doesn't apply to gen_ai.input.messages yet, and teaching the shared helper about parts is a follow-up. Only the input messages are added after the span starts, by a new _ServiceExtension.get_span_start_attributes() hook, because truncation needs the started span. ignore_spans doesn't see them, and spans it drops skip that work. Max tokens, temperature, top_p, stop sequences, system instructions, and tool definitions stay request attributes. gen_ai.usage.input_tokens includes cache read/write tokens. Bedrock's inputTokens excludes them, so this differs from JS only for prompt-cached requests. Media blocks (image, document, video) aren't recorded. Like the rest of boto3, this never starts a transaction. Calls without a parent span aren't recorded. Stack: this PR → InvokeModel → streaming (ConverseStream + InvokeModelWithResponseStream). Heads-up: major/3.0 has diverged boto3 service-extension work (_services/*, _utils.py), so porting this there will need conflict resolution. Changelog note Converse spans change from http.client / auto.http.boto3 to gen_ai.chat / auto.ai.boto3, and their name changes from aws.bedrock-runtime.Converse to chat , which affects ignore_spans rules that match on the name. Boto3Integration is auto-enabled, so users with send_default_pii=True start sending Converse prompts and responses unless they set Boto3Integration(include_prompts=False) or configure data_collection. Issues Refs #5470 (PY-2085). bedrock-agent-runtime (InvokeAgent) is a follow-up. via @dcramer. -- View Session [Sentry]

Open Graph Description: Description This is the first of 3 stacked PRs that add AWS Bedrock Runtime gen_ai instrumentation to Boto3Integration, so Bedrock calls appear in AI Agents monitoring. Spans, ops, and attributes m...

X Description: Description This is the first of 3 stacked PRs that add AWS Bedrock Runtime gen_ai instrumentation to Boto3Integration, so Bedrock calls appear in AI Agents monitoring. Spans, ops, and attributes m...

Opengraph URL: https://github.com/getsentry/sentry-python/pull/8186

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b028fc88-2770-7efb-056e-d1522ca629bf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id847A:35E323:EE21C3:14E7620:6B0447A2
html-safe-nonceb6d4d0cb4dfedca832a71a2097c18d488ae4922e52d23577e53674451a70bf23
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDdBOjM1RTMyMzpFRTIxQzM6MTRFNzYyMDo2QjA0NDdBMiIsInZpc2l0b3JfaWQiOiI5MTUzMTIwMDYxNzQ4NDMwNzU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac55c17f3f22057ba84276d3dfa8d165adddb8bdc334c0f95bcb4e738d5feaf161
hovercard-subject-tagpull_request:5162907480
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/getsentry/sentry-python/pull/8186/files
twitter:imagehttps://avatars.githubusercontent.com/in/2960336?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/2960336?s=400&v=4
og:image:altDescription This is the first of 3 stacked PRs that add AWS Bedrock Runtime gen_ai instrumentation to Boto3Integration, so Bedrock calls appear in AI Agents monitoring. Spans, ops, and attributes m...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/pull/8186/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fpull%2F8186%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fpull%2F8186%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/pull/8186/files
Reloadhttps://github.com/getsentry/sentry-python/pull/8186/files
Reloadhttps://github.com/getsentry/sentry-python/pull/8186/files
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues340 (340)https://github.com/getsentry/sentry-python/issues
Pull requests35 (35)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgetsentry%2Fsentry-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgetsentry%2Fsentry-python%2Fissues%2Fnew%2Fchoose
sentry-juniorhttps://github.com/apps/sentry-junior
masterhttps://github.com/getsentry/sentry-python/tree/master
junior/boto3-bedrock-conversehttps://github.com/getsentry/sentry-python/tree/junior/boto3-bedrock-converse
Conversation 5 https://github.com/getsentry/sentry-python/pull/8186
Commits 7 https://github.com/getsentry/sentry-python/pull/8186/commits
Checks 169 https://github.com/getsentry/sentry-python/pull/8186/checks
Files changed https://github.com/getsentry/sentry-python/pull/8186/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/8186/files
feat(boto3): Instrument Bedrock Runtime Converse calls as gen_ai spans https://github.com/getsentry/sentry-python/pull/8186/files#top
Show all changes 7 commits https://github.com/getsentry/sentry-python/pull/8186/files
2212084 feat(boto3): Instrument Bedrock Runtime Converse calls as gen_ai spans sentry-junior[bot] Nov 4, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/22120847cfc9abdda703987510d72cf85baac04d
2bd07e4 feat(boto3): Gate Bedrock prompts on data_collection and include_prompts sentry-junior[bot] Nov 4, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/2bd07e4f773f0add5fdb6a239a03c9ed51314920
1197d69 feat(boto3): Truncate Bedrock input messages like the other gen_ai in… sentry-junior[bot] Nov 4, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/1197d69b3065b1658e719ca76b245ee8d88483fb
1057e9c fix(boto3): Truncate the last Bedrock input message's text sentry-junior[bot] Nov 5, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/1057e9cfc1f08a148192aa520f036ab784370a5d
f2a2cbc fix(boto3): Truncate the last Bedrock message's tool calls and results sentry-junior[bot] Nov 5, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/f2a2cbc112da13b7d66302c60da0eda6f2e76471
47f57e0 docs(boto3): Describe the shared Bedrock last-message truncation limit sentry-junior[bot] Nov 5, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/47f57e02bb668015d6430624796fddf4d8f481d1
e8f6930 fix(boto3): Truncate the last Bedrock message's JSON tool calls and r… sentry-junior[bot] Nov 5, 2026 https://github.com/getsentry/sentry-python/pull/8186/commits/e8f6930870ee5ea0019ce6e51214b22981c3302d
Clear filters https://github.com/getsentry/sentry-python/pull/8186/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/8186/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/8186/files
_types.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-e3349c1b1ad2cbd12844ebfa0e2210f645cfb5c75cea5ff2dbaa769e35becd9f
consts.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-719f41f07f1275f8a1b02085180aa234b257226fc976d776ebef5d8dff9db017
__init__.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-2cfe4b72f14a798f54563e1082d67c0e551b5be15e31ef2303cf07e04955db35
_instrumentation.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-5d72e4fbd709067f1b6c291d002a90436d530ee2837778e59f2b76c630264ea3
base.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-f575de59e6e13d55e371295b60d2add991777271bbaf41f9743229460208fe51
bedrock_runtime.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-43f466f3e11d254754d2935df7d1b46275f200462642e57d082240890e6edacd
registry.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-839d4c4d843125806deed38e1c59a0b0f7d017e1e37573cdaa7c81b83affa43a
consts.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-19ea66a39e778f05536413f0c4bd1cc6387e2e5a6dbf1122d3239e1961f86cde
test_bedrock_runtime.py https://github.com/getsentry/sentry-python/pull/8186/files#diff-431dbe73ff4d6b4b842f1d4d758a7c82ed4b96702c9647addd00d0a4c1b72b4d
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/_types.pyhttps://github.com/getsentry/sentry-python/pull/8186/files#diff-e3349c1b1ad2cbd12844ebfa0e2210f645cfb5c75cea5ff2dbaa769e35becd9f
View file https://github.com/getsentry/sentry-python/blob/e8f6930870ee5ea0019ce6e51214b22981c3302d/sentry_sdk/_types.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/8186/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/8186/files#diff-e3349c1b1ad2cbd12844ebfa0e2210f645cfb5c75cea5ff2dbaa769e35becd9f
https://github.com/getsentry/sentry-python/pull/8186/files#diff-e3349c1b1ad2cbd12844ebfa0e2210f645cfb5c75cea5ff2dbaa769e35becd9f
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/consts.pyhttps://github.com/getsentry/sentry-python/pull/8186/files#diff-719f41f07f1275f8a1b02085180aa234b257226fc976d776ebef5d8dff9db017
View file https://github.com/getsentry/sentry-python/blob/e8f6930870ee5ea0019ce6e51214b22981c3302d/sentry_sdk/consts.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/8186/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/8186/files#diff-719f41f07f1275f8a1b02085180aa234b257226fc976d776ebef5d8dff9db017
https://github.com/getsentry/sentry-python/pull/8186/files#diff-719f41f07f1275f8a1b02085180aa234b257226fc976d776ebef5d8dff9db017
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/integrations/boto3/__init__.pyhttps://github.com/getsentry/sentry-python/pull/8186/files#diff-2cfe4b72f14a798f54563e1082d67c0e551b5be15e31ef2303cf07e04955db35
View file https://github.com/getsentry/sentry-python/blob/e8f6930870ee5ea0019ce6e51214b22981c3302d/sentry_sdk/integrations/boto3/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/8186/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/8186/files#diff-2cfe4b72f14a798f54563e1082d67c0e551b5be15e31ef2303cf07e04955db35
https://github.com/getsentry/sentry-python/pull/8186/files#diff-2cfe4b72f14a798f54563e1082d67c0e551b5be15e31ef2303cf07e04955db35
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/integrations/boto3/_instrumentation.pyhttps://github.com/getsentry/sentry-python/pull/8186/files#diff-5d72e4fbd709067f1b6c291d002a90436d530ee2837778e59f2b76c630264ea3
View file https://github.com/getsentry/sentry-python/blob/e8f6930870ee5ea0019ce6e51214b22981c3302d/sentry_sdk/integrations/boto3/_instrumentation.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/8186/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/8186/files#diff-5d72e4fbd709067f1b6c291d002a90436d530ee2837778e59f2b76c630264ea3
https://github.com/getsentry/sentry-python/pull/8186/files#diff-5d72e4fbd709067f1b6c291d002a90436d530ee2837778e59f2b76c630264ea3
https://github.com/getsentry/sentry-python/pull/8186/files#diff-5d72e4fbd709067f1b6c291d002a90436d530ee2837778e59f2b76c630264ea3
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/8186/files
https://github.com/getsentry/sentry-python/pull/8186/files#diff-5d72e4fbd709067f1b6c291d002a90436d530ee2837778e59f2b76c630264ea3
https://github.com/getsentry/sentry-python/blob/master/.github/CODEOWNERS#L1
sentry_sdk/integrations/boto3/_services/base.pyhttps://github.com/getsentry/sentry-python/pull/8186/files#diff-f575de59e6e13d55e371295b60d2add991777271bbaf41f9743229460208fe51
View file https://github.com/getsentry/sentry-python/blob/e8f6930870ee5ea0019ce6e51214b22981c3302d/sentry_sdk/integrations/boto3/_services/base.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-python/pull/8186/{{ revealButtonHref }}
https://github.com/getsentry/sentry-python/pull/8186/files#diff-f575de59e6e13d55e371295b60d2add991777271bbaf41f9743229460208fe51
https://github.com/getsentry/sentry-python/pull/8186/files#diff-f575de59e6e13d55e371295b60d2add991777271bbaf41f9743229460208fe51
https://github.com/getsentry/sentry-python/pull/8186/files#diff-f575de59e6e13d55e371295b60d2add991777271bbaf41f9743229460208fe51
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/8186/files
Please reload this pagehttps://github.com/getsentry/sentry-python/pull/8186/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.