Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/core/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,5 @@ function generatePropagationContext(): PropagationContext {
return {
traceId: uuid4(),
spanId: uuid4().substring(16),
sampled: false,
};
}
4 changes: 2 additions & 2 deletions packages/hub/test/scope.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Scope', () => {
expect(scope._propagationContext).toEqual({
traceId: expect.any(String),
spanId: expect.any(String),
sampled: false,
sampled: undefined,
dsc: undefined,
parentSpanId: undefined,
});
Expand Down Expand Up @@ -442,7 +442,7 @@ describe('Scope', () => {
expect(scope._propagationContext).toEqual({
traceId: expect.any(String),
spanId: expect.any(String),
sampled: false,
sampled: undefined,
});
// @ts-expect-error accessing private property
expect(scope._propagationContext).not.toEqual(oldPropagationContext);
Expand Down
5 changes: 3 additions & 2 deletions packages/node/test/integrations/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ describe('tracing', () => {
const baggageHeader = request.getHeader('baggage') as string;

const parts = sentryTraceHeader.split('-');
expect(parts.length).toEqual(3);

// Should not include sampling decision since we don't wanna influence the tracing decisions downstream
expect(parts.length).toEqual(2);
expect(parts[0]).toEqual(traceId);
expect(parts[1]).toEqual(expect.any(String));
expect(parts[2]).toEqual('0');

expect(baggageHeader).toEqual(
`sentry-environment=production,sentry-release=1.0.0,sentry-user_segment=segmentA,sentry-public_key=dogsarebadatkeepingsecrets,sentry-trace_id=${traceId}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing-internal/src/browser/browsertracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export class BrowserTracing implements Integration {
traceId: idleTransaction.traceId,
spanId: idleTransaction.spanId,
parentSpanId: idleTransaction.parentSpanId,
sampled: !!idleTransaction.sampled,
sampled: idleTransaction.sampled,
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type TracePropagationTargets = (string | RegExp)[];
export interface PropagationContext {
traceId: string;
spanId: string;
sampled: boolean;
sampled?: boolean;
parentSpanId?: string;
dsc?: DynamicSamplingContext;
}
2 changes: 1 addition & 1 deletion packages/utils/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function tracingContextFromHeaders(
const propagationContext: PropagationContext = {
traceId: traceId || uuid4(),
spanId: uuid4().substring(16),
sampled: parentSampled === undefined ? false : parentSampled,
sampled: parentSampled,
};

if (parentSpanId) {
Expand Down