forked from getsentry/sentry-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSentrySpanProtocol.h
111 lines (90 loc) · 2.63 KB
/
SentrySpanProtocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#import "SentryDefines.h"
#import "SentrySerializable.h"
#import "SentrySpanContext.h"
NS_ASSUME_NONNULL_BEGIN
@class SentrySpanId, SentryId, SentryTraceHeader;
NS_SWIFT_NAME(Span)
@protocol SentrySpan <SentrySerializable>
/**
* The context information of the span.
*/
@property (nonatomic, readonly) SentrySpanContext *context;
/**
* The timestamp of which the span ended.
*/
@property (nullable, nonatomic, strong) NSDate *timestamp;
/**
* The start time of the span.
*/
@property (nullable, nonatomic, strong) NSDate *startTimestamp;
/**
* An arbitrary mapping of additional metadata of the span.
*/
@property (nullable, readonly) NSDictionary<NSString *, id> *data;
/**
* key-value pairs holding additional data about the span.
*/
@property (readonly) NSDictionary<NSString *, NSString *> *tags;
/**
* Whether the span is finished.
*/
@property (readonly) BOOL isFinished;
/**
* Starts a child span.
*
* @param operation Short code identifying the type of operation the span is measuring.
*
* @return SentrySpan
*/
- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
NS_SWIFT_NAME(startChild(operation:));
/**
* Starts a child span.
*
* @param operation Defines the child span operation.
* @param description Define the child span description.
*
* @return SentrySpan
*/
- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
description:(nullable NSString *)description
NS_SWIFT_NAME(startChild(operation:description:));
/**
* Sets a value to data.
*/
- (void)setDataValue:(nullable id)value forKey:(NSString *)key NS_SWIFT_NAME(setData(value:key:));
/**
* Use setDataValue instead. This method calls setDataValue, was added by mistake, and will be
* deprecated in a future version.
*/
- (void)setExtraValue:(nullable id)value forKey:(NSString *)key NS_SWIFT_NAME(setExtra(value:key:));
/**
* Removes a data value.
*/
- (void)removeDataForKey:(NSString *)key NS_SWIFT_NAME(removeData(key:));
/**
* Sets a tag value.
*/
- (void)setTagValue:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(setTag(value:key:));
/**
* Removes a tag value.
*/
- (void)removeTagForKey:(NSString *)key NS_SWIFT_NAME(removeTag(key:));
/**
* Finishes the span by setting the end time.
*/
- (void)finish;
/**
* Finishes the span by setting the end time and span status.
*
* @param status The status of this span
* */
- (void)finishWithStatus:(SentrySpanStatus)status NS_SWIFT_NAME(finish(status:));
/**
* Returns the trace information that could be sent as a sentry-trace header.
*
* @return SentryTraceHeader.
*/
- (SentryTraceHeader *)toTraceHeader;
@end
NS_ASSUME_NONNULL_END