Skip to content

ref: Stop returning StreamedSpan from get_start_span_function()#6560

Open
alexander-alderman-webb wants to merge 1 commit into
masterfrom
webb/get-start-span-function
Open

ref: Stop returning StreamedSpan from get_start_span_function()#6560
alexander-alderman-webb wants to merge 1 commit into
masterfrom
webb/get-start-span-function

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

Description

The new start_span() API automatically promotes spans to segment spans if applicable.

There is no need for get_start_span_function() anymore.

Issues

Reminders

@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner June 12, 2026 06:57
Comment thread sentry_sdk/ai/utils.py
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

89411 passed | ⏭️ 6013 skipped | Total: 95424 | Pass Rate: 93.7% | Execution Time: 304m 6s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2397 uncovered lines.
❌ Project coverage is 89.78%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    89.81%    89.78%    -0.03%
==========================================
  Files          192       192         —
  Lines        23460     23455        -5
  Branches      8062      8058        -4
==========================================
+ Hits         21069     21058       -11
- Misses        2391      2397        +6
- Partials      1328      1328         —

Generated by Codecov Action

Comment thread sentry_sdk/ai/utils.py
Comment on lines -541 to -542
if has_span_streaming_enabled(sentry_sdk.get_client().options):
return sentry_sdk.traces.start_span

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.

Don't we still need this part? Without it we're only using non-streaming APIs in this function

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.

Or are we simply not using the helper in a streaming context anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes the plan is to drop the wrapper in span streaming branches.
And after #6404 is merged it won't be used when span streaming is enabled.

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.

2 participants