diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 5a19012e205..8094513eaad 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -285,13 +285,6 @@ NS_SWIFT_NAME(Options) */ @property (nullable, nonatomic, weak) id urlSessionDelegate; -/** - * Controls if the `tracestate` header is attached to envelopes and HTTP client integrations. - * - * Note: this is an experimental API and will be removed without notice. - */ -@property (nonatomic) BOOL experimentalEnableTraceSampling; - /** * Wether the SDK should use swizzling or not. Default is YES. * diff --git a/Sources/Sentry/SentryClient.m b/Sources/Sentry/SentryClient.m index c9a42dba3ff..7bba78b429a 100644 --- a/Sources/Sentry/SentryClient.m +++ b/Sources/Sentry/SentryClient.m @@ -308,9 +308,7 @@ - (SentryId *)sendEvent:(SentryEvent *)event isCrashEvent:isCrashEvent]; if (nil != preparedEvent) { - SentryTraceContext *traceContext = _options.experimentalEnableTraceSampling - ? [self getTraceStateWithEvent:event withScope:scope] - : nil; + SentryTraceContext *traceContext = [self getTraceStateWithEvent:event withScope:scope]; NSArray *attachments = scope.attachments; if (self.attachmentProcessor) @@ -338,9 +336,7 @@ - (SentryId *)sendEvent:(SentryEvent *)event attachments = [self.attachmentProcessor processAttachments:attachments forEvent:event]; if (nil == session.releaseName || [session.releaseName length] == 0) { - SentryTraceContext *traceContext = _options.experimentalEnableTraceSampling - ? [self getTraceStateWithEvent:event withScope:scope] - : nil; + SentryTraceContext *traceContext = [self getTraceStateWithEvent:event withScope:scope]; [SentryLog logWithMessage:DropSessionLogMessage andLevel:kSentryLevelDebug]; diff --git a/Sources/Sentry/SentryOptions.m b/Sources/Sentry/SentryOptions.m index 0d98fa9e2a8..104a3b9afad 100644 --- a/Sources/Sentry/SentryOptions.m +++ b/Sources/Sentry/SentryOptions.m @@ -68,7 +68,6 @@ - (instancetype)init _defaultTracesSampleRate = nil; self.tracesSampleRate = _defaultTracesSampleRate; self.enableCoreDataTracking = NO; - _experimentalEnableTraceSampling = NO; _enableSwizzling = YES; #if SENTRY_TARGET_PROFILING_SUPPORTED self.enableProfiling = NO; @@ -285,9 +284,6 @@ - (BOOL)validateOptions:(NSDictionary *)options self.urlSessionDelegate = options[@"urlSessionDelegate"]; } - [self setBool:options[@"experimentalEnableTraceSampling"] - block:^(BOOL value) { self->_experimentalEnableTraceSampling = value; }]; - [self setBool:options[@"enableSwizzling"] block:^(BOOL value) { self->_enableSwizzling = value; }]; diff --git a/Tests/SentryTests/SentryClientTests.swift b/Tests/SentryTests/SentryClientTests.swift index 4e0ac5b3808..d7dfe566dad 100644 --- a/Tests/SentryTests/SentryClientTests.swift +++ b/Tests/SentryTests/SentryClientTests.swift @@ -1039,20 +1039,11 @@ class SentryClientTest: XCTestCase { func testCaptureTransactionEvent_sendTraceState() { let transaction = fixture.transaction let client = fixture.getSut() - client.options.experimentalEnableTraceSampling = true client.capture(event: transaction) XCTAssertNotNil(fixture.transportAdapter.sendEventWithTraceStateInvocations.first?.traceContext) } - func testCaptureTransactionEvent_dontSendTraceState() { - let transaction = fixture.transaction - let client = fixture.getSut() - client.capture(event: transaction) - - XCTAssertNil(fixture.transportAdapter.sendEventWithTraceStateInvocations.first?.traceContext) - } - func testCaptureEvent_traceInScope_sendTraceState() { let event = Event(level: SentryLevel.warning) event.message = fixture.message @@ -1060,7 +1051,6 @@ class SentryClientTest: XCTestCase { scope.span = fixture.trace let client = fixture.getSut() - client.options.experimentalEnableTraceSampling = true client.capture(event: event, scope: scope) client.capture(event: event) diff --git a/Tests/SentryTests/SentryOptionsTest.m b/Tests/SentryTests/SentryOptionsTest.m index 02b771b832b..f50a9e0896d 100644 --- a/Tests/SentryTests/SentryOptionsTest.m +++ b/Tests/SentryTests/SentryOptionsTest.m @@ -440,24 +440,6 @@ - (void)testEnableIOTracking [self testBooleanField:@"enableFileIOTracking" defaultValue:NO]; } -- (void)testEnableTraceSampling -{ - SentryOptions *options = [self getValidOptions:@{}]; - XCTAssertFalse(options.experimentalEnableTraceSampling); -} - -- (void)testEnableTraceSamplingEnabled -{ - SentryOptions *options = [self getValidOptions:@{ @"experimentalEnableTraceSampling" : @YES }]; - XCTAssertTrue(options.experimentalEnableTraceSampling); -} - -- (void)testEnableTraceSamplingDisabled -{ - SentryOptions *options = [self getValidOptions:@{ @"experimentalEnableTraceSampling" : @NO }]; - XCTAssertFalse(options.experimentalEnableTraceSampling); -} - - (void)testEmptyConstructorSetsDefaultValues { SentryOptions *options = [[SentryOptions alloc] init]; @@ -551,7 +533,6 @@ - (void)assertDefaultValues:(SentryOptions *)options XCTAssertEqualObjects([self getDefaultInAppIncludes], options.inAppIncludes); XCTAssertEqual(@[], options.inAppExcludes); XCTAssertNil(options.urlSessionDelegate); - XCTAssertFalse(options.experimentalEnableTraceSampling); XCTAssertEqual(YES, options.enableSwizzling); XCTAssertEqual(NO, options.enableFileIOTracking); #if SENTRY_TARGET_PROFILING_SUPPORTED