@datadog/mobile-react-native 2.14.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +6 -6
- package/README.md +23 -13
- package/android/build.gradle +10 -11
- package/android/gradle.properties +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
- package/android/src/test/resources/input/complete-configuration.json +32 -28
- package/android/src/test/resources/input/malformed-configuration.json +1 -1
- package/android/src/test/resources/input/minimal-configuration.json +4 -2
- package/datadog-configuration.schema.json +187 -139
- package/ios/Sources/AnyEncodable.swift +14 -7
- package/ios/Sources/Attributes.swift +0 -7
- package/ios/Sources/DatadogSDKWrapper.swift +12 -128
- package/ios/Sources/DdLogsImplementation.swift +9 -39
- package/ios/Sources/DdRum.mm +89 -1
- package/ios/Sources/DdRumImplementation.swift +79 -0
- package/ios/Sources/DdSdk.mm +76 -11
- package/ios/Sources/DdSdkConfiguration.swift +159 -117
- package/ios/Sources/DdSdkImplementation.swift +235 -82
- package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
- package/ios/Sources/DdTelemetry.swift +49 -0
- package/ios/Sources/GlobalState.swift +1 -1
- package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
- package/ios/Sources/SdkVersion.swift +1 -1
- package/jest/mock.js +43 -4
- package/lib/commonjs/DdAttributes.js.map +1 -0
- package/lib/commonjs/DdSdkReactNative.js +159 -56
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/InternalLog.js +1 -1
- package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
- package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
- package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
- package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.js +120 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
- package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/commonjs/config/types/BatchSize.js +31 -0
- package/lib/commonjs/config/types/BatchSize.js.map +1 -0
- package/lib/commonjs/config/types/InitializationMode.js +17 -0
- package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
- package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
- package/lib/commonjs/config/types/UploadFrequency.js +30 -0
- package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/commonjs/config/types/index.js +68 -0
- package/lib/commonjs/config/types/index.js.map +1 -0
- package/lib/commonjs/index.js +51 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +13 -9
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/logs/eventMapper.js +4 -1
- package/lib/commonjs/logs/eventMapper.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +0 -45
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +56 -28
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/helper.js +63 -0
- package/lib/commonjs/rum/helper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -25
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/commonjs/rum/types.js +1 -9
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
- package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/commonjs/sdk/DdSdk.js +4 -2
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
- package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +7 -5
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/types.js +19 -46
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
- package/lib/commonjs/utils/singletonUtils.js +21 -0
- package/lib/commonjs/utils/singletonUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdAttributes.js.map +1 -0
- package/lib/module/DdSdkReactNative.js +155 -52
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/InternalLog.js +1 -1
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/config/DatadogProviderConfiguration.js +18 -0
- package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.js +341 -0
- package/lib/module/config/FileBasedConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.type.js +2 -0
- package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/module/config/async/asyncInitializationHelper.js +36 -0
- package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.js +98 -0
- package/lib/module/config/features/CoreConfiguration.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.type.js +2 -0
- package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/module/config/features/CoreConfigurationNative.js +31 -0
- package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.js +30 -0
- package/lib/module/config/features/LogsConfiguration.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.type.js +2 -0
- package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/module/config/features/LogsConfigurationNative.js +2 -0
- package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.js +114 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.type.js +2 -0
- package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/module/config/features/RumConfigurationNative.js +2 -0
- package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.js +18 -0
- package/lib/module/config/features/TraceConfiguration.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.type.js +2 -0
- package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/module/config/features/TraceConfigurationNative.js +2 -0
- package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/module/config/types/BatchProcessingLevel.js +25 -0
- package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/module/config/types/BatchSize.js +26 -0
- package/lib/module/config/types/BatchSize.js.map +1 -0
- package/lib/module/config/types/InitializationMode.js +11 -0
- package/lib/module/config/types/InitializationMode.js.map +1 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/module/config/types/SdkVerbosity.js.map +1 -0
- package/lib/module/config/types/TrackingConsent.js.map +1 -0
- package/lib/module/config/types/UploadFrequency.js +25 -0
- package/lib/module/config/types/UploadFrequency.js.map +1 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/module/config/types/index.js +15 -0
- package/lib/module/config/types/index.js.map +1 -0
- package/lib/module/index.js +13 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +13 -9
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/logs/eventMapper.js +4 -1
- package/lib/module/logs/eventMapper.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +1 -43
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +54 -26
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/helper.js +49 -0
- package/lib/module/rum/helper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -24
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/module/rum/types.js +0 -9
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
- package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/types.js +2 -0
- package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
- package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/module/sdk/DdSdk.js +4 -4
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +80 -0
- package/lib/module/sdk/DdSdkInternal.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
- package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/trace/DdTrace.js +7 -6
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/types.js +22 -42
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/longTasksUtils.js.map +1 -1
- package/lib/module/utils/singletonUtils.js +14 -0
- package/lib/module/utils/singletonUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/DdSdkReactNative.d.ts +49 -12
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/InternalLog.d.ts +1 -1
- package/lib/typescript/InternalLog.d.ts.map +1 -1
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +10 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +20 -9
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/logs/DdLogs.d.ts +2 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/logs/eventMapper.d.ts +3 -2
- package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
- package/lib/typescript/logs/types.d.ts +1 -16
- package/lib/typescript/logs/types.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +2 -15
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +10 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
- package/lib/typescript/rum/helper.d.ts +10 -0
- package/lib/typescript/rum/helper.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/rum/types.d.ts +47 -7
- package/lib/typescript/rum/types.d.ts.map +1 -1
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
- package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts +2 -3
- package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts +1 -2
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +74 -92
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
- package/lib/typescript/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +246 -104
- package/src/InternalLog.tsx +1 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
- package/src/__tests__/InternalLog.test.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
- package/src/config/DatadogProviderConfiguration.ts +17 -0
- package/src/config/FileBasedConfiguration.ts +464 -0
- package/src/config/FileBasedConfiguration.type.ts +66 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
- package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
- package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
- package/src/config/async/PartialInitializationConfiguration.ts +58 -0
- package/src/config/async/asyncInitializationHelper.tsx +51 -0
- package/src/config/features/CoreConfiguration.ts +130 -0
- package/src/config/features/CoreConfiguration.type.ts +119 -0
- package/src/config/features/CoreConfigurationNative.ts +50 -0
- package/src/config/features/LogsConfiguration.ts +38 -0
- package/src/config/features/LogsConfiguration.type.ts +33 -0
- package/src/config/features/LogsConfigurationNative.ts +10 -0
- package/src/config/features/RumConfiguration.ts +137 -0
- package/src/config/features/RumConfiguration.type.ts +164 -0
- package/src/config/features/RumConfigurationNative.ts +26 -0
- package/src/config/features/TraceConfiguration.ts +24 -0
- package/src/config/features/TraceConfiguration.type.ts +17 -0
- package/src/config/features/TraceConfigurationNative.ts +8 -0
- package/src/config/types/BatchProcessingLevel.ts +23 -0
- package/src/config/types/BatchSize.ts +24 -0
- package/src/config/types/InitializationMode.ts +9 -0
- package/src/config/types/InitializationModeForTelemetry.ts +11 -0
- package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
- package/src/config/types/UploadFrequency.tsx +23 -0
- package/src/config/types/VitalsUpdateFrequency.ts +11 -0
- package/src/config/types/index.ts +15 -0
- package/src/index.tsx +33 -16
- package/src/logs/DdLogs.ts +14 -13
- package/src/logs/__tests__/DdLogs.test.ts +60 -107
- package/src/logs/__tests__/eventMapper.test.ts +1 -1
- package/src/logs/eventMapper.ts +5 -4
- package/src/logs/types.ts +1 -20
- package/src/nativeModulesTypes.ts +2 -17
- package/src/rum/DdRum.ts +139 -42
- package/src/rum/__tests__/DdRum.test.ts +217 -47
- package/src/rum/eventMappers/errorEventMapper.ts +1 -1
- package/src/rum/helper.ts +62 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +20 -32
- package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
- package/src/rum/types.ts +68 -8
- package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
- package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
- package/src/sdk/AccountInfoSingleton/types.ts +11 -0
- package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
- package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
- package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
- package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
- package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
- package/src/sdk/AttributesEncoding/helpers.ts +176 -0
- package/src/sdk/AttributesEncoding/types.ts +33 -0
- package/src/sdk/AttributesEncoding/utils.ts +31 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
- package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
- package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
- package/src/sdk/DdSdk.ts +8 -5
- package/src/sdk/DdSdkInternal.ts +121 -0
- package/src/sdk/EventMappers/EventMapper.ts +9 -4
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
- package/src/sdk/GlobalState/GlobalState.tsx +10 -11
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
- package/src/sdk/UserInfoSingleton/types.ts +1 -4
- package/src/specs/NativeDdRum.ts +65 -0
- package/src/specs/NativeDdSdk.ts +40 -6
- package/src/trace/DdTrace.ts +11 -7
- package/src/trace/__tests__/DdTrace.test.ts +7 -8
- package/src/types.tsx +97 -76
- package/src/utils/__tests__/errorUtils.test.ts +1 -1
- package/src/utils/__tests__/singletonUtils.test.ts +75 -0
- package/src/utils/longTasksUtils.ts +1 -3
- package/src/utils/singletonUtils.ts +17 -0
- package/src/version.ts +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/commonjs/ProxyConfiguration.js.map +0 -1
- package/lib/commonjs/SdkVerbosity.js.map +0 -1
- package/lib/commonjs/TrackingConsent.js.map +0 -1
- package/lib/commonjs/rum/DdAttributes.js.map +0 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/commonjs/utils/argsUtils.js +0 -41
- package/lib/commonjs/utils/argsUtils.js.map +0 -1
- package/lib/commonjs/utils/errorUtils.js.map +0 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
- package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/module/ProxyConfiguration.js.map +0 -1
- package/lib/module/SdkVerbosity.js.map +0 -1
- package/lib/module/TrackingConsent.js.map +0 -1
- package/lib/module/rum/DdAttributes.js.map +0 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/module/utils/argsUtils.js +0 -35
- package/lib/module/utils/argsUtils.js.map +0 -1
- package/lib/module/utils/errorUtils.js.map +0 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
- package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
- package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
- package/lib/typescript/TrackingConsent.d.ts.map +0 -1
- package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
- package/lib/typescript/utils/argsUtils.d.ts +0 -8
- package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
- package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
- package/src/DdSdkReactNativeConfiguration.tsx +0 -582
- package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
- package/src/utils/__tests__/argsUtils.test.ts +0 -66
- package/src/utils/argsUtils.ts +0 -41
- /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
- /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
- /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
- /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
- /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
- /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
- /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
|
@@ -5,77 +5,159 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import DatadogCore
|
|
8
|
-
import DatadogRUM
|
|
9
8
|
import DatadogInternal
|
|
9
|
+
import DatadogRUM
|
|
10
10
|
import Foundation
|
|
11
11
|
|
|
12
12
|
extension NSDictionary {
|
|
13
13
|
|
|
14
14
|
func asDdSdkConfiguration() -> DdSdkConfiguration {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
let
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
let
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
let
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
let additionalConfiguration = self["additionalConfiguration"] as? NSDictionary
|
|
16
|
+
|
|
17
|
+
let clientToken = (self["clientToken"] as? String) ?? ""
|
|
18
|
+
let env = (self["env"] as? String) ?? ""
|
|
19
|
+
|
|
20
|
+
let siteString = self["site"] as? NSString
|
|
21
|
+
let site = siteString.asSite()
|
|
22
|
+
|
|
23
|
+
let service = self["service"] as? NSString
|
|
24
|
+
let verbosity = self["verbosity"] as? NSString
|
|
25
|
+
|
|
26
|
+
let trackingConsentString = self["trackingConsent"] as? NSString
|
|
27
|
+
let trackingConsent = trackingConsentString.asTrackingConsent()
|
|
28
|
+
|
|
29
|
+
let uploadFrequencyString = self["uploadFrequency"] as? NSString
|
|
30
|
+
let uploadFrequency = uploadFrequencyString.asUploadFrequency()
|
|
31
|
+
|
|
32
|
+
let batchSizeString = self["batchSize"] as? NSString
|
|
33
|
+
let batchSize = batchSizeString.asBatchSize()
|
|
34
|
+
|
|
35
|
+
let batchProcessingLevelString = self["batchProcessingLevel"] as? NSString
|
|
36
|
+
let batchProcessingLevel = batchProcessingLevelString.asBatchProcessingLevel()
|
|
37
|
+
|
|
38
|
+
let proxyConfigurationDict = self["proxyConfiguration"] as? NSDictionary
|
|
39
|
+
let proxyConfiguration = proxyConfigurationDict?.asProxyConfiguration()
|
|
40
|
+
|
|
41
|
+
let firstPartyHostsArray = self["firstPartyHosts"] as? NSArray
|
|
42
|
+
let firstPartyHosts = firstPartyHostsArray?.asFirstPartyHosts()
|
|
43
|
+
|
|
44
|
+
// MARK: - RUM configuration
|
|
45
|
+
|
|
46
|
+
let rumConfigurationDict = self["rumConfiguration"] as? NSDictionary
|
|
47
|
+
let rumConfiguration: RumConfiguration?
|
|
48
|
+
|
|
49
|
+
if let rumDict = rumConfigurationDict {
|
|
50
|
+
let applicationId = (rumDict["applicationId"] as? String) ?? ""
|
|
51
|
+
|
|
52
|
+
let trackFrustrations = rumDict["trackFrustrations"] as? Bool
|
|
53
|
+
let longTaskThresholdMs = rumDict["longTaskThresholdMs"] as? Double
|
|
54
|
+
let sessionSampleRate = rumDict["sessionSampleRate"] as? Double
|
|
55
|
+
let resourceTraceSampleRate = rumDict["resourceTraceSampleRate"] as? Double
|
|
56
|
+
let vitalsUpdateFrequencyString = rumDict["vitalsUpdateFrequency"] as? NSString
|
|
57
|
+
let vitalsUpdateFrequency = vitalsUpdateFrequencyString.asVitalsUpdateFrequency()
|
|
58
|
+
|
|
59
|
+
let trackBackgroundEvents = rumDict["trackBackgroundEvents"] as? Bool
|
|
60
|
+
let nativeCrashReportEnabled = rumDict["nativeCrashReportEnabled"] as? Bool
|
|
61
|
+
let nativeLongTaskThresholdMs = rumDict["nativeLongTaskThresholdMs"] as? Double
|
|
62
|
+
let nativeViewTracking = rumDict["nativeViewTracking"] as? Bool
|
|
63
|
+
let nativeInteractionTracking = rumDict["nativeInteractionTracking"] as? Bool
|
|
64
|
+
|
|
65
|
+
let appHangThreshold = rumDict["appHangThreshold"] as? Double
|
|
66
|
+
let trackWatchdogTerminations = rumDict["trackWatchdogTerminations"] as? Bool
|
|
67
|
+
let initialResourceThreshold = rumDict["initialResourceThreshold"] as? Double
|
|
68
|
+
let trackMemoryWarnings = rumDict["trackMemoryWarnings"] as? Bool
|
|
69
|
+
let telemetrySampleRate = rumDict["telemetrySampleRate"] as? Double
|
|
70
|
+
let customEndpoint = rumDict["customEndpoint"] as? String
|
|
71
|
+
|
|
72
|
+
rumConfiguration = RumConfiguration(
|
|
73
|
+
applicationId: applicationId,
|
|
74
|
+
trackFrustrations: trackFrustrations ?? DefaultConfiguration.trackFrustrations,
|
|
75
|
+
longTaskThresholdMs: longTaskThresholdMs
|
|
76
|
+
?? DefaultConfiguration.longTaskThresholdMs,
|
|
77
|
+
sessionSampleRate: sessionSampleRate ?? DefaultConfiguration.sessionSamplingRate,
|
|
78
|
+
resourceTraceSampleRate: resourceTraceSampleRate
|
|
79
|
+
?? DefaultConfiguration.resourceTraceSampleRate,
|
|
80
|
+
vitalsUpdateFrequency: vitalsUpdateFrequency,
|
|
81
|
+
trackBackgroundEvents: trackBackgroundEvents
|
|
82
|
+
?? DefaultConfiguration.trackBackgroundEvents,
|
|
83
|
+
nativeCrashReportEnabled: nativeCrashReportEnabled
|
|
84
|
+
?? DefaultConfiguration.nativeCrashReportEnabled,
|
|
85
|
+
nativeLongTaskThresholdMs: nativeLongTaskThresholdMs
|
|
86
|
+
?? DefaultConfiguration.nativeLongTaskThresholdMs,
|
|
87
|
+
nativeViewTracking: nativeViewTracking ?? DefaultConfiguration.nativeViewTracking,
|
|
88
|
+
nativeInteractionTracking: nativeInteractionTracking
|
|
89
|
+
?? DefaultConfiguration.nativeInteractionTracking,
|
|
90
|
+
appHangThreshold: appHangThreshold,
|
|
91
|
+
trackWatchdogTerminations: trackWatchdogTerminations
|
|
92
|
+
?? DefaultConfiguration.trackWatchdogTerminations,
|
|
93
|
+
initialResourceThreshold: initialResourceThreshold,
|
|
94
|
+
trackMemoryWarnings: trackMemoryWarnings
|
|
95
|
+
?? DefaultConfiguration.trackMemoryWarnings,
|
|
96
|
+
telemetrySampleRate: telemetrySampleRate
|
|
97
|
+
?? DefaultConfiguration.telemetrySampleRate,
|
|
98
|
+
customEndpoint: customEndpoint
|
|
99
|
+
)
|
|
100
|
+
} else {
|
|
101
|
+
rumConfiguration = nil
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// MARK: - Logs configuration
|
|
105
|
+
|
|
106
|
+
let logsConfigurationDict = self["logsConfiguration"] as? NSDictionary
|
|
107
|
+
let logsConfiguration: LogsConfiguration?
|
|
108
|
+
|
|
109
|
+
if let logsDict = logsConfigurationDict {
|
|
110
|
+
let bundleLogsWithRum = logsDict["bundleLogsWithRum"] as? Bool
|
|
111
|
+
let bundleLogsWithTraces = logsDict["bundleLogsWithTraces"] as? Bool
|
|
112
|
+
let customEndpoint = logsDict["customEndpoint"] as? String
|
|
113
|
+
|
|
114
|
+
logsConfiguration = LogsConfiguration(
|
|
115
|
+
bundleLogsWithRum: bundleLogsWithRum ?? DefaultConfiguration.bundleLogsWithRum,
|
|
116
|
+
bundleLogsWithTraces: bundleLogsWithTraces
|
|
117
|
+
?? DefaultConfiguration.bundleLogsWithTraces,
|
|
118
|
+
customEndpoint: customEndpoint
|
|
119
|
+
)
|
|
120
|
+
} else {
|
|
121
|
+
logsConfiguration = nil
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// MARK: - Trace configuration (TraceNativeConfiguration)
|
|
125
|
+
|
|
126
|
+
let traceConfigurationDict = self["traceConfiguration"] as? NSDictionary
|
|
127
|
+
let traceConfiguration: TraceConfiguration?
|
|
128
|
+
|
|
129
|
+
if let traceDict = traceConfigurationDict {
|
|
130
|
+
let customEndpoint = traceDict["customEndpoint"] as? String
|
|
131
|
+
|
|
132
|
+
traceConfiguration = TraceConfiguration(
|
|
133
|
+
customEndpoint: customEndpoint
|
|
134
|
+
)
|
|
135
|
+
} else {
|
|
136
|
+
traceConfiguration = nil
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// MARK: - ConfigurationForTelemetry
|
|
140
|
+
|
|
141
|
+
let configurationForTelemetryDict = self["configurationForTelemetry"] as? NSDictionary
|
|
142
|
+
let configurationForTelemetry = configurationForTelemetryDict?.asConfigurationForTelemetry()
|
|
46
143
|
|
|
47
144
|
return DdSdkConfiguration(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
longTaskThresholdMs: (longTaskThresholdMs != nil) ? longTaskThresholdMs! : Double(),
|
|
54
|
-
sampleRate: sampleRate,
|
|
55
|
-
site: site.asSite(),
|
|
56
|
-
trackingConsent: trackingConsent.asTrackingConsent(),
|
|
57
|
-
telemetrySampleRate: telemetrySampleRate,
|
|
58
|
-
vitalsUpdateFrequency: vitalsUpdateFrequency.asVitalsUpdateFrequency(),
|
|
59
|
-
trackFrustrations: trackFrustrations,
|
|
60
|
-
uploadFrequency: uploadFrequency.asUploadFrequency(),
|
|
61
|
-
batchSize: batchSize.asBatchSize(),
|
|
62
|
-
trackBackgroundEvents: trackBackgroundEvents,
|
|
63
|
-
customEndpoints: customEndpoints?.asCustomEndpoints(),
|
|
64
|
-
additionalConfig: additionalConfig,
|
|
65
|
-
configurationForTelemetry: configurationForTelemetry?.asConfigurationForTelemetry(),
|
|
66
|
-
nativeViewTracking: nativeViewTracking,
|
|
67
|
-
nativeInteractionTracking: nativeInteractionTracking,
|
|
145
|
+
additionalConfiguration: additionalConfiguration,
|
|
146
|
+
clientToken: clientToken,
|
|
147
|
+
env: env,
|
|
148
|
+
site: site,
|
|
149
|
+
service: service,
|
|
68
150
|
verbosity: verbosity,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
151
|
+
trackingConsent: trackingConsent,
|
|
152
|
+
uploadFrequency: uploadFrequency,
|
|
153
|
+
batchSize: batchSize,
|
|
154
|
+
batchProcessingLevel: batchProcessingLevel,
|
|
155
|
+
proxyConfiguration: proxyConfiguration,
|
|
156
|
+
firstPartyHosts: firstPartyHosts,
|
|
157
|
+
rumConfiguration: rumConfiguration,
|
|
158
|
+
logsConfiguration: logsConfiguration,
|
|
159
|
+
traceConfiguration: traceConfiguration,
|
|
160
|
+
configurationForTelemetry: configurationForTelemetry
|
|
79
161
|
)
|
|
80
162
|
}
|
|
81
163
|
|
|
@@ -97,19 +179,7 @@ extension NSDictionary {
|
|
|
97
179
|
)
|
|
98
180
|
}
|
|
99
181
|
|
|
100
|
-
func
|
|
101
|
-
let rum = object(forKey: "rum") as? NSString
|
|
102
|
-
let logs = object(forKey: "logs") as? NSString
|
|
103
|
-
let trace = object(forKey: "trace") as? NSString
|
|
104
|
-
|
|
105
|
-
return CustomEndpoints(
|
|
106
|
-
rum: rum,
|
|
107
|
-
logs: logs,
|
|
108
|
-
trace: trace
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
func asProxyConfig() -> [AnyHashable: Any]? {
|
|
182
|
+
func asProxyConfiguration() -> [AnyHashable: Any]? {
|
|
113
183
|
guard let address = object(forKey: "address") as? String else {
|
|
114
184
|
return nil
|
|
115
185
|
}
|
|
@@ -159,42 +229,47 @@ extension NSArray {
|
|
|
159
229
|
* iOS config: { "example.com": [DATADOG, B3] }
|
|
160
230
|
*/
|
|
161
231
|
func asFirstPartyHosts() -> [String: Set<TracingHeaderType>] {
|
|
162
|
-
return reduce(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if let
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
firstPartyHosts[match]
|
|
232
|
+
return reduce(
|
|
233
|
+
into: [:],
|
|
234
|
+
{ firstPartyHosts, h in
|
|
235
|
+
let host = (h as? NSDictionary)
|
|
236
|
+
|
|
237
|
+
if let match = (host?.value(forKey: "match") as? String),
|
|
238
|
+
let propagatorTypes = (host?.value(forKey: "propagatorTypes") as? NSArray)
|
|
239
|
+
{
|
|
240
|
+
if let hostPropagatorTypes = firstPartyHosts[match] {
|
|
241
|
+
firstPartyHosts[match] = hostPropagatorTypes.union(
|
|
242
|
+
propagatorTypes.asTracingHeaderType())
|
|
243
|
+
} else {
|
|
244
|
+
firstPartyHosts[match] = propagatorTypes.asTracingHeaderType()
|
|
245
|
+
}
|
|
171
246
|
}
|
|
172
|
-
}
|
|
173
|
-
})
|
|
247
|
+
})
|
|
174
248
|
}
|
|
175
|
-
|
|
249
|
+
|
|
176
250
|
func asTracingHeaderType() -> Set<TracingHeaderType> {
|
|
177
|
-
return Set(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
251
|
+
return Set(
|
|
252
|
+
compactMap { headerType in
|
|
253
|
+
switch (headerType as? String)?.lowercased() {
|
|
254
|
+
case "datadog":
|
|
255
|
+
return TracingHeaderType.datadog
|
|
256
|
+
case "b3":
|
|
257
|
+
return TracingHeaderType.b3
|
|
258
|
+
case "b3multi":
|
|
259
|
+
return TracingHeaderType.b3multi
|
|
260
|
+
case "tracecontext":
|
|
261
|
+
return TracingHeaderType.tracecontext
|
|
262
|
+
default:
|
|
263
|
+
return nil
|
|
264
|
+
}
|
|
265
|
+
})
|
|
191
266
|
}
|
|
192
267
|
}
|
|
193
268
|
|
|
194
269
|
internal struct DefaultConfiguration {
|
|
195
270
|
static let nativeCrashReportEnabled = false
|
|
196
271
|
static let sessionSamplingRate = 100.0
|
|
197
|
-
static let
|
|
272
|
+
static let resourceTraceSampleRate = 100.0
|
|
198
273
|
static let longTaskThresholdMs = 0.0
|
|
199
274
|
static let nativeLongTaskThresholdMs = 200.0
|
|
200
275
|
static let nativeViewTracking = false
|
|
@@ -206,80 +281,167 @@ internal struct DefaultConfiguration {
|
|
|
206
281
|
static let bundleLogsWithRum = true
|
|
207
282
|
static let bundleLogsWithTraces = true
|
|
208
283
|
static let trackWatchdogTerminations = false
|
|
284
|
+
static let trackMemoryWarnings = true
|
|
209
285
|
}
|
|
210
286
|
|
|
211
287
|
extension Dictionary where Key == String, Value == AnyObject {
|
|
212
288
|
func asDdSdkConfigurationFromJSON() throws -> DdSdkConfiguration {
|
|
213
|
-
guard let configuration = self["configuration"] as?
|
|
214
|
-
throw ProgrammerError(
|
|
289
|
+
guard let configuration = self["configuration"] as? [String: Any?] else {
|
|
290
|
+
throw ProgrammerError(
|
|
291
|
+
description: "JSON configuration file is missing top-level \"configuration\" key.")
|
|
215
292
|
}
|
|
216
293
|
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
let
|
|
223
|
-
let
|
|
224
|
-
|
|
225
|
-
let
|
|
226
|
-
let
|
|
227
|
-
|
|
228
|
-
let
|
|
229
|
-
let uploadFrequency = configuration["uploadFrequency"] as? NSString
|
|
230
|
-
let batchSize = configuration["batchSize"] as? NSString
|
|
231
|
-
let trackBackgroundEvents = configuration["trackBackgroundEvents"] as? Bool
|
|
232
|
-
let customEndpoints = configuration["customEndpoints"] as? NSDictionary
|
|
233
|
-
let configurationForTelemetry = configuration["configurationForTelemetry"] as? NSDictionary
|
|
234
|
-
let nativeViewTracking = configuration["nativeViewTracking"] as? Bool
|
|
235
|
-
let nativeInteractionTracking = configuration["nativeInteractionTracking"] as? Bool
|
|
294
|
+
let additionalConfiguration: NSDictionary = [
|
|
295
|
+
CrossPlatformAttributes.ddsource: "react-native",
|
|
296
|
+
CrossPlatformAttributes.sdkVersion: SdkVersion,
|
|
297
|
+
]
|
|
298
|
+
|
|
299
|
+
let clientToken = (configuration["clientToken"] as? String) ?? ""
|
|
300
|
+
let env = (configuration["env"] as? String) ?? ""
|
|
301
|
+
|
|
302
|
+
let siteString = configuration["site"] as? NSString
|
|
303
|
+
let site = siteString.asSite()
|
|
304
|
+
|
|
305
|
+
let service = configuration["service"] as? NSString
|
|
236
306
|
let verbosity = configuration["verbosity"] as? NSString
|
|
237
|
-
|
|
238
|
-
let
|
|
239
|
-
let
|
|
240
|
-
|
|
241
|
-
let
|
|
242
|
-
let
|
|
243
|
-
let
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
let
|
|
247
|
-
|
|
307
|
+
|
|
308
|
+
let trackingConsentString = configuration["trackingConsent"] as? NSString
|
|
309
|
+
let trackingConsent = trackingConsentString.asTrackingConsent()
|
|
310
|
+
|
|
311
|
+
let uploadFrequency = (configuration["uploadFrequency"] as? NSString).asUploadFrequency()
|
|
312
|
+
let batchSize = (configuration["batchSize"] as? NSString).asBatchSize()
|
|
313
|
+
let batchProcessingLevel = (configuration["batchProcessingLevel"] as? NSString)
|
|
314
|
+
.asBatchProcessingLevel()
|
|
315
|
+
|
|
316
|
+
let proxyDict = configuration["proxyConfiguration"] as? NSDictionary
|
|
317
|
+
let proxyConfiguration = proxyDict?.asProxyConfiguration()
|
|
318
|
+
|
|
319
|
+
let firstPartyHostsArray = configuration["firstPartyHosts"] as? NSArray
|
|
320
|
+
let firstPartyHosts =
|
|
321
|
+
firstPartyHostsArray?.asFirstPartyHosts() ?? DefaultConfiguration.firstPartyHosts
|
|
322
|
+
|
|
323
|
+
// MARK: - RUM configuration
|
|
324
|
+
|
|
325
|
+
let rumDict = configuration["rumConfiguration"] as? [String: Any?]
|
|
326
|
+
let rumConfiguration: RumConfiguration?
|
|
327
|
+
|
|
328
|
+
if let rum = rumDict,
|
|
329
|
+
let applicationId = rum["applicationId"] as? String,
|
|
330
|
+
!applicationId.isEmpty
|
|
331
|
+
{
|
|
332
|
+
|
|
333
|
+
let longTaskRaw = rum["longTaskThresholdMs"]
|
|
334
|
+
let longTaskThresholdMs: Double? = {
|
|
335
|
+
if let v = longTaskRaw as? Double { return v }
|
|
336
|
+
if let v = longTaskRaw as? Int { return Double(v) }
|
|
337
|
+
if let v = longTaskRaw as? Bool, v == false { return 0.0 }
|
|
338
|
+
return nil
|
|
339
|
+
}()
|
|
340
|
+
|
|
341
|
+
let sessionSampleRate: Double? = {
|
|
342
|
+
if let v = rum["sessionSampleRate"] as? Double { return v }
|
|
343
|
+
if let v = rum["sessionSampleRate"] as? Int { return Double(v) }
|
|
344
|
+
return nil
|
|
345
|
+
}()
|
|
346
|
+
|
|
347
|
+
let vitalsUpdateFrequency =
|
|
348
|
+
(rum["vitalsUpdateFrequency"] as? NSString).asVitalsUpdateFrequency()
|
|
349
|
+
|
|
350
|
+
let nativeCrashReportEnabled = rum["nativeCrashReportEnabled"] as? Bool
|
|
351
|
+
let nativeLongTaskRaw = rum["nativeLongTaskThresholdMs"]
|
|
352
|
+
let nativeLongTaskThresholdMs: Double? = {
|
|
353
|
+
if let v = nativeLongTaskRaw as? Double { return v }
|
|
354
|
+
if let v = nativeLongTaskRaw as? Int { return Double(v) }
|
|
355
|
+
return nil
|
|
356
|
+
}()
|
|
357
|
+
|
|
358
|
+
rumConfiguration = RumConfiguration(
|
|
359
|
+
applicationId: applicationId,
|
|
360
|
+
trackFrustrations: rum["trackFrustrations"] as? Bool
|
|
361
|
+
?? DefaultConfiguration.trackFrustrations,
|
|
362
|
+
longTaskThresholdMs: longTaskThresholdMs
|
|
363
|
+
?? DefaultConfiguration.longTaskThresholdMs,
|
|
364
|
+
sessionSampleRate: sessionSampleRate ?? DefaultConfiguration.sessionSamplingRate,
|
|
365
|
+
resourceTraceSampleRate:
|
|
366
|
+
rum["resourceTraceSampleRate"] as? Double
|
|
367
|
+
?? DefaultConfiguration.resourceTraceSampleRate,
|
|
368
|
+
vitalsUpdateFrequency: vitalsUpdateFrequency,
|
|
369
|
+
trackBackgroundEvents: rum["trackBackgroundEvents"] as? Bool
|
|
370
|
+
?? DefaultConfiguration.trackBackgroundEvents,
|
|
371
|
+
nativeCrashReportEnabled: nativeCrashReportEnabled
|
|
372
|
+
?? DefaultConfiguration.nativeCrashReportEnabled,
|
|
373
|
+
nativeLongTaskThresholdMs: nativeLongTaskThresholdMs
|
|
374
|
+
?? DefaultConfiguration.nativeLongTaskThresholdMs,
|
|
375
|
+
nativeViewTracking: rum["nativeViewTracking"] as? Bool
|
|
376
|
+
?? DefaultConfiguration.nativeViewTracking,
|
|
377
|
+
nativeInteractionTracking: rum["nativeInteractionTracking"] as? Bool
|
|
378
|
+
?? DefaultConfiguration.nativeInteractionTracking,
|
|
379
|
+
appHangThreshold: rum["appHangThreshold"] as? Double,
|
|
380
|
+
trackWatchdogTerminations: rum["trackWatchdogTerminations"] as? Bool
|
|
381
|
+
?? DefaultConfiguration.trackWatchdogTerminations,
|
|
382
|
+
initialResourceThreshold: rum["initialResourceThreshold"] as? Double,
|
|
383
|
+
trackMemoryWarnings: rum["trackMemoryWarnings"] as? Bool
|
|
384
|
+
?? DefaultConfiguration.trackMemoryWarnings,
|
|
385
|
+
telemetrySampleRate: (rum["telemetrySampleRate"] as? Double)
|
|
386
|
+
?? DefaultConfiguration.telemetrySampleRate,
|
|
387
|
+
customEndpoint: rum["customEndpoint"] as? String
|
|
388
|
+
)
|
|
389
|
+
} else {
|
|
390
|
+
rumConfiguration = nil
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// MARK: - Logs configuration
|
|
394
|
+
|
|
395
|
+
let logsDict = configuration["logsConfiguration"] as? [String: Any?]
|
|
396
|
+
let logsConfiguration: LogsConfiguration?
|
|
397
|
+
|
|
398
|
+
if let logs = logsDict {
|
|
399
|
+
logsConfiguration = LogsConfiguration(
|
|
400
|
+
bundleLogsWithRum: logs["bundleLogsWithRum"] as? Bool
|
|
401
|
+
?? DefaultConfiguration.bundleLogsWithRum,
|
|
402
|
+
bundleLogsWithTraces: logs["bundleLogsWithTraces"] as? Bool
|
|
403
|
+
?? DefaultConfiguration.bundleLogsWithTraces,
|
|
404
|
+
customEndpoint: logs["customEndpoint"] as? String
|
|
405
|
+
)
|
|
406
|
+
} else {
|
|
407
|
+
logsConfiguration = nil
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// MARK: - Trace configuration
|
|
411
|
+
|
|
412
|
+
let traceDict = configuration["traceConfiguration"] as? [String: Any?]
|
|
413
|
+
let traceConfiguration: TraceConfiguration?
|
|
414
|
+
|
|
415
|
+
if let trace = traceDict {
|
|
416
|
+
traceConfiguration = TraceConfiguration(
|
|
417
|
+
customEndpoint: trace["customEndpoint"] as? String
|
|
418
|
+
)
|
|
419
|
+
} else {
|
|
420
|
+
traceConfiguration = nil
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// MARK: - configurationForTelemetry
|
|
424
|
+
|
|
425
|
+
let telemetryDict = configuration["configurationForTelemetry"] as? NSDictionary
|
|
426
|
+
let configurationForTelemetry = telemetryDict?.asConfigurationForTelemetry()
|
|
427
|
+
|
|
248
428
|
return DdSdkConfiguration(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
longTaskThresholdMs: (longTaskThresholdMs != nil) ? longTaskThresholdMs! : DefaultConfiguration.longTaskThresholdMs,
|
|
255
|
-
sampleRate: sampleRate ?? DefaultConfiguration.sessionSamplingRate,
|
|
256
|
-
site: site.asSite(),
|
|
257
|
-
trackingConsent: trackingConsent.asTrackingConsent(),
|
|
258
|
-
telemetrySampleRate: telemetrySampleRate ?? DefaultConfiguration.telemetrySampleRate,
|
|
259
|
-
vitalsUpdateFrequency: vitalsUpdateFrequency.asVitalsUpdateFrequency(),
|
|
260
|
-
trackFrustrations: trackFrustrations ?? DefaultConfiguration.trackFrustrations,
|
|
261
|
-
uploadFrequency: uploadFrequency.asUploadFrequency(),
|
|
262
|
-
batchSize: batchSize.asBatchSize(),
|
|
263
|
-
trackBackgroundEvents: trackBackgroundEvents ?? DefaultConfiguration.trackBackgroundEvents,
|
|
264
|
-
customEndpoints: customEndpoints?.asCustomEndpoints(),
|
|
265
|
-
additionalConfig: [
|
|
266
|
-
CrossPlatformAttributes.ddsource: "react-native",
|
|
267
|
-
CrossPlatformAttributes.sdkVersion: SdkVersion
|
|
268
|
-
],
|
|
269
|
-
configurationForTelemetry: configurationForTelemetry?.asConfigurationForTelemetry(),
|
|
270
|
-
nativeViewTracking: nativeViewTracking ?? DefaultConfiguration.nativeViewTracking,
|
|
271
|
-
nativeInteractionTracking: nativeInteractionTracking ?? DefaultConfiguration.nativeInteractionTracking,
|
|
429
|
+
additionalConfiguration: additionalConfiguration,
|
|
430
|
+
clientToken: clientToken,
|
|
431
|
+
env: env,
|
|
432
|
+
site: site,
|
|
433
|
+
service: service,
|
|
272
434
|
verbosity: verbosity,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
435
|
+
trackingConsent: trackingConsent,
|
|
436
|
+
uploadFrequency: uploadFrequency,
|
|
437
|
+
batchSize: batchSize,
|
|
438
|
+
batchProcessingLevel: batchProcessingLevel,
|
|
439
|
+
proxyConfiguration: proxyConfiguration,
|
|
440
|
+
firstPartyHosts: firstPartyHosts,
|
|
441
|
+
rumConfiguration: rumConfiguration,
|
|
442
|
+
logsConfiguration: logsConfiguration,
|
|
443
|
+
traceConfiguration: traceConfiguration,
|
|
444
|
+
configurationForTelemetry: configurationForTelemetry
|
|
283
445
|
)
|
|
284
446
|
}
|
|
285
447
|
}
|
|
@@ -297,7 +459,7 @@ extension NSString? {
|
|
|
297
459
|
return .pending
|
|
298
460
|
}
|
|
299
461
|
}
|
|
300
|
-
|
|
462
|
+
|
|
301
463
|
func asVitalsUpdateFrequency() -> RUM.Configuration.VitalsFrequency? {
|
|
302
464
|
switch self?.lowercased {
|
|
303
465
|
case "never":
|
|
@@ -312,7 +474,7 @@ extension NSString? {
|
|
|
312
474
|
return .average
|
|
313
475
|
}
|
|
314
476
|
}
|
|
315
|
-
|
|
477
|
+
|
|
316
478
|
func asUploadFrequency() -> Datadog.Configuration.UploadFrequency {
|
|
317
479
|
switch self?.lowercased {
|
|
318
480
|
case "rare":
|
|
@@ -325,7 +487,7 @@ extension NSString? {
|
|
|
325
487
|
return .average
|
|
326
488
|
}
|
|
327
489
|
}
|
|
328
|
-
|
|
490
|
+
|
|
329
491
|
func asBatchSize() -> Datadog.Configuration.BatchSize {
|
|
330
492
|
switch self?.lowercased {
|
|
331
493
|
case "small":
|
|
@@ -338,7 +500,7 @@ extension NSString? {
|
|
|
338
500
|
return .medium
|
|
339
501
|
}
|
|
340
502
|
}
|
|
341
|
-
|
|
503
|
+
|
|
342
504
|
func asSite() -> DatadogSite {
|
|
343
505
|
switch self?.lowercased {
|
|
344
506
|
case "us1", "us":
|
|
@@ -359,7 +521,7 @@ extension NSString? {
|
|
|
359
521
|
return .us1
|
|
360
522
|
}
|
|
361
523
|
}
|
|
362
|
-
|
|
524
|
+
|
|
363
525
|
func asBatchProcessingLevel() -> Datadog.Configuration.BatchProcessingLevel {
|
|
364
526
|
switch self?.lowercased {
|
|
365
527
|
case "low":
|