Skip to content

feat(boto3): Add ServiceExtension class - #7536

Open
pabloDeputter wants to merge 9 commits into
pablo/add-boto3-response-retry-error-attributesfrom
pablo/add-boto3-service-extension-class
Open

pabloDeputter wants to merge 9 commits into
pablo/add-boto3-response-retry-error-attributesfrom
pablo/add-boto3-service-extension-class

Conversation

@pabloDeputter

Copy link
Copy Markdown
Member

Description

Adds service-extension support to Boto3Integration. This keeps the generic Boto3 call lifecycle independent of individual AWS services.

  • Adds _ServiceExtension interface for service-specific behavior through _get_span_config(), _get_request_attributes(), and _get_response_attributes(). This allows for custom span operations/origin, request attributes, and response/error attributes. A future method can also inject trace context into service-specific payload, e.g. SQS message attributes.
  • Extensions are lazily imported (not sure whether this actually a good thing). Service modules are only imported on first use and falls back to generic behavior when service is unknown or broken.
  • Generic attributes and errors remain authoritative over service-specific ones.

Issues

Resolves #7477

@pabloDeputter
pabloDeputter added this pull request to stack #7500 September 18, 2026 13:31
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

130540 passed | ⏭️ 7171 skipped | Total: 137711 | Pass Rate: 94.79% | Execution Time: 454m 5s

All tests are passing successfully.

✅ Patch coverage is 85.00%. Project has 2557 uncovered lines.
✅ Project coverage is 90.29%. Comparing base (cc152e2) to head (2de4cfe).

Files with missing lines (3)
File Patch % Lines
sentry_sdk/integrations/boto3/_services/registry.py 61.11% ⚠️ 7 Missing and 1 partials
sentry_sdk/integrations/boto3/_instrumentation.py 93.75% ⚠️ 1 Missing and 2 partials
sentry_sdk/integrations/boto3/_services/base.py 88.89% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
+ Coverage    90.22%    90.29%    +0.07%
==========================================
  Files          194       201        +7
  Lines        25997     26323      +326
  Branches      9662      9752       +90
==========================================
+ Hits         23454     23766      +312
- Misses        2543      2557       +14
- Partials      1451      1461       +10

Generated by Codecov Action

Comment thread sentry_sdk/integrations/boto3/_services/registry.py
@pabloDeputter
pabloDeputter removed this pull request from stack #7500 September 18, 2026 14:34
@pabloDeputter
pabloDeputter added this pull request to stack #7539 September 18, 2026 14:35
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-service-extension-class branch from 499dbcc to d9609eb Compare September 18, 2026 15:06
@pabloDeputter
pabloDeputter removed this pull request from stack #7539 September 18, 2026 15:08
@pabloDeputter
pabloDeputter added this pull request to stack #7541 September 18, 2026 15:08
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-service-extension-class branch from d9609eb to ea505d1 Compare September 18, 2026 15:20
Comment thread sentry_sdk/integrations/boto3/_instrumentation.py
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-service-extension-class branch 2 times, most recently from 9068e22 to b9071e2 Compare September 21, 2026 15:42
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-service-extension-class branch from b9071e2 to 787cd71 Compare September 21, 2026 16:07
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-service-extension-class branch from 17d48a0 to 8ace874 Compare September 22, 2026 08:52
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-service-extension-class branch from 82e40da to 2de4cfe Compare September 22, 2026 09:18
@pabloDeputter
pabloDeputter marked this pull request as ready for review September 22, 2026 11:50
@pabloDeputter
pabloDeputter requested a review from a team as a code owner September 22, 2026 11:50
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.

feat(boto3): Add-service extension class

1 participant