Skip to content

feat(litestar): Support span streaming#6521

Open
alexander-alderman-webb wants to merge 1 commit into
masterfrom
webb/litestar/span-first
Open

feat(litestar): Support span streaming#6521
alexander-alderman-webb wants to merge 1 commit into
masterfrom
webb/litestar/span-first

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Jun 8, 2026

Description

In the streaming path, use

  • middleware.name instead of litestar.middleware_name

Adapting Tests

sed commands used for converting specific attributes:

  • sed -i '' 's/"litestar.middleware_name"/"middleware.name"/g'

sed commands used for converting event capture:

  • sed -i '' 's/capture_events,/capture_items,/g'
  • sed -i '' 's/events = capture_events()/items = capture_items("event", "transaction", "span")/g'
  • sed -i '' 's/transaction_event["spans"]/spans/g'
  • sed -i '' 's/transaction_events["spans"]/spans/g'
  • sed -i '' 's/(_, transaction_event) = events/spans = [item.payload for item in items if item.type == "span"]/g'
  • sed -i '' 's/(_, transaction_events) = events/spans = [item.payload for item in items if item.type == "span"]/g'
  • sed -i '' 's/(event,) = events/(event,) = (item.payload for item in items if item.type == "event")/g'
  • sed -i '' 's/"tags"/"attributes"/g'
  • sed -i '' 's/event["spans"]/spans/g'

sed commands used for converting op:

  • sed -i '' 's/["op"]/["attributes"]["sentry.op"]/g'
  • sed -i '' 's/"op"/"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'

Issues

Closes #6035

Reminders

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review June 8, 2026 09:39
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner June 8, 2026 09:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Codecov Results 📊

89283 passed | ⏭️ 6025 skipped | Total: 95308 | Pass Rate: 93.68% | Execution Time: 299m 28s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +800
Passed Tests 📈 +798
Failed Tests
Skipped Tests 📈 +2

All tests are passing successfully.

✅ Patch coverage is 91.49%. Project has 2361 uncovered lines.
❌ Project coverage is 89.89%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/litestar.py 91.49% ⚠️ 4 Missing and 5 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    89.90%    89.89%    -0.01%
==========================================
  Files          192       192         —
  Lines        23321     23345       +24
  Branches      8020      8026        +6
==========================================
+ Hits         20965     20984       +19
- Misses        2356      2361        +5
- Partials      1329      1327        -2

Generated by Codecov Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate litestar to span first

2 participants