Skip to content

feat(grpc): Support span streaming#6204

Open
alexander-alderman-webb wants to merge 7 commits intomasterfrom
webb/grpc/span-first
Open

feat(grpc): Support span streaming#6204
alexander-alderman-webb wants to merge 7 commits intomasterfrom
webb/grpc/span-first

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented May 5, 2026

Description

In the streaming path, use

  • rpc.method instead of method
  • rpc.response.status_code instead of code

Dropped attributes:

  • type

Adapting Tests

sed commands used for converting transaction context managers:

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

sed commands used for converting specific attributes:

  • sed -i '' '/"type": /d'
  • sed -i '' 's/code/rpc.response.status_code/g'
  • sed -i '' 's/method/rpc.method/g'

sed commands used for converting event capture:

  • sed -i '' 's/(event, _) = events/(event, ) = (item.payload for item in items if item.type == "event")/g'
  • sed -i '' 's/local_transaction["spans"]/spans/g'
  • sed -i '' 's/events.read_event()/span = events.read_event()["payload"]/g'
  • sed -i '' 's/events = capture_events_forksafe()/items = capture_items_forksafe("event", "transaction", "span")/g'
  • sed -i '' 's/capture_events_forksafe,/capture_items_forksafe,/g'
  • sed -i '' 's/event["spans"]/spans/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/["contexts"]["trace"]["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'

sed commands for converting trace id:

  • sed -i '' 's/["contexts"]["trace"]["trace_id"]/["trace_id"]/g'

other test changes:

  • sed -i '' 's/, channel = grpc_server_and_channel/, channel = await grpc_server_and_channel(span_streaming)/g'
  • sed -i '' 's/events.read_event()/items = items.read_event()/g'
  • sed -i '' 's/events.write_file.close()/items.write_file.close()/g'

Issues

Reminders

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Codecov Results 📊

146 passed | Total: 146 | Pass Rate: 100% | Execution Time: 23.37s

All tests are passing successfully.

❌ Patch coverage is 3.64%. Project has 14264 uncovered lines.

Files with missing lines (5)
File Patch % Lines
server.py 0.00% ⚠️ 70 Missing
client.py 0.00% ⚠️ 59 Missing
client.py 0.00% ⚠️ 56 Missing
server.py 0.00% ⚠️ 44 Missing
consts.py 99.48% ⚠️ 2 Missing

Generated by Codecov Action

Comment thread tests/integrations/grpc/test_grpc_aio.py
Comment thread sentry_sdk/integrations/grpc/aio/server.py
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review May 5, 2026 16:01
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner May 5, 2026 16:01
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 049f1de. Configure here.

Comment thread sentry_sdk/integrations/grpc/aio/client.py Outdated
Comment thread tests/integrations/grpc/test_grpc_aio.py
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