Skip to content

Commit 780720e

Browse files
committed
fix test
1 parent d4e5cc4 commit 780720e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/core/src/tracing/trace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export const continueTrace = <V>(
219219

220220
const incomingDsc = baggageHeaderToDynamicSamplingContext(baggage);
221221

222-
if (shouldContinueTrace(getClient(), incomingDsc?.org_id)) {
222+
if (!shouldContinueTrace(getClient(), incomingDsc?.org_id)) {
223223
return startNewTrace(callback);
224224
}
225225

packages/core/src/utils/tracing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,20 @@ function getSampleRandFromTraceparentAndDsc(
138138
export function shouldContinueTrace(client: Client | undefined, baggageOrgId?: string): boolean {
139139
const sdkOptionOrgId = deriveOrgIdFromClient(client);
140140

141-
// Case: baggage org ID and SDK org ID don't match - always start new trace
141+
// Case: baggage orgID and SDK orgID don't match - always start new trace
142142
if (baggageOrgId && sdkOptionOrgId && baggageOrgId !== sdkOptionOrgId) {
143143
debug.log(
144144
`Starting a new trace because org IDs don't match (incoming baggage: ${baggageOrgId}, SDK options: ${sdkOptionOrgId})`,
145145
);
146146
return false;
147147
}
148148

149-
const strictTraceContinuation = client?.getOptions()?.strictTraceContinuation || false; // default for `strictTraceContinuation` is `false` todo(v10): set default to `true`
149+
const strictTraceContinuation = client?.getOptions()?.strictTraceContinuation || false; // default for `strictTraceContinuation` is `false`
150150

151151
if (strictTraceContinuation) {
152152
// With strict continuation enabled, start new trace if:
153-
// - Baggage has org ID but SDK doesn't have one
154-
// - SDK has org ID but baggage doesn't have one
153+
// - Baggage has orgID, but SDK doesn't have one
154+
// - SDK has orgID, but baggage doesn't have one
155155
if ((baggageOrgId && !sdkOptionOrgId) || (!baggageOrgId && sdkOptionOrgId)) {
156156
debug.log(
157157
`Starting a new trace because strict trace continuation is enabled and one org ID is missing (incoming baggage: ${baggageOrgId}, SDK options: ${sdkOptionOrgId})`,

0 commit comments

Comments
 (0)