Skip to content

feat(boto3): Support span streaming - #6193

Merged
alexander-alderman-webb merged 23 commits into
masterfrom
webb/boto3/span-first
May 6, 2026
Merged

feat(boto3): Support span streaming#6193
alexander-alderman-webb merged 23 commits into
masterfrom
webb/boto3/span-first

Conversation

@alexander-alderman-webb

@alexander-alderman-webbalexander-alderman-webb commented May 4, 2026

Copy link
Copy Markdown
Contributor

Description

In the streaming path, use

  • http.request.method instead of http.method
  • url.full instead of url
  • url.query instead of aws.request.url
  • url.fragment instead of http.fragment
  • rpc.method instead of both aws.service_id and aws.operation_name

Adapting Tests

sed commands used for converting transaction context managers:

  • sed -i '' 's/sentry_sdk.start_transaction()/sentry_sdk.traces.start_span(name="custom parent")/g'
  • sed -i '' 's/sentry_sdk.start_transaction() as transaction/sentry_sdk.traces.start_span(name="custom parent") as span/g'
  • sed -i '' 's/start_transaction() as transaction/sentry_sdk.traces.start_span(name="custom parent") as span/g'

sed commands used for converting specific attributes:

  • sed -i '' 's/http.method/http.request.method/g'
  • sed -i '' 's/aws.request.url/url.full/g'
  • sed -i '' 's/http.fragment/url.fragment/g'
  • sed -i '' 's/http.query/url.query/g'

sed commands used for converting event capture:

  • sed -i '' 's/assert len(spans) == 2/assert len(spans) == 3/g'
  • sed -i '' 's/assert len(spans) == 1/assert len(spans) == 2/g'
  • sed -i '' 's/(event, ) = (item.payload for item in items if item.type == "span")/spans = [item.payload for item in items if item.type == "span"]/g'
  • sed -i '' 's/event["spans"]/spans/g'
  • sed -i '' '/assert event["type"] == "transaction"/d'
  • sed -i '' 's/transaction.finish()/span.finish()/g'
  • sed -i '' 's/(event,) = events/(event, ) = (item.payload for item in items if item.type == "span")/g'
  • sed -i '' 's/events = capture_events()/items = capture_items("event", "transaction", "span")/g'
  • sed -i '' 's/capture_events,/capture_items,/g'

sed commands used for converting op:

  • sed -i '' 's/["op"]/["attributes"]["sentry.op"]/g'

sed commands used for converting origin:

  • sed -i '' 's/["origin"]/["attributes"]["sentry.origin"]/g'

sed commands used for converting description:

  • sed -i '' 's/description/name/g'

sed commands used for converting data to attributes:

  • sed -i '' 's/["data"]/["attributes"]/g'

Issues

Closes#6007

Reminders

@github-actions

github-actionsBot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

1869 passed | ⏭️ 341 skipped | Total: 2210 | Pass Rate: 84.57% | Execution Time: 2m 56s

All tests are passing successfully.

❌ Patch coverage is 6.82%. Project has 12980 uncovered lines.

Files with missing lines (2)
FilePatch %Lines
boto3.py13.13%⚠️ 86 Missing
consts.py99.22%⚠️ 2 Missing

Generated by Codecov Action

Comment threadtests/integrations/boto3/test_s3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py
Comment threadtests/integrations/boto3/test_s3.py
Comment threadsentry_sdk/integrations/boto3.py
Comment threadsentry_sdk/integrations/boto3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py Outdated
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review May 5, 2026 12:22
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code ownerMay 5, 2026 12:22
Comment threadsentry_sdk/integrations/boto3.py Outdated
Comment threadtests/integrations/boto3/test_s3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py
Comment threadsentry_sdk/integrations/boto3.py
Comment threadsentry_sdk/integrations/boto3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py Outdated
Comment threadsentry_sdk/integrations/boto3.py
Comment threadsentry_sdk/integrations/boto3.py
Comment threadsentry_sdk/integrations/boto3.py

@cursorcursorBot 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 17b42e6. Configure here.

Comment threadsentry_sdk/integrations/boto3.py

@sentrivanasentrivana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, left one nit.

Comment threadsentry_sdk/integrations/boto3.py
Comment threadsentry_sdk/integrations/boto3.py
@alexander-alderman-webb
alexander-alderman-webb merged commit fb587da into masterMay 6, 2026
165 of 167 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/boto3/span-first branch May 6, 2026 13:53
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
Replace deprecated `http.method` and `url` attributes with `http.request.method` and `url.full` attributes in the streaming lifecycle mode. Use `url.query` and `url.fragment` instead of `http.query` and `http.fragment` in the streaming mode.
Combine the undocumented `aws.service_id` and `aws.operation_name` attributes into the `rpc.method` attribute in the streaming lifecycle path.
Sign up for freeto 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.

Migrate boto3 to span first

3 participants

@alexander-alderman-webb@ericapisani@sentrivana