forked from DataDog/dd-sdk-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-surface-swift
1398 lines (1398 loc) · 56.6 KB
/
api-surface-swift
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
public typealias AttributeKey = String
public typealias AttributeValue = Encodable
public class DDCrashReport: NSObject
public struct Thread: Encodable
public init(name: String,stack: String,crashed: Bool,state: String?)
public struct BinaryImage: Encodable
public init(libraryName: String,uuid: String,architecture: String,isSystemLibrary: Bool,loadAddress: String,maxAddress: String)
public struct Meta: Encodable
public init(incidentIdentifier: String?,processName: String?,parentProcess: String?,path: String?,codeType: String?,exceptionType: String?,exceptionCodes: String?)
public init(date: Date?,type: String,message: String,stack: String,threads: [Thread],binaryImages: [BinaryImage],meta: Meta,wasTruncated: Bool,context: Data?)
public protocol DDCrashReportingPluginType: AnyObject
func readPendingCrashReport(completion: (DDCrashReport?) -> Bool)
func inject(context: Data)
public func addLongTask(at: Date, duration: TimeInterval, attributes: [AttributeKey: AttributeValue] = [:])
public func updatePerformanceMetric(at: Date,metric: PerformanceMetric,value: Double,attributes: [AttributeKey: AttributeValue] = [:])
public class DDRUMMonitor
public func startView(viewController: UIViewController,path: String?,attributes: [AttributeKey: AttributeValue] = [:])
public func startView(viewController: UIViewController,name: String? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func stopView(viewController: UIViewController,attributes: [AttributeKey: AttributeValue] = [:])
public func startView(key: String,name: String? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func stopView(key: String,attributes: [AttributeKey: AttributeValue] = [:])
public func addTiming(name: String)
public func addError(message: String,type: String? = nil,source: RUMErrorSource = .custom,stack: String? = nil,attributes: [AttributeKey: AttributeValue] = [:],file: StaticString? = #file,line: UInt? = #line)
public func addError(error: Error,source: RUMErrorSource = .custom,attributes: [AttributeKey: AttributeValue] = [:])
public func startResourceLoading(resourceKey: String,request: URLRequest,attributes: [AttributeKey: AttributeValue] = [:])
public func startResourceLoading(resourceKey: String,url: URL,attributes: [AttributeKey: AttributeValue] = [:])
public func startResourceLoading(resourceKey: String,httpMethod: RUMMethod,urlString: String,attributes: [AttributeKey: AttributeValue] = [:])
public func addResourceMetrics(resourceKey: String,metrics: URLSessionTaskMetrics,attributes: [AttributeKey: AttributeValue] = [:])
public func addResourceMetrics(resourceKey: String,fetch: (start: Date, end: Date),redirection: (start: Date, end: Date)?,dns: (start: Date, end: Date)?,connect: (start: Date, end: Date)?,ssl: (start: Date, end: Date)?,firstByte: (start: Date, end: Date)?,download: (start: Date, end: Date)?,responseSize: Int64?,attributes: [AttributeKey: AttributeValue] = [:])
public func stopResourceLoading(resourceKey: String,response: URLResponse,size: Int64? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func stopResourceLoading(resourceKey: String,statusCode: Int?,kind: RUMResourceType,size: Int64? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func stopResourceLoadingWithError(resourceKey: String,error: Error,response: URLResponse? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func stopResourceLoadingWithError(resourceKey: String,errorMessage: String,type: String? = nil,response: URLResponse? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func startUserAction(type: RUMUserActionType,name: String,attributes: [AttributeKey: AttributeValue] = [:])
public func stopUserAction(type: RUMUserActionType,name: String? = nil,attributes: [AttributeKey: AttributeValue] = [:])
public func addUserAction(type: RUMUserActionType,name: String,attributes: [AttributeKey: AttributeValue] = [:])
public func addAttribute(forKey key: AttributeKey, value: AttributeValue)
public func removeAttribute(forKey key: AttributeKey)
public static var telemetry: _TelemetryProxy
public static func set(customVersion: String)
public struct _TelemetryProxy
public func setConfigurationMapper(mapper: @escaping (TelemetryConfigurationEvent) -> TelemetryConfigurationEvent)
public func debug(id: String, message: String)
public func error(id: String, message: String, kind: String?, stack: String?)
public func setLogEventMapper(_ mapper: LogEventMapper) -> ExtendedType
public class Datadog
public struct AppContext
public init(mainBundle: Bundle = Bundle.main, processInfo: ProcessInfo = ProcessInfo.processInfo)
public static func initialize(appContext: AppContext, configuration: Configuration)
public static func initialize(appContext: AppContext,trackingConsent: TrackingConsent,configuration: Configuration)
public static var verbosityLevel: LogLevel? = nil
public static var debugRUM = false
public static var isInitialized: Bool
public static func setUserInfo(id: String? = nil,name: String? = nil,email: String? = nil,extraInfo: [AttributeKey: AttributeValue] = [:])
public static func addUserExtraInfo(_ extraInfo: [AttributeKey: AttributeValue?])
public static func set(trackingConsent: TrackingConsent)
public static func clearAllData()
public static func flushAndDeinitialize()
public struct Configuration
public enum BatchSize
case small
case medium
case large
public enum UploadFrequency
case frequent
case average
case rare
public enum VitalsFrequency: String
case frequent
case average
case rare
case never
public enum DatadogEndpoint: String
case us1
case us3
case us5
case eu1
case us1_fed
public static let us: DatadogEndpoint = .us1
public static let eu: DatadogEndpoint = .eu1
public static let gov: DatadogEndpoint = .us1_fed
public enum LogsEndpoint
case us1
case us3
case us5
case eu1
case us1_fed
case us
case eu
case gov
case custom(url: String)
public enum TracesEndpoint
case us1
case us3
case us5
case eu1
case us1_fed
case us
case eu
case gov
case custom(url: String)
public enum RUMEndpoint
case us1
case us3
case us5
case eu1
case us1_fed
case us
case eu
case gov
case custom(url: String)
public static func builderUsing(rumApplicationID: String, clientToken: String, environment: String) -> Builder
public static func builderUsing(clientToken: String, environment: String) -> Builder
public class Builder
public func set(endpoint: DatadogEndpoint) -> Builder
public func set(customLogsEndpoint: URL) -> Builder
public func set(customTracesEndpoint: URL) -> Builder
public func set(customRUMEndpoint: URL) -> Builder
public func set(serverDateProvider: ServerDateProvider) -> Builder
public func enableLogging(_ enabled: Bool) -> Builder
public func setLogEventMapper(_ mapper: @escaping (LogEvent) -> LogEvent?) -> Builder
public func set(logsEndpoint: LogsEndpoint) -> Builder
public func set(loggingSamplingRate: Float) -> Builder
public func enableTracing(_ enabled: Bool) -> Builder
public func set(tracesEndpoint: TracesEndpoint) -> Builder
public func set(tracedHosts: Set<String>) -> Builder
public func track(firstPartyHosts: Set<String>) -> Builder
public func trackURLSession(firstPartyHosts: Set<String> = []) -> Builder
public func trackURLSession(firstPartyHostsWithHeaderTypes: [String: Set<TracingHeaderType>]) -> Builder
public func setSpanEventMapper(_ mapper: @escaping (SpanEvent) -> SpanEvent) -> Builder
public func set(tracingSamplingRate: Float) -> Builder
public func enableRUM(_ enabled: Bool) -> Builder
public func set(rumEndpoint: RUMEndpoint) -> Builder
public func set(rumSessionsSamplingRate: Float) -> Builder
public func onRUMSessionStart(_ handler: @escaping (String, Bool) -> Void) -> Builder
public func trackUIKitRUMViews(using predicate: UIKitRUMViewsPredicate = DefaultUIKitRUMViewsPredicate()) -> Builder
public func trackUIKitActions(_ enabled: Bool = true) -> Builder
public func trackUIKitRUMActions(using predicate: UIKitRUMUserActionsPredicate = DefaultUIKitRUMUserActionsPredicate()) -> Builder
public func trackRUMLongTasks(threshold: TimeInterval = 0.1) -> Builder
public func setRUMViewEventMapper(_ mapper: @escaping (RUMViewEvent) -> RUMViewEvent) -> Builder
public func setRUMResourceEventMapper(_ mapper: @escaping (RUMResourceEvent) -> RUMResourceEvent?) -> Builder
public func setRUMActionEventMapper(_ mapper: @escaping (RUMActionEvent) -> RUMActionEvent?) -> Builder
public func setRUMErrorEventMapper(_ mapper: @escaping (RUMErrorEvent) -> RUMErrorEvent?) -> Builder
public func setRUMLongTaskEventMapper(_ mapper: @escaping (RUMLongTaskEvent) -> RUMLongTaskEvent?) -> Builder
public func setRUMResourceAttributesProvider(_ provider: @escaping (URLRequest, URLResponse?, Data?, Error?) -> [AttributeKey: AttributeValue]?) -> Builder
public func trackBackgroundEvents(_ enabled: Bool = true) -> Builder
public func trackFrustrations(_ enabled: Bool = true) -> Builder
public func set(sampleTelemetry rate: Float) -> Builder
public func set(mobileVitalsFrequency: VitalsFrequency) -> Builder
public func enableCrashReporting(using crashReportingPlugin: DDCrashReportingPluginType) -> Builder
public func set(serviceName: String) -> Builder
public func set(batchSize: BatchSize) -> Builder
public func set(uploadFrequency: UploadFrequency) -> Builder
public func set(proxyConfiguration: [AnyHashable: Any]?) -> Builder
public func set(additionalConfiguration: [String: Any]) -> Builder
public func set(encryption: DataEncryption) -> Builder
public func build() -> Configuration
public let DatadogNTPServers = ["0.datadog.pool.ntp.org","1.datadog.pool.ntp.org","2.datadog.pool.ntp.org","3.datadog.pool.ntp.org"]
public protocol ServerDateProvider
func synchronize(update: @escaping (TimeInterval) -> Void)
public protocol DataEncryption
func encrypt(data: Data) throws -> Data
func decrypt(data: Data) throws -> Data
public protocol Writer
func write<T: Encodable>(value: T)
public struct DDAnyCodable: Codable
public let value: Any
public init<T>(_ value: T?)
public static func == (lhs: DDAnyCodable, rhs: DDAnyCodable) -> Bool
public struct DDAnyDecodable: Decodable
public let value: Any
public init<T>(_ value: T?)
public init(from decoder: Decoder) throws
public static func == (lhs: DDAnyDecodable, rhs: DDAnyDecodable) -> Bool
public struct DDAnyEncodable: Encodable
public let value: Any
public init<T>(_ value: T?)
public func encode(to encoder: Encoder) throws
public static func == (lhs: DDAnyEncodable, rhs: DDAnyEncodable) -> Bool
public struct CarrierInfo: Codable, Equatable
public enum RadioAccessTechnology: String, Codable, CaseIterable
case GPRS
case Edge
case WCDMA
case HSDPA
case HSUPA
case CDMA1x
case CDMAEVDORev0
case CDMAEVDORevA
case CDMAEVDORevB
case eHRPD
case LTE
case unknown
public let carrierName: String?
public let carrierISOCountryCode: String?
public let carrierAllowsVOIP: Bool
public let radioAccessTechnology: RadioAccessTechnology
public typealias DatadogSite = Datadog.Configuration.DatadogEndpoint
public struct DatadogContext
public let site: DatadogSite?
public let clientToken: String
public internal(set) var version: String
public let source: String
public let sdkVersion: String
public let applicationName: String
public let device: DeviceInfo
public internal(set) var featuresAttributes: [String: FeatureBaggage] = [:]
public struct DeviceInfo: Codable, Equatable
public struct NetworkConnectionInfo: Codable, Equatable
public enum Reachability: String, Codable, CaseIterable
case yes
case maybe
case no
public enum Interface: String, Codable, CaseIterable
case wifi
case wiredEthernet
case cellular
case loopback
case other
public let reachability: Reachability
public let availableInterfaces: [Interface]?
public let supportsIPv4: Bool?
public let supportsIPv6: Bool?
public let isExpensive: Bool?
public let isConstrained: Bool?
public enum TrackingConsent: Codable
case granted
case notGranted
case pending
public internal(set) var defaultDatadogCore: DatadogCoreProtocol = NOPDatadogCore()
public protocol DatadogCoreProtocol: AnyObject
func register(feature: DatadogFeature) throws
func feature<T>(named name: String, type: T.Type) -> T? where T: DatadogFeature
func register(integration: DatadogFeatureIntegration) throws
func integration<T>(named name: String, type: T.Type) -> T? where T: DatadogFeatureIntegration
func scope(for feature: String) -> FeatureScope?
func set(feature: String, attributes: @escaping () -> FeatureBaggage)
func send(message: FeatureMessage, else fallback: @escaping () -> Void)
public protocol FeatureScope
func eventWriteContext(bypassConsent: Bool, _ block: @escaping (DatadogContext, Writer) throws -> Void)
public extension FeatureScope
func eventWriteContext(_ block: @escaping (DatadogContext, Writer) throws -> Void)
public protocol DatadogFeature
var name: String
var requestBuilder: FeatureRequestBuilder
var messageReceiver: FeatureMessageReceiver
public protocol DatadogFeatureIntegration
var name: String
var messageReceiver: FeatureMessageReceiver
public struct DatadogExtension<ExtendedType>
public private(set) var type: ExtendedType
public init(_ type: ExtendedType)
public protocol DatadogExtended
associatedtype ExtendedType
static var dd: DatadogExtension<ExtendedType>.Type
var dd: DatadogExtension<ExtendedType>
public static var dd: DatadogExtension<Self>.Type
public var dd: DatadogExtension<Self>
public protocol DatadogInternal
associatedtype ExtendedType
static var _internal: DatadogExtension<ExtendedType>.Type
var _internal: DatadogExtension<ExtendedType>
public static var _internal: DatadogExtension<Self>.Type
public var _internal: DatadogExtension<Self>
public var name: String
public struct FeatureBaggage
public var isEmpty: Bool
public init(_ attributes: [String: Any?])
public func all<T>(of type: T.Type = T.self) -> [String: T]
public subscript<T>(key: String, type t: T.Type = T.self) -> T?
public subscript<T>(key: String, type t: T.Type = T.self) -> T? where T: RawRepresentable
public subscript<T>(dynamicMember key: String) -> T?
public subscript<T>(dynamicMember key: String) -> T? where T: RawRepresentable
public init(dictionaryLiteral elements: (String, Any?)...)
public enum FeatureMessage
case error(message: String,baggage: FeatureBaggage)
case event(target: String,event: DDAnyEncodable)
case custom(key: String,baggage: FeatureBaggage)
case context(DatadogContext)
public protocol FeatureMessageReceiver
func receive(message: FeatureMessage, from core: DatadogCoreProtocol) -> Bool
public struct NOPFeatureMessageReceiver: FeatureMessageReceiver
public func receive(message: FeatureMessage, from core: DatadogCoreProtocol) -> Bool
public protocol FeatureRequestBuilder
func request(for events: [Data], with context: DatadogContext) throws -> URLRequest
public struct DDURLRequestBuilder
public enum QueryItem
case ddsource(source: String)
case ddtags(tags: [String])
public struct HTTPHeader
public enum ContentType
case applicationJSON
case textPlainUTF8
case multipartFormData(boundary: String)
public static func contentTypeHeader(contentType: ContentType) -> HTTPHeader
public static func userAgentHeader(appName: String, appVersion: String, device: DeviceInfo) -> HTTPHeader
public static func ddAPIKeyHeader(clientToken: String) -> HTTPHeader
public static func ddEVPOriginHeader(source: String) -> HTTPHeader
public static func ddEVPOriginVersionHeader(sdkVersion: String) -> HTTPHeader
public static func ddRequestIDHeader() -> HTTPHeader
public init(url: URL,queryItems: [QueryItem],headers: [HTTPHeader])
public func uploadRequest(with body: Data, compress: Bool = true) -> URLRequest
public extension WKUserContentController
func trackDatadogEvents(in hosts: Set<String>, sdk core: DatadogCoreProtocol = defaultDatadogCore)
func stopTrackingDatadogEvents()
public typealias DDGlobal = Global
public struct Global
public static var sharedTracer: OTTracer = DDNoopGlobals.tracer
public static var rum: DDRUMMonitor = DDNoopRUMMonitor()
public enum LogLevel: Int, Codable
case debug
case info
case notice
case warn
case error
case critical
public typealias DDLogger = Logger
public protocol LoggerProtocol
func log(level: LogLevel, message: String, error: Error?, attributes: [String: Encodable]?)
func log(level: LogLevel,message: String,errorKind: String?,errorMessage: String?,stackTrace: String?,attributes: [String: Encodable]?)
func addAttribute(forKey key: AttributeKey, value: AttributeValue)
func removeAttribute(forKey key: AttributeKey)
func addTag(withKey key: String, value: String)
func removeTag(withKey key: String)
func add(tag: String)
func remove(tag: String)
public extension LoggerProtocol
func debug(_ message: String, error: Error? = nil, attributes: [AttributeKey: AttributeValue]? = nil)
func info(_ message: String, error: Error? = nil, attributes: [AttributeKey: AttributeValue]? = nil)
func notice(_ message: String, error: Error? = nil, attributes: [AttributeKey: AttributeValue]? = nil)
func warn(_ message: String, error: Error? = nil, attributes: [AttributeKey: AttributeValue]? = nil)
func error(_ message: String, error: Error? = nil, attributes: [AttributeKey: AttributeValue]? = nil)
func critical(_ message: String, error: Error? = nil, attributes: [AttributeKey: AttributeValue]? = nil)
public class Logger: LoggerProtocol
public func log(level: LogLevel, message: String, error: Error?, attributes: [String: Encodable]?)
public func log(level: LogLevel,message: String,errorKind: String?,errorMessage: String?,stackTrace: String?,attributes: [String: Encodable]?)
public func addAttribute(forKey key: AttributeKey, value: AttributeValue)
public func removeAttribute(forKey key: AttributeKey)
public func addTag(withKey key: String, value: String)
public func removeTag(withKey key: String)
public func add(tag: String)
public func remove(tag: String)
public static var builder: Builder
public class Builder
public func set(serviceName: String) -> Self
public func set(loggerName: String) -> Self
public func sendNetworkInfo(_ enabled: Bool) -> Self
public func bundleWithRUM(_ enabled: Bool) -> Self
public func bundleWithTrace(_ enabled: Bool) -> Self
public func sendLogsToDatadog(_ enabled: Bool) -> Self
public func set(datadogReportingThreshold: LogLevel) -> Self
public enum ConsoleLogFormat
case short
case shortWith(prefix: String)
public static let json: ConsoleLogFormat = .short
public static func jsonWith(prefix: String) -> ConsoleLogFormat
public func printLogsToConsole(_ enabled: Bool, usingFormat format: ConsoleLogFormat = .short) -> Self
public func build(in core: DatadogCoreProtocol = defaultDatadogCore) -> Logger
public struct LogEvent: Encodable
public enum Status: String, Encodable, CaseIterable, Equatable
case debug
case info
case notice
case warn
case error
case critical
case emergency
public struct Attributes
public var userAttributes: [String: Encodable]
public struct UserInfo
public let id: String?
public let name: String?
public let email: String?
public var extraInfo: [String: Encodable]
public struct Error
public var kind: String?
public var message: String?
public var stack: String?
public struct DeviceInfo: Codable
public let architecture: String
public struct Dd: Codable
public let device: DeviceInfo
public let date: Date
public let status: Status
public var message: String
public var error: Error?
public let serviceName: String
public let environment: String
public let loggerName: String
public let loggerVersion: String
public let threadName: String?
public let applicationVersion: String
public let dd: Dd
public var userInfo: UserInfo
public let networkConnectionInfo: NetworkConnectionInfo?
public let mobileCarrierInfo: CarrierInfo?
public var attributes: LogEvent.Attributes
public var tags: [String]?
public func encode(to encoder: Encoder) throws
public protocol LogEventMapper
func map(event: LogEvent, callback: @escaping (LogEvent) -> Void)
public struct OTTags
public static let component = "component"
public static let dbInstance = "db.instance"
public static let dbStatement = "db.statement"
public static let dbType = "db.type"
public static let dbUser = "db.user"
public static let error = "error"
public static let httpMethod = "http.method"
public static let httpStatusCode = "http.status_code"
public static let httpUrl = "http.url"
public static let messageBusDestination = "message_bus.destination"
public static let peerAddress = "peer.address"
public static let peerHostname = "peer.hostname"
public static let peerIPv4 = "peer.ipv4"
public static let peerIPv6 = "peer.ipv6"
public static let peerPort = "peer.port"
public static let peerService = "peer.service"
public static let samplingPriority = "sampling.priority"
public static let spanKind = "span.kind"
public struct OTLogFields
public static let errorKind = "error.kind"
public static let event = "event"
public static let message = "message"
public static let stack = "stack"
public protocol OTFormatReader: OTCustomFormatReader
public protocol OTFormatWriter: OTCustomFormatWriter
public protocol OTTextMapReader: OTFormatReader
public protocol OTTextMapWriter: OTFormatWriter
public protocol OTHTTPHeadersReader: OTTextMapReader
public protocol OTHTTPHeadersWriter: OTTextMapWriter
public protocol OTCustomFormatReader
func extract() -> OTSpanContext?
public protocol OTCustomFormatWriter
func inject(spanContext: OTSpanContext)
public struct OTReference
public let type: OTReferenceType
public let context: OTSpanContext
public static func child(of parent: OTSpanContext) -> OTReference
public static func follows(from precedingContext: OTSpanContext) -> OTReference
public enum OTReferenceType: String
case childOf = "CHILD_OF"
case followsFrom = "FOLLOWS_FROM"
public protocol OTSpan
var context: OTSpanContext
func tracer() -> OTTracer
func setOperationName(_ operationName: String)
func setTag(key: String, value: Encodable)
func log(fields: [String: Encodable], timestamp: Date)
func setBaggageItem(key: String, value: String)
func baggageItem(withKey key: String) -> String?
func finish(at time: Date)
func setActive() -> OTSpan
public extension OTSpan
func log(fields: [String: Encodable])
func finish()
public extension OTSpan
func setError(_ error: Error,file: StaticString = #fileID,line: UInt = #line)
func setError(kind: String,message: String,stack: String = "",file: StaticString = #fileID,line: UInt = #line)
public protocol OTSpanContext
func forEachBaggageItem(callback: (_ key: String, _ value: String) -> Bool)
public protocol OTTracer
func startSpan(operationName: String,references: [OTReference]?,tags: [String: Encodable]?,startTime: Date?) -> OTSpan
func startRootSpan(operationName: String,tags: [String: Encodable]?,startTime: Date?) -> OTSpan
func inject(spanContext: OTSpanContext, writer: OTFormatWriter)
func extract(reader: OTFormatReader) -> OTSpanContext?
var activeSpan: OTSpan?
public extension OTTracer
func startSpan(operationName: String,childOf parent: OTSpanContext? = nil,tags: [String: Encodable]? = nil,startTime: Date? = nil) -> OTSpan
func startRootSpan(operationName: String,tags: [String: Encodable]? = nil,startTime: Date? = nil) -> OTSpan
public struct RUMActionEvent: RUMDataModel
public let dd: DD
public var action: Action
public let application: Application
public let ciTest: RUMCITest?
public let connectivity: RUMConnectivity?
public internal(set) var context: RUMEventAttributes?
public let date: Int64
public let device: RUMDevice?
public let display: RUMDisplay?
public let os: RUMOperatingSystem?
public let service: String?
public let session: Session
public let source: Source?
public let synthetics: Synthetics?
public let type: String = "action"
public internal(set) var usr: RUMUser?
public let version: String?
public var view: View
public struct DD: Codable
public let action: Action?
public let browserSdkVersion: String?
public let formatVersion: Int64 = 2
public let session: Session?
public struct Action: Codable
public let position: Position?
public let target: Target?
public struct Position: Codable
public let x: Int64
public let y: Int64
public struct Target: Codable
public let height: Int64?
public let selector: String?
public let width: Int64?
public struct Session: Codable
public let plan: Plan
public enum Plan: Int, Codable
case plan1 = 1
case plan2 = 2
public struct Action: Codable
public let crash: Crash?
public let error: Error?
public let frustration: Frustration?
public let id: String?
public let loadingTime: Int64?
public let longTask: LongTask?
public let resource: Resource?
public var target: Target?
public let type: ActionType
public struct Crash: Codable
public let count: Int64
public struct Error: Codable
public let count: Int64
public struct Frustration: Codable
public let type: [FrustrationType]
public enum FrustrationType: String, Codable
case rageClick = "rage_click"
case deadClick = "dead_click"
case errorClick = "error_click"
case rageTap = "rage_tap"
case errorTap = "error_tap"
public struct LongTask: Codable
public let count: Int64
public struct Resource: Codable
public let count: Int64
public struct Target: Codable
public var name: String
public enum ActionType: String, Codable
case custom = "custom"
case click = "click"
case tap = "tap"
case scroll = "scroll"
case swipe = "swipe"
case applicationStart = "application_start"
case back = "back"
public struct Application: Codable
public let id: String
public struct Session: Codable
public let hasReplay: Bool?
public let id: String
public let type: SessionType
public enum SessionType: String, Codable
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
public enum Source: String, Codable
case android = "android"
case ios = "ios"
case browser = "browser"
case flutter = "flutter"
case reactNative = "react-native"
case roku = "roku"
public struct Synthetics: Codable
public let injected: Bool?
public let resultId: String
public let testId: String
public struct View: Codable
public let id: String
public let inForeground: Bool?
public var name: String?
public var referrer: String?
public var url: String
public struct RUMErrorEvent: RUMDataModel
public let dd: DD
public let action: Action?
public let application: Application
public let ciTest: RUMCITest?
public let connectivity: RUMConnectivity?
public internal(set) var context: RUMEventAttributes?
public let date: Int64
public let device: RUMDevice?
public let display: RUMDisplay?
public var error: Error
public internal(set) var featureFlags: FeatureFlags?
public let os: RUMOperatingSystem?
public let service: String?
public let session: Session
public let source: Source?
public let synthetics: Synthetics?
public let type: String = "error"
public internal(set) var usr: RUMUser?
public let version: String?
public var view: View
public struct DD: Codable
public let browserSdkVersion: String?
public let formatVersion: Int64 = 2
public let session: Session?
public struct Session: Codable
public let plan: Plan
public enum Plan: Int, Codable
case plan1 = 1
case plan2 = 2
public struct Action: Codable
public let id: RUMActionID
public struct Application: Codable
public let id: String
public struct Error: Codable
public var causes: [Causes]?
public let handling: Handling?
public let handlingStack: String?
public let id: String?
public let isCrash: Bool?
public var message: String
public var resource: Resource?
public let source: Source
public let sourceType: SourceType?
public var stack: String?
public let type: String?
public struct Causes: Codable
public var message: String
public let source: Source
public var stack: String?
public let type: String?
public enum Source: String, Codable
case network = "network"
case source = "source"
case console = "console"
case logger = "logger"
case agent = "agent"
case webview = "webview"
case custom = "custom"
case report = "report"
public enum Handling: String, Codable
case handled = "handled"
case unhandled = "unhandled"
public struct Resource: Codable
public let method: RUMMethod
public let provider: Provider?
public let statusCode: Int64
public var url: String
public struct Provider: Codable
public let domain: String?
public let name: String?
public let type: ProviderType?
public enum ProviderType: String, Codable
case ad = "ad"
case advertising = "advertising"
case analytics = "analytics"
case cdn = "cdn"
case content = "content"
case customerSuccess = "customer-success"
case firstParty = "first party"
case hosting = "hosting"
case marketing = "marketing"
case other = "other"
case social = "social"
case tagManager = "tag-manager"
case utility = "utility"
case video = "video"
public enum Source: String, Codable
case network = "network"
case source = "source"
case console = "console"
case logger = "logger"
case agent = "agent"
case webview = "webview"
case custom = "custom"
case report = "report"
public enum SourceType: String, Codable
case android = "android"
case browser = "browser"
case ios = "ios"
case reactNative = "react-native"
case flutter = "flutter"
case roku = "roku"
public struct FeatureFlags: Codable
public internal(set) var featureFlagsInfo: [String: Encodable]
public struct Session: Codable
public let hasReplay: Bool?
public let id: String
public let type: SessionType
public enum SessionType: String, Codable
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
public enum Source: String, Codable
case android = "android"
case ios = "ios"
case browser = "browser"
case flutter = "flutter"
case reactNative = "react-native"
case roku = "roku"
public struct Synthetics: Codable
public let injected: Bool?
public let resultId: String
public let testId: String
public struct View: Codable
public let id: String
public let inForeground: Bool?
public var name: String?
public var referrer: String?
public var url: String
public func encode(to encoder: Encoder) throws
public init(from decoder: Decoder) throws
public struct RUMLongTaskEvent: RUMDataModel
public let dd: DD
public let action: Action?
public let application: Application
public let ciTest: RUMCITest?
public let connectivity: RUMConnectivity?
public internal(set) var context: RUMEventAttributes?
public let date: Int64
public let device: RUMDevice?
public let display: RUMDisplay?
public let longTask: LongTask
public let os: RUMOperatingSystem?
public let service: String?
public let session: Session
public let source: Source?
public let synthetics: Synthetics?
public let type: String = "long_task"
public internal(set) var usr: RUMUser?
public let version: String?
public var view: View
public struct DD: Codable
public let browserSdkVersion: String?
public let discarded: Bool?
public let formatVersion: Int64 = 2
public let session: Session?
public struct Session: Codable
public let plan: Plan
public enum Plan: Int, Codable
case plan1 = 1
case plan2 = 2
public struct Action: Codable
public let id: RUMActionID
public struct Application: Codable
public let id: String
public struct LongTask: Codable
public let duration: Int64
public let id: String?
public let isFrozenFrame: Bool?
public struct Session: Codable
public let hasReplay: Bool?
public let id: String
public let type: SessionType
public enum SessionType: String, Codable
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
public enum Source: String, Codable
case android = "android"
case ios = "ios"
case browser = "browser"
case flutter = "flutter"
case reactNative = "react-native"
case roku = "roku"
public struct Synthetics: Codable
public let injected: Bool?
public let resultId: String
public let testId: String
public struct View: Codable
public let id: String
public var name: String?
public var referrer: String?
public var url: String
public struct RUMResourceEvent: RUMDataModel
public let dd: DD
public let action: Action?
public let application: Application
public let ciTest: RUMCITest?
public let connectivity: RUMConnectivity?
public internal(set) var context: RUMEventAttributes?
public let date: Int64
public let device: RUMDevice?
public let display: RUMDisplay?
public let os: RUMOperatingSystem?
public var resource: Resource
public let service: String?
public let session: Session
public let source: Source?
public let synthetics: Synthetics?
public let type: String = "resource"
public internal(set) var usr: RUMUser?
public let version: String?
public var view: View
public struct DD: Codable
public let browserSdkVersion: String?
public let discarded: Bool?
public let formatVersion: Int64 = 2
public let rulePsr: Double?
public let session: Session?
public let spanId: String?
public let traceId: String?
public struct Session: Codable
public let plan: Plan
public enum Plan: Int, Codable
case plan1 = 1
case plan2 = 2
public struct Action: Codable
public let id: RUMActionID
public struct Application: Codable
public let id: String
public struct Resource: Codable
public let connect: Connect?
public let dns: DNS?
public let download: Download?
public let duration: Int64
public let firstByte: FirstByte?
public let id: String?
public let method: RUMMethod?
public let provider: Provider?
public let redirect: Redirect?
public let size: Int64?
public let ssl: SSL?
public let statusCode: Int64?
public let type: ResourceType
public var url: String
public struct Connect: Codable
public let duration: Int64
public let start: Int64
public struct DNS: Codable
public let duration: Int64
public let start: Int64
public struct Download: Codable
public let duration: Int64
public let start: Int64
public struct FirstByte: Codable
public let duration: Int64
public let start: Int64
public struct Provider: Codable
public let domain: String?
public let name: String?
public let type: ProviderType?
public enum ProviderType: String, Codable
case ad = "ad"
case advertising = "advertising"
case analytics = "analytics"
case cdn = "cdn"
case content = "content"
case customerSuccess = "customer-success"
case firstParty = "first party"
case hosting = "hosting"
case marketing = "marketing"
case other = "other"
case social = "social"
case tagManager = "tag-manager"
case utility = "utility"
case video = "video"
public struct Redirect: Codable
public let duration: Int64
public let start: Int64
public struct SSL: Codable
public let duration: Int64
public let start: Int64
public enum ResourceType: String, Codable
case document = "document"
case xhr = "xhr"
case beacon = "beacon"
case fetch = "fetch"
case css = "css"
case js = "js"
case image = "image"
case font = "font"
case media = "media"
case other = "other"
case native = "native"
public struct Session: Codable
public let hasReplay: Bool?
public let id: String
public let type: SessionType
public enum SessionType: String, Codable
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
public enum Source: String, Codable
case android = "android"
case ios = "ios"
case browser = "browser"
case flutter = "flutter"
case reactNative = "react-native"
case roku = "roku"
public struct Synthetics: Codable
public let injected: Bool?
public let resultId: String
public let testId: String
public struct View: Codable
public let id: String
public var name: String?
public var referrer: String?
public var url: String
public struct RUMViewEvent: RUMDataModel
public let dd: DD
public let application: Application
public let ciTest: RUMCITest?
public let connectivity: RUMConnectivity?
public internal(set) var context: RUMEventAttributes?
public let date: Int64
public let device: RUMDevice?
public let display: RUMDisplay?
public internal(set) var featureFlags: FeatureFlags?
public let os: RUMOperatingSystem?
public let service: String?
public let session: Session
public let source: Source?
public let synthetics: Synthetics?
public let type: String = "view"
public internal(set) var usr: RUMUser?
public let version: String?
public var view: View
public struct DD: Codable
public let browserSdkVersion: String?
public let documentVersion: Int64
public let formatVersion: Int64 = 2
public let session: Session?
public struct Session: Codable
public let plan: Plan
public enum Plan: Int, Codable
case plan1 = 1
case plan2 = 2
public struct Application: Codable
public let id: String
public struct FeatureFlags: Codable
public internal(set) var featureFlagsInfo: [String: Encodable]
public struct Session: Codable
public let hasReplay: Bool?
public let id: String
public let type: SessionType
public enum SessionType: String, Codable
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
public enum Source: String, Codable
case android = "android"
case ios = "ios"
case browser = "browser"
case flutter = "flutter"
case reactNative = "react-native"
case roku = "roku"
public struct Synthetics: Codable
public let injected: Bool?
public let resultId: String
public let testId: String
public struct View: Codable
public let action: Action
public let cpuTicksCount: Double?
public let cpuTicksPerSecond: Double?
public let crash: Crash?
public let cumulativeLayoutShift: Double?
public let customTimings: [String: Int64]?
public let domComplete: Int64?
public let domContentLoaded: Int64?
public let domInteractive: Int64?
public let error: Error
public let firstByte: Int64?
public let firstContentfulPaint: Int64?
public let firstInputDelay: Int64?
public let firstInputTime: Int64?
public let flutterBuildTime: FlutterBuildTime?
public let flutterRasterTime: FlutterRasterTime?
public let frozenFrame: FrozenFrame?
public let frustration: Frustration?
public let id: String
public let inForegroundPeriods: [InForegroundPeriods]?
public let isActive: Bool?
public let isSlowRendered: Bool?
public let jsRefreshRate: JsRefreshRate?
public let largestContentfulPaint: Int64?
public let loadEvent: Int64?
public let loadingTime: Int64?
public let loadingType: LoadingType?
public let longTask: LongTask?
public let memoryAverage: Double?
public let memoryMax: Double?
public var name: String?
public var referrer: String?
public let refreshRateAverage: Double?
public let refreshRateMin: Double?
public let resource: Resource
public let timeSpent: Int64
public var url: String
public struct Action: Codable
public let count: Int64
public struct Crash: Codable
public let count: Int64
public struct Error: Codable
public let count: Int64
public struct FlutterBuildTime: Codable
public let average: Double
public let max: Double
public let metricMax: Double?
public let min: Double
public struct FlutterRasterTime: Codable
public let average: Double
public let max: Double
public let metricMax: Double?
public let min: Double
public struct FrozenFrame: Codable
public let count: Int64
public struct Frustration: Codable