Skip to content

Commit 941722d

Browse files
committed
cleanup client passing
1 parent 9d838f9 commit 941722d

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

packages/core/src/tracing/trace.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export function startSpan<T>(options: StartSpanOptions, callback: (span: Span) =
7878
spanArguments,
7979
forceTransaction,
8080
scope,
81-
client,
8281
});
8382

8483
if (shouldSkipSpan) {
@@ -137,7 +136,6 @@ export function startSpanManual<T>(options: StartSpanOptions, callback: (span: S
137136
return wrapper(() => {
138137
const scope = getCurrentScope();
139138
const parentSpan = getParentSpan(scope, customParentSpan);
140-
const client = getClient();
141139

142140
const shouldSkipSpan = options.onlyIfParent && !parentSpan;
143141
const activeSpan = shouldSkipSpan
@@ -147,11 +145,10 @@ export function startSpanManual<T>(options: StartSpanOptions, callback: (span: S
147145
spanArguments,
148146
forceTransaction,
149147
scope,
150-
client,
151148
});
152149

153150
if (shouldSkipSpan) {
154-
client?.recordDroppedEvent('no_parent_span', 'span');
151+
getClient()?.recordDroppedEvent('no_parent_span', 'span');
155152
}
156153

157154
// We don't set ignored child spans onto the scope because there likely is an active,
@@ -221,7 +218,6 @@ export function startInactiveSpan(options: StartSpanOptions): Span {
221218
spanArguments,
222219
forceTransaction,
223220
scope,
224-
client,
225221
});
226222
});
227223
}
@@ -342,13 +338,11 @@ function createChildOrRootSpan({
342338
spanArguments,
343339
forceTransaction,
344340
scope,
345-
client: clientArg,
346341
}: {
347342
parentSpan: SentrySpan | undefined;
348343
spanArguments: SentrySpanArguments;
349344
forceTransaction?: boolean;
350345
scope: Scope;
351-
client?: Client;
352346
}): Span {
353347
if (!hasSpansEnabled()) {
354348
const span = new SentryNonRecordingSpan();
@@ -368,7 +362,7 @@ function createChildOrRootSpan({
368362
return span;
369363
}
370364

371-
const client = clientArg || getClient();
365+
const client = getClient();
372366
if (_shouldIgnoreStreamedSpan(client, spanArguments)) {
373367
if (!_isTracingSuppressed(scope)) {
374368
// if tracing is actively suppressed (Sentry.suppressTracing(...)),

0 commit comments

Comments
 (0)