Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ebcf7bf
Remove unused function
Jan 9, 2025
a83a511
Merge remote-tracking branch 'origin/develop' into lforst-sample-rand
Jan 13, 2025
1646f0b
Write and use sample rand on propagation context
Jan 13, 2025
7fbba52
Implement propagating sampling decision properly
Jan 13, 2025
0b12615
Inject sample rand
Jan 13, 2025
1eac9af
Merge remote-tracking branch 'origin/develop' into lforst-sample-rand
Jan 13, 2025
38fe823
format
Jan 13, 2025
4fb937f
put onto initial dsc
Jan 14, 2025
6c27931
Add tests for `tracesSampleRate` behavior
Jan 14, 2025
8d6984f
mv
Jan 14, 2025
9b394c3
todo comment
Jan 14, 2025
1d4a641
unit tests
Jan 14, 2025
2d35988
node integration tests
Jan 14, 2025
957bc09
browser integration tests
Jan 14, 2025
e1c531f
Fix test
Jan 14, 2025
1fbbf82
Merge remote-tracking branch 'origin/develop' into lforst-sample-rand
Jan 14, 2025
a1d5dd3
test fix
Jan 15, 2025
83ac885
feat: Pass `parentSampleRate` to `tracesSampler`
Jan 15, 2025
045b41f
always apply root span sample rate to dsc
Jan 15, 2025
52ea3d2
e l a b o r a t e
Jan 15, 2025
631ed1b
Dont reinvent util we already have
Jan 15, 2025
37b6ca2
beep boop actually do what I am supposed to beep boop
Jan 15, 2025
5e3f706
don't leak attribute into actual data
Jan 15, 2025
8c83fb9
Merge branch 'lforst-sample-rand' into lforst-parent-sampling-decision
Jan 15, 2025
c4282b8
.
Jan 15, 2025
4a2a7ae
.
Jan 15, 2025
5b81700
.
Jan 15, 2025
9b2afff
tests
Jan 16, 2025
2c0910a
Merge remote-tracking branch 'origin/develop' into lforst-parent-samp…
Jan 16, 2025
6c6febf
something's off
Jan 16, 2025
4092e09
pain
Jan 16, 2025
72c3a64
Merge remote-tracking branch 'origin/develop' into lforst-parent-samp…
Jan 20, 2025
d835de7
otel side of things
Jan 20, 2025
c96c706
help
Jan 20, 2025
fdf0fa7
.
Jan 20, 2025
e9471eb
bless
Jan 20, 2025
2b491f2
beep boop
Jan 20, 2025
a96e9c6
lint
Jan 20, 2025
063984b
fix and test 0% sample rate
Jan 20, 2025
8607cc8
apply before emit
Jan 20, 2025
51526ec
Merge branch 'develop' into lforst-parent-sampling-decision
Jan 20, 2025
08b6561
fix merge mistake
Jan 20, 2025
bceb9f3
Refactor again
Jan 21, 2025
e2ffc52
lint
Jan 21, 2025
feb43ee
update tests
Jan 21, 2025
2a127b2
.
Jan 21, 2025
70c3fd9
fix crap
Jan 21, 2025
0ca98e3
update tests
Jan 21, 2025
812e750
more tests
Jan 21, 2025
2882ca4
e2e tests
Jan 21, 2025
f5a8220
.
Jan 21, 2025
fbee088
Merge remote-tracking branch 'origin/develop' into lforst-parent-samp…
Jan 21, 2025
f683884
.
Jan 21, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
TRACING_DEFAULTS,
Expand Down Expand Up @@ -104,7 +103,6 @@
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
},
span_id: expect.stringMatching(/[a-f0-9]{16}/),
Expand Down Expand Up @@ -176,7 +174,6 @@
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
},
span_id: expect.stringMatching(/[a-f0-9]{16}/),
Expand Down Expand Up @@ -291,7 +288,6 @@
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',
},
span_id: expect.stringMatching(/[a-f0-9]{16}/),
Expand Down Expand Up @@ -327,7 +323,6 @@
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.test',
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',
testy: 'yes',
Expand Down Expand Up @@ -684,7 +679,7 @@
});

const propCtxBeforeEnd = getCurrentScope().getPropagationContext();
expect(propCtxBeforeEnd).toStrictEqual({

Check failure on line 682 in packages/browser/test/tracing/browserTracingIntegration.test.ts

View workflow job for this annotation

GitHub Actions / Browser Unit Tests

test/tracing/browserTracingIntegration.test.ts > browserTracingIntegration > startBrowserTracingNavigationSpan > saves the span's positive sampling decision and its DSC on the propagationContext when the span finishes

AssertionError: expected { …(3) } to strictly equal { sampleRand: Any<Number>, …(1) } - Expected + Received Object { "sampleRand": Any<Number>, + "sampleRateOverride": 1, "traceId": StringMatching /[a-f0-9]{32}/, } ❯ test/tracing/browserTracingIntegration.test.ts:682:32
sampleRand: expect.any(Number),
traceId: expect.stringMatching(/[a-f0-9]{32}/),
});
Expand Down Expand Up @@ -724,7 +719,7 @@
});

const propCtxBeforeEnd = getCurrentScope().getPropagationContext();
expect(propCtxBeforeEnd).toStrictEqual({

Check failure on line 722 in packages/browser/test/tracing/browserTracingIntegration.test.ts

View workflow job for this annotation

GitHub Actions / Browser Unit Tests

test/tracing/browserTracingIntegration.test.ts > browserTracingIntegration > startBrowserTracingNavigationSpan > saves the span's negative sampling decision and its DSC on the propagationContext when the span finishes

AssertionError: expected { …(3) } to strictly equal { traceId: StringMatching{…}, …(1) } - Expected + Received Object { "sampleRand": Any<Number>, + "sampleRateOverride": 0, "traceId": StringMatching /[a-f0-9]{32}/, } ❯ test/tracing/browserTracingIntegration.test.ts:722:32
traceId: expect.stringMatching(/[a-f0-9]{32}/),
sampleRand: expect.any(Number),
});
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/envelope.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Client } from './client';
import { SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE } from './semanticAttributes';
import { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext';
import type { SentrySpan } from './tracing/sentrySpan';
import type {
Expand Down Expand Up @@ -142,11 +141,6 @@ export function createSpanEnvelope(spans: [SentrySpan, ...SentrySpan[]], client?
const items: SpanItem[] = [];
for (const span of spans) {
const spanJson = convertToSpanJSON(span);

// This attribute is important for internal logic but should not leak into actual data
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete spanJson.data[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE];

if (spanJson) {
items.push(createSpanEnvelopeItem(spanJson));
}
Expand Down
5 changes: 0 additions & 5 deletions packages/core/src/semanticAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';
*/
export const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';

/**
* Use this attribute on a root span to propagate the spans sample rate downstream as parent sample rate in the DSC, overriding anything that was previously set on the DSC.
*/
export const SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE = 'sentry.override_trace_sample_rate';

/**
* Use this attribute to represent the operation of a span.
*/
Expand Down
22 changes: 9 additions & 13 deletions packages/core/src/tracing/dynamicSamplingContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import type { Client } from '../client';
import { DEFAULT_ENVIRONMENT } from '../constants';
import { getClient } from '../currentScopes';
import type { Scope } from '../scope';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
} from '../semanticAttributes';
import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes';
import type { DynamicSamplingContext, Span } from '../types-hoist';
import {
baggageHeaderToDynamicSamplingContext,
Expand Down Expand Up @@ -79,17 +75,13 @@ export function getDynamicSamplingContextFromSpan(span: Span): Readonly<Partial<
}

const rootSpan = getRootSpan(span);
const rootSpanJson = spanToJSON(rootSpan);
const rootSpanAttributes = rootSpanJson.data;
const shouldOverrideDscSampleRate = rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE];
const maybeSampleRate = rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
const rootSpanPropagationContext = getCapturedScopesOnSpan(rootSpan).scope?.getPropagationContext();

// The root span sample rate should always be applied to the DSC, even if the DSC is frozen.
// This is so that the downstream traces/services can use parentSampleRate in their `tracesSampler` to make consistent sampling decisions across the entire trace.
function applyRootSpanSampleRateToDsc(dsc: Partial<DynamicSamplingContext>): Partial<DynamicSamplingContext> {
// Note: This is a `!= null` check meaning "nullish"
if (shouldOverrideDscSampleRate && maybeSampleRate != null) {
dsc.sample_rate = `${maybeSampleRate}`;
if (rootSpanPropagationContext?.sampleRateOverride !== undefined) {
dsc.sample_rate = `${rootSpanPropagationContext.sampleRateOverride}`;
}
return dsc;
}
Expand All @@ -114,6 +106,10 @@ export function getDynamicSamplingContextFromSpan(span: Span): Readonly<Partial<
// Else, we generate it from the span
const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client);

const rootSpanJson = spanToJSON(rootSpan);
const rootSpanAttributes = rootSpanJson.data;
const maybeSampleRate = rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];

// Note: This is a `!= null` check meaning "nullish"
if (maybeSampleRate != null) {
dsc.sample_rate = `${maybeSampleRate}`;
Expand All @@ -133,7 +129,7 @@ export function getDynamicSamplingContextFromSpan(span: Span): Readonly<Partial<
// So we end up with an active span that is not sampled (neither positively nor negatively)
if (hasTracingEnabled()) {
dsc.sampled = String(spanIsSampled(rootSpan));
dsc.sample_rand = getCapturedScopesOnSpan(rootSpan).scope?.getPropagationContext().sampleRand.toString();
dsc.sample_rand = rootSpanPropagationContext?.sampleRand.toString();
}

client.emit('createDsc', dsc, rootSpan);
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/tracing/sampling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function sampleSpan(
return [false];
}

let shouldUpdateSampleRateOnDsc = undefined;
let shouldUpdateSampleRateOnDsc: undefined | true = undefined;

// we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should
// work; prefer the hook if so
Expand Down Expand Up @@ -74,8 +74,7 @@ export function sampleSpan(
sampleRate,
)})`,
);
return [false, parsedSampleRate, shouldUpdateSampleRateOnDsc];
}

return [true, parsedSampleRate, shouldUpdateSampleRateOnDsc];
return [shouldSample, parsedSampleRate, shouldUpdateSampleRateOnDsc];
}
5 changes: 1 addition & 4 deletions packages/core/src/tracing/sentrySpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
} from '../semanticAttributes';
import type {
Expand Down Expand Up @@ -349,10 +348,8 @@ export class SentrySpan implements Span {
// remove internal root span attributes we don't need to send.
/* eslint-disable @typescript-eslint/no-dynamic-delete */
delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE];
spans.forEach(span => {
delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE];
span.data && delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
Copy link
Member

Choose a reason for hiding this comment

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

I think we can drop this check (span.data &&), as span data is not optional anymore? 🤔

});
// eslint-enabled-next-line @typescript-eslint/no-dynamic-delete

Expand Down
10 changes: 4 additions & 6 deletions packages/core/src/tracing/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ import { getClient, getCurrentScope, getIsolationScope, withScope } from '../cur
import { getAsyncContextStrategy } from '../asyncContext';
import { DEBUG_BUILD } from '../debug-build';
import type { Scope } from '../scope';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
} from '../semanticAttributes';
import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes';
import { logger } from '../utils-hoist/logger';
import { generateTraceId } from '../utils-hoist/propagationContext';
import { propagationContextFromHeaders } from '../utils-hoist/tracing';
Expand Down Expand Up @@ -442,7 +438,9 @@ function _startRootSpan(spanArguments: SentrySpanArguments, scope: Scope, parent

if (sampleRate !== undefined) {
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE, shouldUpdateSampleRateOnDsc);
if (shouldUpdateSampleRateOnDsc) {
currentPropagationContext.sampleRateOverride = sampleRate;
}
}

if (client) {
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/types-hoist/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ export interface PropagationContext {
* The current SDK should not modify this value!
*/
dsc?: Partial<DynamicSamplingContext>;

/**
* This is set when the currently incoming sample rate should be overridden for further propagation.
*
* This is the case whenever
* - the tracesSampleRate is applied
* - the tracesSampler is invoked
*/
// TODO: Link to docs when this is properly specified. For now: https://github.com/getsentry/team-sdks/issues/117
sampleRateOverride?: number;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions packages/opentelemetry/src/sampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import type { Client, SpanAttributes } from '@sentry/core';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
hasTracingEnabled,
logger,
Expand Down Expand Up @@ -121,9 +120,12 @@ export class SentrySampler implements Sampler {

const attributes: Attributes = {
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: shouldUpdateSampleRateOnDsc,
};

if (currentPropagationContext && sampleRate && shouldUpdateSampleRateOnDsc) {
currentPropagationContext.sampleRateOverride = sampleRate;
}

const method = `${maybeSpanHttpMethod}`.toUpperCase();
if (method === 'OPTIONS' || method === 'HEAD') {
DEBUG_BUILD && logger.log(`[Tracing] Not sampling span because HTTP method is '${method}' for ${spanName}`);
Expand Down
2 changes: 0 additions & 2 deletions packages/opentelemetry/src/spanExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
captureEvent,
Expand Down Expand Up @@ -392,7 +391,6 @@ function removeSentryAttributes(data: Record<string, unknown>): Record<string, u
delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE];
delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE];
/* eslint-enable @typescript-eslint/no-dynamic-delete */

return cleanedData;
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry/test/sampler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('SentrySampler', () => {
const actual = sampler.shouldSample(ctx, traceId, spanName, spanKind, spanAttributes, links);
expect(actual).toEqual({
decision: SamplingDecision.NOT_RECORD,
attributes: { 'sentry.sample_rate': 0, 'sentry.override_trace_sample_rate': true },
attributes: { 'sentry.sample_rate': 0 },
traceState: new TraceState().set('sentry.sampled_not_recording', '1'),
});
expect(spyOnDroppedEvent).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('SentrySampler', () => {
const actual = sampler.shouldSample(ctx, traceId, spanName, spanKind, spanAttributes, links);
expect(actual).toEqual({
decision: SamplingDecision.RECORD_AND_SAMPLED,
attributes: { 'sentry.sample_rate': 1, 'sentry.override_trace_sample_rate': true },
attributes: { 'sentry.sample_rate': 1 },
traceState: new TraceState(),
});
expect(spyOnDroppedEvent).toHaveBeenCalledTimes(0);
Expand Down
8 changes: 0 additions & 8 deletions packages/opentelemetry/test/trace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Span as SpanClass } from '@opentelemetry/sdk-trace-base';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
getClient,
Expand Down Expand Up @@ -224,7 +223,6 @@ describe('trace', () => {
expect(span).toBeDefined();
expect(getSpanAttributes(span)).toEqual({
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
});
},
);
Expand All @@ -245,7 +243,6 @@ describe('trace', () => {
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.test.origin',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'my-op',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
});
},
);
Expand All @@ -270,7 +267,6 @@ describe('trace', () => {
expect(getSpanStartTime(span)).toEqual(date);
expect(getSpanAttributes(span)).toEqual({
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
test1: 'test 1',
test2: 2,
});
Expand Down Expand Up @@ -528,7 +524,6 @@ describe('trace', () => {
expect(span).toBeDefined();
expect(getSpanAttributes(span)).toEqual({
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
});

const span2 = startInactiveSpan({
Expand All @@ -543,7 +538,6 @@ describe('trace', () => {
expect(span2).toBeDefined();
expect(getSpanAttributes(span2)).toEqual({
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'task',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.test.origin',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'my-op',
Expand All @@ -568,7 +562,6 @@ describe('trace', () => {
expect(getSpanStartTime(span)).toEqual(date);
expect(getSpanAttributes(span)).toEqual({
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
test1: 'test 1',
test2: 2,
});
Expand Down Expand Up @@ -841,7 +834,6 @@ describe('trace', () => {
expect(getSpanStartTime(span)).toEqual(date);
expect(getSpanAttributes(span)).toEqual({
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_OVERRIDE_TRACE_SAMPLE_RATE]: true,
test1: 'test 1',
test2: 2,
});
Expand Down
Loading