-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ref(core)!: Remove startIdleSpan from server exports
#23420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { | |
| spanToStaticSpanJSON, | ||
| } from '../utils/spanUtils'; | ||
| import { timestampInSeconds } from '../utils/time'; | ||
| import { _INTERNAL_ensureBrowserSpanStreaming } from './browserSpanApi'; | ||
| import { SentryNonRecordingSpan, spanIsNonRecordingSpan } from './sentryNonRecordingSpan'; | ||
| import { SentrySpan } from './sentrySpan'; | ||
| import { SPAN_STATUS_ERROR, SPAN_STATUS_OK } from './spanstatus'; | ||
|
|
@@ -89,6 +90,9 @@ interface IdleSpanOptions { | |
| * An idle span is always the active span. | ||
| */ | ||
| export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Partial<IdleSpanOptions> = {}): Span { | ||
| const client = getClient(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The Suggested FixThe Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
| _INTERNAL_ensureBrowserSpanStreaming(client); | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| // Activities store a list of active spans | ||
| const activities = new Map<string, boolean>(); | ||
|
|
||
|
|
@@ -115,7 +119,6 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti | |
| trimIdleSpanEndTimestamp = true, | ||
| } = options; | ||
|
|
||
| const client = getClient(); | ||
| const scope = getCurrentScope(); | ||
|
|
||
| if (!client || !hasSpansEnabled()) { | ||
|
|
@@ -131,7 +134,10 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti | |
| } | ||
|
|
||
| const previousActiveSpan = getActiveSpan(); | ||
| const span = _startIdleSpan(startSpanOptions); | ||
|
|
||
| const span = startInactiveSpan(startSpanOptions); | ||
| _setSpanForScope(getCurrentScope(), span); | ||
| DEBUG_BUILD && debug.log('[Tracing] Started span is an idle span'); | ||
|
|
||
| // We patch span.end to ensure we can run some things before the span is ended | ||
| // eslint-disable-next-line @typescript-eslint/unbound-method | ||
|
|
@@ -413,13 +419,3 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti | |
|
|
||
| return span; | ||
| } | ||
|
|
||
| function _startIdleSpan(options: StartSpanOptions): Span { | ||
| const span = startInactiveSpan(options); | ||
|
|
||
| _setSpanForScope(getCurrentScope(), span); | ||
|
|
||
| DEBUG_BUILD && debug.log('[Tracing] Started span is an idle span'); | ||
|
|
||
| return span; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.