Skip to content

Commit d4a8572

Browse files
authored
ref: Move trace context initializers to private API (#6662)
1 parent 6d0b605 commit d4a8572

File tree

9 files changed

+77
-442
lines changed

9 files changed

+77
-442
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Remove legacy profiling, the only supported profiling is now what was known as continuous V2 (#6386)
1414
- Removes deprecated useSpan function (#5591)
1515
- Makes app hang tracking V2 the default and removes the option to enable/disable it (#5615)
16+
- Removes initializers for SentryTraceContext from the public API (#6662)
1617
- Removes `integrations` property from `SentryOptions` (#5749)
1718
- Removes `defaultIntegrations` function from `SentryOptions` (#6664)
1819
- Makes `SentryEventDecodable` internal (#5808)

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,7 @@
10421042
FA27EBDC2EB639D400F2ECF7 /* SentryId.h in Headers */ = {isa = PBXBuildFile; fileRef = FA27EBDB2EB639D100F2ECF7 /* SentryId.h */; settings = {ATTRIBUTES = (Public, ); }; };
10431043
FA27EBDE2EB639D900F2ECF7 /* SentryId.m in Sources */ = {isa = PBXBuildFile; fileRef = FA27EBDD2EB639D700F2ECF7 /* SentryId.m */; };
10441044
FA27EBF52EB82FAD00F2ECF7 /* FileIOTrackerTestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA27EBEF2EB82FA800F2ECF7 /* FileIOTrackerTestHelpers.swift */; };
1045+
FA27ECA12EBA325A00F2ECF7 /* SentryTraceContext+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA27EC9B2EBA325400F2ECF7 /* SentryTraceContext+Private.h */; };
10451046
FA34C1A32E692A5000BC52AA /* SentryEnvelopeItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */; };
10461047
FA3734842E0F086C0091EF24 /* SentryDependencyContainerSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */; };
10471048
FA3734862E0F09320091EF24 /* SentryDependencyContainerSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */; };
@@ -2424,6 +2425,7 @@
24242425
FA27EBDB2EB639D100F2ECF7 /* SentryId.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryId.h; path = Public/SentryId.h; sourceTree = "<group>"; };
24252426
FA27EBDD2EB639D700F2ECF7 /* SentryId.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryId.m; sourceTree = "<group>"; };
24262427
FA27EBEF2EB82FA800F2ECF7 /* FileIOTrackerTestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileIOTrackerTestHelpers.swift; sourceTree = "<group>"; };
2428+
FA27EC9B2EBA325400F2ECF7 /* SentryTraceContext+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryTraceContext+Private.h"; path = "include/SentryTraceContext+Private.h"; sourceTree = "<group>"; };
24272429
FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeItem.swift; sourceTree = "<group>"; };
24282430
FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDependencyContainerSwiftHelper.h; path = include/SentryDependencyContainerSwiftHelper.h; sourceTree = "<group>"; };
24292431
FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDependencyContainerSwiftHelper.m; sourceTree = "<group>"; };
@@ -4183,6 +4185,7 @@
41834185
8453421528BE8A9500C22EEC /* SentrySpanStatus.m */,
41844186
D88817D926D72AB800BF2251 /* SentryTraceContext.h */,
41854187
D88817D626D7149100BF2251 /* SentryTraceContext.m */,
4188+
FA27EC9B2EBA325400F2ECF7 /* SentryTraceContext+Private.h */,
41864189
8E7C98302693E1CC00E6336C /* SentryTraceHeader.h */,
41874190
8E7C982D2693D56000E6336C /* SentryTraceHeader.m */,
41884191
D456B4352D706BEE007068CB /* SentryTraceOrigin.h */,
@@ -5154,6 +5157,7 @@
51545157
63FE715D20DA4C1100CDBAE8 /* SentryCrashSymbolicator.h in Headers */,
51555158
FAE2DABA2E1F318900262307 /* SentryProfilingSwiftHelpers.h in Headers */,
51565159
D8ACE3CF2762187D00F5A213 /* SentryFileIOTrackingIntegration.h in Headers */,
5160+
FA27ECA12EBA325A00F2ECF7 /* SentryTraceContext+Private.h in Headers */,
51575161
7BECF42226145C5D00D9826E /* SentryMechanismContext.h in Headers */,
51585162
63FE718920DA4C1100CDBAE8 /* SentryCrash.h in Headers */,
51595163
7B56D73124616CCD00B842DA /* SentryConcurrentRateLimitsDictionary.h in Headers */,

Sources/Sentry/Public/SentryTraceContext.h

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -65,59 +65,6 @@ NS_SWIFT_NAME(TraceContext)
6565
*/
6666
@property (nullable, nonatomic, readonly) NSString *replayId;
6767

68-
/**
69-
* Initializes a SentryTraceContext with given properties.
70-
*/
71-
- (instancetype)initWithTraceId:(SentryId *)traceId
72-
publicKey:(NSString *)publicKey
73-
releaseName:(nullable NSString *)releaseName
74-
environment:(nullable NSString *)environment
75-
transaction:(nullable NSString *)transaction
76-
sampleRate:(nullable NSString *)sampleRate
77-
sampled:(nullable NSString *)sampled
78-
replayId:(nullable NSString *)replayId;
79-
80-
/**
81-
* Initializes a SentryTraceContext with given properties.
82-
*/
83-
- (instancetype)initWithTraceId:(SentryId *)traceId
84-
publicKey:(NSString *)publicKey
85-
releaseName:(nullable NSString *)releaseName
86-
environment:(nullable NSString *)environment
87-
transaction:(nullable NSString *)transaction
88-
sampleRate:(nullable NSString *)sampleRate
89-
sampleRand:(nullable NSString *)sampleRand
90-
sampled:(nullable NSString *)sampled
91-
replayId:(nullable NSString *)replayId;
92-
93-
/**
94-
* Initializes a SentryTraceContext with data from scope and options.
95-
*/
96-
- (nullable instancetype)initWithScope:(SentryScope *)scope options:(SentryOptions *)options;
97-
98-
/**
99-
* Initializes a SentryTraceContext with data from a dictionary.
100-
*/
101-
- (nullable instancetype)initWithDict:(NSDictionary<NSString *, id> *)dictionary;
102-
103-
/**
104-
* Initializes a SentryTraceContext with data from a trace, scope and options.
105-
*/
106-
- (nullable instancetype)initWithTracer:(SentryTracer *)tracer
107-
scope:(nullable SentryScope *)scope
108-
options:(SentryOptions *)options;
109-
110-
/**
111-
* Initializes a SentryTraceContext with data from a traceId, options and replayId.
112-
*
113-
* @param traceId The current tracer.
114-
* @param options The current active options.
115-
* @param replayId The current session replay.
116-
*/
117-
- (instancetype)initWithTraceId:(SentryId *)traceId
118-
options:(SentryOptions *)options
119-
replayId:(nullable NSString *)replayId;
120-
12168
/**
12269
* Create a SentryBaggage with the information of this SentryTraceContext.
12370
*/

Sources/Sentry/SentryClient.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#import "SentrySerialization.h"
2929
#import "SentryStacktraceBuilder.h"
3030
#import "SentrySwift.h"
31+
#import "SentryTraceContext+Private.h"
3132
#import "SentryTraceContext.h"
3233
#import "SentryTracer.h"
3334
#import "SentryTransaction.h"

Sources/Sentry/SentryNetworkTracker.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#import "SentryStacktrace.h"
2626
#import "SentrySwift.h"
2727
#import "SentryThread.h"
28+
#import "SentryTraceContext+Private.h"
2829
#import "SentryTraceContext.h"
2930
#import "SentryTraceHeader.h"
3031
#import "SentryTraceOrigin.h"

Sources/Sentry/SentryTracer.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#import "SentrySpanOperation.h"
2020
#import "SentrySwift.h"
2121
#import "SentryTime.h"
22+
#import "SentryTraceContext+Private.h"
2223
#import "SentryTraceContext.h"
2324
#import "SentryTracer+Private.h"
2425
#import "SentryTracerConfiguration.h"

Sources/Sentry/include/SentryPrivate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#import "SentrySpanOperation.h"
6161
#import "SentrySwizzleWrapperHelper.h"
6262
#import "SentrySysctlObjC.h"
63+
#import "SentryTraceContext+Private.h"
6364
#import "SentryTraceHeader.h"
6465
#import "SentryTraceOrigin.h"
6566
#import "SentryTraceProfiler.h"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#import "SentryTraceContext.h"
2+
#import <Foundation/Foundation.h>
3+
4+
@class SentryId;
5+
@class SentryTracer;
6+
@class SentryScope;
7+
@class SentryOptions;
8+
9+
NS_ASSUME_NONNULL_BEGIN
10+
11+
@interface SentryTraceContext ()
12+
13+
/**
14+
* Initializes a SentryTraceContext with given properties.
15+
*/
16+
- (instancetype)initWithTraceId:(SentryId *)traceId
17+
publicKey:(NSString *)publicKey
18+
releaseName:(nullable NSString *)releaseName
19+
environment:(nullable NSString *)environment
20+
transaction:(nullable NSString *)transaction
21+
sampleRate:(nullable NSString *)sampleRate
22+
sampled:(nullable NSString *)sampled
23+
replayId:(nullable NSString *)replayId;
24+
25+
/**
26+
* Initializes a SentryTraceContext with given properties.
27+
*/
28+
- (instancetype)initWithTraceId:(SentryId *)traceId
29+
publicKey:(NSString *)publicKey
30+
releaseName:(nullable NSString *)releaseName
31+
environment:(nullable NSString *)environment
32+
transaction:(nullable NSString *)transaction
33+
sampleRate:(nullable NSString *)sampleRate
34+
sampleRand:(nullable NSString *)sampleRand
35+
sampled:(nullable NSString *)sampled
36+
replayId:(nullable NSString *)replayId;
37+
38+
/**
39+
* Initializes a SentryTraceContext with data from scope and options.
40+
*/
41+
- (nullable instancetype)initWithScope:(SentryScope *)scope options:(SentryOptions *)options;
42+
43+
/**
44+
* Initializes a SentryTraceContext with data from a dictionary.
45+
*/
46+
- (nullable instancetype)initWithDict:(NSDictionary<NSString *, id> *)dictionary;
47+
48+
/**
49+
* Initializes a SentryTraceContext with data from a trace, scope and options.
50+
*/
51+
- (nullable instancetype)initWithTracer:(SentryTracer *)tracer
52+
scope:(nullable SentryScope *)scope
53+
options:(SentryOptions *)options;
54+
55+
/**
56+
* Initializes a SentryTraceContext with data from a traceId, options and replayId.
57+
*
58+
* @param traceId The current tracer.
59+
* @param options The current active options.
60+
* @param replayId The current session replay.
61+
*/
62+
- (instancetype)initWithTraceId:(SentryId *)traceId
63+
options:(SentryOptions *)options
64+
replayId:(nullable NSString *)replayId;
65+
66+
@end
67+
68+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)