Skip to content

ref(tracing)!: return the context from StartSpan and remove StartTransaction - #1538

Open
giortzisg wants to merge 1 commit into
ref/api-capture-flushfrom
ref/span-start
Open

giortzisg wants to merge 1 commit into
ref/api-capture-flushfrom
ref/span-start

Conversation

@giortzisg

@giortzisg giortzisg commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This removes the StartTransaction and span.StartChild helpers along with the options WithTransactionName, WithDescription. This is a precursor to the span first changes, where StartSpan needs to return ctx, span for the apis to work. This change should be introduced with v1 because:

  • the scope changes require span.Context to be passed so it makes sense for the api to return the ctx along with the span.
  • span first will be introduced opt in first and changing StartSpan now means no duplicates while working on span streaming.

@giortzisg
giortzisg added this pull request to stack #1541 November 19, 2026 14:57
@giortzisg
giortzisg removed this pull request from stack #1541 November 19, 2026 14:57
@giortzisg
giortzisg added this pull request to stack #1542 November 19, 2026 14:59
@giortzisg
giortzisg marked this pull request as ready for review November 23, 2026 09:09
@giortzisg
giortzisg requested a review from a team as a code owner November 23, 2026 09:09
@giortzisg
giortzisg force-pushed the ref/span-start branch 2 times, most recently from a7832d1 to c7352bc Compare November 23, 2026 09:37
@giortzisg
giortzisg removed this pull request from stack #1542 November 23, 2026 09:38
@giortzisg
giortzisg added this pull request to stack #1546 November 23, 2026 09:38
@giortzisg
giortzisg removed this pull request from stack #1546 November 23, 2026 12:59

@cursor cursor Bot 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 using default effort 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 14e1463. Configure here.

Comment thread sql/tx.go Outdated
return nil
}
return t.span.Load()
return t.ctx

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SQL tx retains request context

Medium Severity

sentryTx now stores the context returned by StartSpan because Span.Context() was removed, but finish only clears the span pointer. After Commit/Rollback, activeTx still holds that context on the pooled connection, so the request context, isolation scope, and span stay reachable until a later Begin/BeginTx overwrites it. When there is no parent span, startTxSpan still returns the incoming context and it is stored even though contextOrNil never reads it.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 14e1463. Configure here.

@giortzisg
giortzisg changed the base branch from ref/envelope-header to ref/api-capture-flush November 23, 2026 13:19
@giortzisg
giortzisg added this pull request to stack #1550 November 23, 2026 13:20
@giortzisg
giortzisg removed this pull request from stack #1550 November 23, 2026 13:26
@giortzisg
giortzisg added this pull request to stack #1551 November 23, 2026 13:27
@giortzisg
giortzisg removed this pull request from stack #1551 November 23, 2026 13:27
@giortzisg
giortzisg added this pull request to stack #1552 November 23, 2026 13:29
@giortzisg
giortzisg removed this pull request from stack #1552 November 23, 2026 13:34
@giortzisg
giortzisg added this pull request to stack #1553 November 23, 2026 13:35
…saction

StartSpan takes a name: the transaction name of a root span or the description of a child. StartTransaction, StartChild, SetDynamicSamplingContext, WithTransactionName and WithDescription go with it.
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