Skip to content

feat(litestar): Support span streaming - #6521

Merged
alexander-alderman-webb merged 1 commit into
masterfrom
webb/litestar/span-first
Jun 10, 2026
Merged

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

Conversation

@alexander-alderman-webb

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

Copy link
Copy Markdown
Contributor

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 ownerJune 8, 2026 09:39
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

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

📊 Comparison with Base Branch

MetricChange
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)
FilePatch %Lines
sentry_sdk/integrations/litestar.py91.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

@alexander-alderman-webb
alexander-alderman-webb merged commit 50c4223 into masterJun 10, 2026
144 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/litestar/span-first branch June 10, 2026 07:21
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
Use `middleware.name` instead of `litestar.middleware_name` in the streaming mode.
Sign up for freeto 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

@alexander-alderman-webb@sentrivana