@datadog/mobile-react-native 2.14.0 → 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/datadog-sourcemaps.gradle +2 -1
- 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/metro/plugin/metroSerializer.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 +16 -27
- 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/metro/plugin/metroSerializer.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 +16 -26
- 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/metro/plugin/metroSerializer.ts +3 -3
- 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 +21 -35
- 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
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
package com.datadog.reactnative
|
|
8
8
|
|
|
9
|
+
import com.datadog.android.trace.api.scope.DatadogScope
|
|
10
|
+
import com.datadog.android.trace.api.span.DatadogSpan
|
|
11
|
+
import com.datadog.android.trace.api.span.DatadogSpanBuilder
|
|
12
|
+
import com.datadog.android.trace.api.span.DatadogSpanContext
|
|
13
|
+
import com.datadog.android.trace.api.trace.DatadogTraceId
|
|
14
|
+
import com.datadog.android.trace.api.tracer.DatadogTracer
|
|
9
15
|
import com.datadog.tools.unit.toReadableMap
|
|
10
16
|
import com.facebook.react.bridge.Promise
|
|
11
17
|
import fr.xgouchet.elmyr.annotation.AdvancedForgery
|
|
@@ -15,11 +21,6 @@ import fr.xgouchet.elmyr.annotation.MapForgery
|
|
|
15
21
|
import fr.xgouchet.elmyr.annotation.StringForgery
|
|
16
22
|
import fr.xgouchet.elmyr.annotation.StringForgeryType
|
|
17
23
|
import fr.xgouchet.elmyr.junit5.ForgeExtension
|
|
18
|
-
import io.opentracing.Scope
|
|
19
|
-
import io.opentracing.ScopeManager
|
|
20
|
-
import io.opentracing.Span
|
|
21
|
-
import io.opentracing.SpanContext
|
|
22
|
-
import io.opentracing.Tracer
|
|
23
24
|
import org.assertj.core.api.Assertions.assertThat
|
|
24
25
|
import org.junit.jupiter.api.AfterEach
|
|
25
26
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
|
@@ -51,22 +52,19 @@ internal class DdTraceTest {
|
|
|
51
52
|
lateinit var testedTrace: DdTraceImplementation
|
|
52
53
|
|
|
53
54
|
@Mock
|
|
54
|
-
lateinit var mockTracer:
|
|
55
|
+
lateinit var mockTracer: DatadogTracer
|
|
55
56
|
|
|
56
57
|
@Mock
|
|
57
|
-
lateinit var mockSpanBuilder:
|
|
58
|
+
lateinit var mockSpanBuilder: DatadogSpanBuilder
|
|
58
59
|
|
|
59
60
|
@Mock
|
|
60
|
-
lateinit var mockSpanContext:
|
|
61
|
+
lateinit var mockSpanContext: DatadogSpanContext
|
|
61
62
|
|
|
62
63
|
@Mock
|
|
63
|
-
lateinit var
|
|
64
|
+
lateinit var mockSpan: DatadogSpan
|
|
64
65
|
|
|
65
66
|
@Mock
|
|
66
|
-
lateinit var
|
|
67
|
-
|
|
68
|
-
@Mock
|
|
69
|
-
lateinit var mockScope: Scope
|
|
67
|
+
lateinit var mockScope: DatadogScope
|
|
70
68
|
|
|
71
69
|
@StringForgery
|
|
72
70
|
lateinit var fakeOperation: String
|
|
@@ -74,11 +72,11 @@ internal class DdTraceTest {
|
|
|
74
72
|
@DoubleForgery(1000000000000.0, 2000000000000.0)
|
|
75
73
|
var fakeTimestamp: Double = 0.0
|
|
76
74
|
|
|
77
|
-
@
|
|
78
|
-
|
|
75
|
+
@LongForgery(100L, 2000L)
|
|
76
|
+
var fakeSpanId: Long = 0
|
|
79
77
|
|
|
80
|
-
@
|
|
81
|
-
lateinit var fakeTraceId:
|
|
78
|
+
@Mock
|
|
79
|
+
lateinit var fakeTraceId: DatadogTraceId
|
|
82
80
|
|
|
83
81
|
@MapForgery(
|
|
84
82
|
key = AdvancedForgery(string = [StringForgery()]),
|
|
@@ -102,7 +100,6 @@ internal class DdTraceTest {
|
|
|
102
100
|
@BeforeEach
|
|
103
101
|
fun `set up`() {
|
|
104
102
|
whenever(mockTracer.buildSpan(fakeOperation)) doReturn mockSpanBuilder
|
|
105
|
-
whenever(mockTracer.scopeManager()) doReturn mockScopeManager
|
|
106
103
|
whenever(
|
|
107
104
|
mockSpanBuilder.withStartTimestamp(
|
|
108
105
|
fakeTimestamp.toLong() * 1000
|
|
@@ -110,9 +107,9 @@ internal class DdTraceTest {
|
|
|
110
107
|
) doReturn mockSpanBuilder
|
|
111
108
|
whenever(mockSpanBuilder.start()) doReturn mockSpan
|
|
112
109
|
whenever(mockSpan.context()) doReturn mockSpanContext
|
|
113
|
-
whenever(mockSpanContext.
|
|
114
|
-
whenever(mockSpanContext.
|
|
115
|
-
whenever(
|
|
110
|
+
whenever(mockSpanContext.spanId) doReturn fakeSpanId
|
|
111
|
+
whenever(mockSpanContext.traceId) doReturn fakeTraceId
|
|
112
|
+
whenever(mockTracer.activateSpan(mockSpan)) doReturn mockScope
|
|
116
113
|
|
|
117
114
|
testedTrace = DdTraceImplementation(tracerProvider = { mockTracer })
|
|
118
115
|
}
|
|
@@ -133,7 +130,7 @@ internal class DdTraceTest {
|
|
|
133
130
|
)
|
|
134
131
|
|
|
135
132
|
// Then
|
|
136
|
-
assertThat(lastResolvedValue).isEqualTo(fakeSpanId)
|
|
133
|
+
assertThat(lastResolvedValue.toString()).isEqualTo(fakeSpanId.toString())
|
|
137
134
|
}
|
|
138
135
|
|
|
139
136
|
@Test
|
|
@@ -154,18 +151,20 @@ internal class DdTraceTest {
|
|
|
154
151
|
fakeTimestamp,
|
|
155
152
|
mockPromise
|
|
156
153
|
)
|
|
157
|
-
val id = lastResolvedValue
|
|
158
|
-
testedTrace.finishSpan(id
|
|
154
|
+
val id = lastResolvedValue.toString()
|
|
155
|
+
testedTrace.finishSpan(id, fakeContext.toReadableMap(), endTimestamp, mockPromise)
|
|
159
156
|
|
|
160
157
|
// Then
|
|
161
|
-
assertThat(id).isEqualTo(fakeSpanId)
|
|
158
|
+
assertThat(id).isEqualTo(fakeSpanId.toString())
|
|
162
159
|
verify(mockSpan).finish(endTimestamp.toLong() * 1000)
|
|
163
160
|
}
|
|
164
161
|
|
|
165
162
|
@Test
|
|
166
163
|
fun `M do nothing W startSpan() + finishSpan() with unknown id`(
|
|
167
164
|
@LongForgery(100L, 2000L) duration: Long,
|
|
168
|
-
@StringForgery(type = StringForgeryType.HEXADECIMAL)
|
|
165
|
+
@StringForgery(type = StringForgeryType.HEXADECIMAL)
|
|
166
|
+
@LongForgery(100L, 2000L)
|
|
167
|
+
otherSpanId: Long
|
|
169
168
|
) {
|
|
170
169
|
// Given
|
|
171
170
|
assumeTrue(otherSpanId != fakeSpanId)
|
|
@@ -178,11 +177,16 @@ internal class DdTraceTest {
|
|
|
178
177
|
fakeTimestamp,
|
|
179
178
|
mockPromise
|
|
180
179
|
)
|
|
181
|
-
val id = lastResolvedValue
|
|
182
|
-
testedTrace.finishSpan(
|
|
180
|
+
val id = lastResolvedValue.toString()
|
|
181
|
+
testedTrace.finishSpan(
|
|
182
|
+
otherSpanId.toString(),
|
|
183
|
+
fakeContext.toReadableMap(),
|
|
184
|
+
endTimestamp,
|
|
185
|
+
mockPromise
|
|
186
|
+
)
|
|
183
187
|
|
|
184
188
|
// Then
|
|
185
|
-
assertThat(id).isEqualTo(fakeSpanId)
|
|
189
|
+
assertThat(id).isEqualTo(fakeSpanId.toString())
|
|
186
190
|
verify(mockSpan, never()).finish(any())
|
|
187
191
|
}
|
|
188
192
|
|
|
@@ -200,7 +204,7 @@ internal class DdTraceTest {
|
|
|
200
204
|
fakeTimestamp,
|
|
201
205
|
mockPromise
|
|
202
206
|
)
|
|
203
|
-
val id = lastResolvedValue
|
|
207
|
+
val id = lastResolvedValue.toString()
|
|
204
208
|
testedTrace.finishSpan(
|
|
205
209
|
id as String,
|
|
206
210
|
emptyMap<String, String>().toReadableMap(),
|
|
@@ -209,7 +213,7 @@ internal class DdTraceTest {
|
|
|
209
213
|
)
|
|
210
214
|
|
|
211
215
|
// Then
|
|
212
|
-
assertThat(id).isEqualTo(fakeSpanId)
|
|
216
|
+
assertThat(id).isEqualTo(fakeSpanId.toString())
|
|
213
217
|
verify(mockSpan).context()
|
|
214
218
|
verify(mockSpan).finish(endTimestamp.toLong() * 1000)
|
|
215
219
|
fakeContext.forEach {
|
|
@@ -232,11 +236,11 @@ internal class DdTraceTest {
|
|
|
232
236
|
fakeTimestamp,
|
|
233
237
|
mockPromise
|
|
234
238
|
)
|
|
235
|
-
val id = lastResolvedValue
|
|
236
|
-
testedTrace.finishSpan(id
|
|
239
|
+
val id = lastResolvedValue.toString()
|
|
240
|
+
testedTrace.finishSpan(id, fakeContext.toReadableMap(), endTimestamp, mockPromise)
|
|
237
241
|
|
|
238
242
|
// Then
|
|
239
|
-
assertThat(id).isEqualTo(fakeSpanId)
|
|
243
|
+
assertThat(id).isEqualTo(fakeSpanId.toString())
|
|
240
244
|
verify(mockSpan).context()
|
|
241
245
|
verify(mockSpan).finish(endTimestamp.toLong() * 1000)
|
|
242
246
|
fakeContext.forEach {
|
|
@@ -262,16 +266,16 @@ internal class DdTraceTest {
|
|
|
262
266
|
fakeTimestamp,
|
|
263
267
|
mockPromise
|
|
264
268
|
)
|
|
265
|
-
val id = lastResolvedValue
|
|
269
|
+
val id = lastResolvedValue.toString()
|
|
266
270
|
testedTrace.finishSpan(
|
|
267
|
-
id
|
|
271
|
+
id,
|
|
268
272
|
emptyMap<String, String>().toReadableMap(),
|
|
269
273
|
endTimestamp,
|
|
270
274
|
mockPromise
|
|
271
275
|
)
|
|
272
276
|
|
|
273
277
|
// Then
|
|
274
|
-
assertThat(id).isEqualTo(fakeSpanId)
|
|
278
|
+
assertThat(id).isEqualTo(fakeSpanId.toString())
|
|
275
279
|
verify(mockSpan).context()
|
|
276
280
|
verify(mockSpan).finish(endTimestamp.toLong() * 1000)
|
|
277
281
|
fakeContext.forEach {
|
|
@@ -298,14 +302,14 @@ internal class DdTraceTest {
|
|
|
298
302
|
fakeTimestamp,
|
|
299
303
|
mockPromise
|
|
300
304
|
)
|
|
301
|
-
val id = lastResolvedValue
|
|
305
|
+
val id = lastResolvedValue.toString()
|
|
302
306
|
fakeGlobalState.forEach { (k, v) ->
|
|
303
307
|
GlobalState.addAttribute(k, v)
|
|
304
308
|
}
|
|
305
|
-
testedTrace.finishSpan(id
|
|
309
|
+
testedTrace.finishSpan(id, fakeContext.toReadableMap(), endTimestamp, mockPromise)
|
|
306
310
|
|
|
307
311
|
// Then
|
|
308
|
-
assertThat(id).isEqualTo(fakeSpanId)
|
|
312
|
+
assertThat(id).isEqualTo(fakeSpanId.toString())
|
|
309
313
|
verify(mockSpan).context()
|
|
310
314
|
verify(mockSpan).finish(endTimestamp.toLong() * 1000)
|
|
311
315
|
expectedAttributes.forEach {
|
|
@@ -11,107 +11,84 @@ import com.datadog.android.core.configuration.BatchSize
|
|
|
11
11
|
import com.datadog.android.core.configuration.UploadFrequency
|
|
12
12
|
import com.datadog.android.rum.configuration.VitalsUpdateFrequency
|
|
13
13
|
import com.datadog.reactnative.ConfigurationForTelemetry
|
|
14
|
-
import com.datadog.reactnative.CustomEndpoints
|
|
15
14
|
import com.datadog.reactnative.DdSdkConfiguration
|
|
16
15
|
import com.datadog.reactnative.ProxyAuthenticator
|
|
17
16
|
import com.facebook.react.bridge.ReadableMap
|
|
18
17
|
import java.net.Proxy
|
|
19
18
|
|
|
19
|
+
@Suppress("CyclomaticComplexMethod")
|
|
20
20
|
fun DdSdkConfiguration.toReadableJavaOnlyMap(): ReadableMap {
|
|
21
21
|
val map = mutableMapOf<String, Any?>()
|
|
22
|
+
|
|
22
23
|
map["clientToken"] = clientToken
|
|
23
24
|
map["env"] = env
|
|
24
|
-
|
|
25
|
-
map["
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
map["
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (sampleRate != null) {
|
|
41
|
-
map["sampleRate"] = sampleRate
|
|
42
|
-
} else {
|
|
43
|
-
// we have to put something, because ReadableMap.asDdSdkConfiguration() will call
|
|
44
|
-
// ReadableMap#getDouble which doesn't allow having null value
|
|
45
|
-
map["sampleRate"] = 100f
|
|
46
|
-
}
|
|
47
|
-
if (telemetrySampleRate != null) {
|
|
48
|
-
map["telemetrySampleRate"] = telemetrySampleRate
|
|
49
|
-
} else {
|
|
50
|
-
// we have to put something, because ReadableMap.asDdSdkConfiguration() will call
|
|
51
|
-
// ReadableMap#getDouble which doesn't allow having null value
|
|
52
|
-
map["telemetrySampleRate"] = 20f
|
|
53
|
-
}
|
|
54
|
-
site?.let { map.put("site", it) }
|
|
55
|
-
trackingConsent?.let { map.put("trackingConsent", it) }
|
|
56
|
-
if (vitalsUpdateFrequency != null) {
|
|
57
|
-
map["vitalsUpdateFrequency"] = vitalsUpdateFrequency
|
|
58
|
-
} else {
|
|
59
|
-
// we have to put something, because ReadableMap.asDdSdkConfiguration() will call
|
|
60
|
-
// ReadableMap#getString which doesn't allow having null value
|
|
61
|
-
map["vitalsUpdateFrequency"] = VitalsUpdateFrequency.AVERAGE.toString()
|
|
62
|
-
}
|
|
63
|
-
map["trackFrustrations"] = if (trackFrustrations == null) {
|
|
64
|
-
false
|
|
65
|
-
} else {
|
|
66
|
-
trackFrustrations
|
|
67
|
-
}
|
|
68
|
-
if (uploadFrequency != null) {
|
|
69
|
-
map["uploadFrequency"] = uploadFrequency
|
|
70
|
-
} else {
|
|
71
|
-
map["uploadFrequency"] = UploadFrequency.AVERAGE.toString()
|
|
72
|
-
}
|
|
73
|
-
if (batchSize != null) {
|
|
74
|
-
map["batchSize"] = batchSize
|
|
75
|
-
} else {
|
|
76
|
-
map["batchSize"] = BatchSize.MEDIUM.toString()
|
|
77
|
-
}
|
|
78
|
-
map["trackBackgroundEvents"] = if (trackBackgroundEvents == null) {
|
|
79
|
-
false
|
|
80
|
-
} else {
|
|
81
|
-
trackBackgroundEvents
|
|
25
|
+
|
|
26
|
+
site?.let { map["site"] = it }
|
|
27
|
+
service?.let { map["service"] = it }
|
|
28
|
+
verbosity?.let { map["verbosity"] = it }
|
|
29
|
+
|
|
30
|
+
trackingConsent?.let { map["trackingConsent"] = it }
|
|
31
|
+
|
|
32
|
+
map["uploadFrequency"] = uploadFrequency ?: UploadFrequency.AVERAGE.toString()
|
|
33
|
+
|
|
34
|
+
map["batchSize"] = batchSize ?: BatchSize.MEDIUM.toString()
|
|
35
|
+
|
|
36
|
+
map["batchProcessingLevel"] =
|
|
37
|
+
batchProcessingLevel ?: BatchProcessingLevel.MEDIUM.toString()
|
|
38
|
+
|
|
39
|
+
proxyConfiguration?.let { proxyPair ->
|
|
40
|
+
map["proxyConfiguration"] = proxyPair.toReadableMap()
|
|
82
41
|
}
|
|
83
|
-
|
|
84
|
-
|
|
42
|
+
|
|
43
|
+
firstPartyHosts?.let {
|
|
44
|
+
map["firstPartyHosts"] = it.toFirstPartyHostsReadableArray()
|
|
85
45
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
map
|
|
46
|
+
|
|
47
|
+
additionalConfiguration?.let {
|
|
48
|
+
map["additionalConfiguration"] = it.toReadableMap()
|
|
89
49
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
50
|
+
|
|
51
|
+
run {
|
|
52
|
+
val rum = rumConfiguration
|
|
53
|
+
val rumMap = mutableMapOf<String, Any?>()
|
|
54
|
+
|
|
55
|
+
rum?.applicationId?.let { rumMap["applicationId"] = it }
|
|
56
|
+
rumMap["trackFrustrations"] = rum?.trackFrustrations ?: false
|
|
57
|
+
rumMap["longTaskThresholdMs"] = rum?.longTaskThresholdMs ?: 0.0
|
|
58
|
+
rumMap["sessionSampleRate"] = rum?.sessionSampleRate ?: 100.0
|
|
59
|
+
rum?.resourceTraceSampleRate?.let { rumMap["resourceTraceSampleRate"] = it }
|
|
60
|
+
rumMap["vitalsUpdateFrequency"] =
|
|
61
|
+
rum?.vitalsUpdateFrequency ?: VitalsUpdateFrequency.AVERAGE.toString()
|
|
62
|
+
rumMap["trackBackgroundEvents"] = rum?.trackBackgroundEvents ?: false
|
|
63
|
+
rumMap["nativeCrashReportEnabled"] = rum?.nativeCrashReportEnabled ?: false
|
|
64
|
+
rumMap["nativeLongTaskThresholdMs"] = rum?.nativeLongTaskThresholdMs ?: 0.0
|
|
65
|
+
rum?.nativeViewTracking?.let { rumMap["nativeViewTracking"] = it }
|
|
66
|
+
rum?.nativeInteractionTracking?.let { rumMap["nativeInteractionTracking"] = it }
|
|
67
|
+
rum?.trackNonFatalAnrs?.let { rumMap["trackNonFatalAnrs"] = it }
|
|
68
|
+
rumMap["initialResourceThreshold"] = rum?.initialResourceThreshold ?: 0.1
|
|
69
|
+
rumMap["telemetrySampleRate"] = rum?.telemetrySampleRate ?: 20.0
|
|
70
|
+
rum?.customEndpoint?.let { rumMap["customEndpoint"] = it }
|
|
71
|
+
map["rumConfiguration"] = rumMap.toReadableMap()
|
|
95
72
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
73
|
+
|
|
74
|
+
logsConfiguration?.let { logs ->
|
|
75
|
+
val logsMap = mutableMapOf<String, Any?>()
|
|
76
|
+
logsMap["bundleLogsWithRum"] = logs.bundleLogsWithRum
|
|
77
|
+
logsMap["bundleLogsWithTraces"] = logs.bundleLogsWithTraces
|
|
78
|
+
logs.customEndpoint?.let { logsMap["customEndpoint"] = it }
|
|
79
|
+
|
|
80
|
+
map["logsConfiguration"] = logsMap.toReadableMap()
|
|
99
81
|
}
|
|
100
|
-
map.put("bundleLogsWithRum", bundleLogsWithRum)
|
|
101
|
-
map.put("bundleLogsWithTraces", bundleLogsWithTraces)
|
|
102
82
|
|
|
103
|
-
|
|
83
|
+
traceConfiguration?.let { trace ->
|
|
84
|
+
val traceMap = mutableMapOf<String, Any?>()
|
|
85
|
+
trace.customEndpoint?.let { traceMap["customEndpoint"] = it }
|
|
104
86
|
|
|
105
|
-
|
|
106
|
-
map["batchProcessingLevel"] = batchProcessingLevel
|
|
107
|
-
} else {
|
|
108
|
-
map["batchProcessingLevel"] = BatchProcessingLevel.MEDIUM.toString()
|
|
87
|
+
map["traceConfiguration"] = traceMap.toReadableMap()
|
|
109
88
|
}
|
|
110
89
|
|
|
111
|
-
|
|
112
|
-
map
|
|
113
|
-
} else {
|
|
114
|
-
map.put("initialResourceThreshold", 0.1f)
|
|
90
|
+
configurationForTelemetry?.let { telemetry ->
|
|
91
|
+
map["configurationForTelemetry"] = telemetry.toReadableJavaOnlyMap()
|
|
115
92
|
}
|
|
116
93
|
|
|
117
94
|
return map.toReadableMap()
|
|
@@ -128,14 +105,6 @@ internal fun ConfigurationForTelemetry.toReadableJavaOnlyMap(): ReadableMap {
|
|
|
128
105
|
return map.toReadableMap()
|
|
129
106
|
}
|
|
130
107
|
|
|
131
|
-
internal fun CustomEndpoints.toReadableJavaOnlyMap(): ReadableMap {
|
|
132
|
-
val map = mutableMapOf<String, Any?>()
|
|
133
|
-
rum?.let { map.put("rum", it) }
|
|
134
|
-
logs?.let { map.put("logs", it) }
|
|
135
|
-
trace?.let { map.put("trace", it) }
|
|
136
|
-
return map.toReadableMap()
|
|
137
|
-
}
|
|
138
|
-
|
|
139
108
|
internal fun Pair<Proxy, ProxyAuthenticator?>.toReadableMap(): ReadableMap {
|
|
140
109
|
val map = mutableMapOf<String, Any?>()
|
|
141
110
|
val inetAddress = first.address().toString()
|
|
@@ -13,6 +13,7 @@ import com.datadog.android.rum.RumMonitor
|
|
|
13
13
|
import com.datadog.android.rum.RumResourceKind
|
|
14
14
|
import com.datadog.android.rum.RumResourceMethod
|
|
15
15
|
import com.datadog.android.rum._RumInternalProxy
|
|
16
|
+
import com.datadog.android.rum.featureoperations.FailureReason
|
|
16
17
|
|
|
17
18
|
class MockRumMonitor : RumMonitor {
|
|
18
19
|
override var debug = false
|
|
@@ -29,6 +30,14 @@ class MockRumMonitor : RumMonitor {
|
|
|
29
30
|
|
|
30
31
|
override fun addAttribute(key: String, value: Any?) {}
|
|
31
32
|
|
|
33
|
+
override fun removeAttribute(key: String) {}
|
|
34
|
+
|
|
35
|
+
override fun clearAttributes() {}
|
|
36
|
+
|
|
37
|
+
override fun getAttributes(): Map<String, Any?> {
|
|
38
|
+
return mapOf()
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
override fun addError(
|
|
33
42
|
message: String,
|
|
34
43
|
source: RumErrorSource,
|
|
@@ -52,15 +61,11 @@ class MockRumMonitor : RumMonitor {
|
|
|
52
61
|
@ExperimentalRumApi
|
|
53
62
|
override fun addViewLoadingTime(overwrite: Boolean) {}
|
|
54
63
|
|
|
55
|
-
override fun clearAttributes() {}
|
|
56
|
-
|
|
57
|
-
override fun getAttributes(): Map<String, Any?> {
|
|
58
|
-
return mapOf()
|
|
59
|
-
}
|
|
60
|
-
|
|
61
64
|
override fun getCurrentSessionId(callback: (String?) -> Unit) {}
|
|
62
65
|
|
|
63
|
-
override fun
|
|
66
|
+
override fun addViewAttributes(attributes: Map<String, Any?>) {}
|
|
67
|
+
|
|
68
|
+
override fun removeViewAttributes(attributes: Collection<String>) {}
|
|
64
69
|
|
|
65
70
|
override fun startAction(
|
|
66
71
|
type: RumActionType,
|
|
@@ -75,13 +80,6 @@ class MockRumMonitor : RumMonitor {
|
|
|
75
80
|
attributes: Map<String, Any?>
|
|
76
81
|
) {}
|
|
77
82
|
|
|
78
|
-
override fun startResource(
|
|
79
|
-
key: String,
|
|
80
|
-
method: String,
|
|
81
|
-
url: String,
|
|
82
|
-
attributes: Map<String, Any?>
|
|
83
|
-
) {}
|
|
84
|
-
|
|
85
83
|
override fun startView(
|
|
86
84
|
key: Any,
|
|
87
85
|
name: String,
|
|
@@ -127,4 +125,26 @@ class MockRumMonitor : RumMonitor {
|
|
|
127
125
|
key: Any,
|
|
128
126
|
attributes: Map<String, Any?>
|
|
129
127
|
) {}
|
|
128
|
+
|
|
129
|
+
@ExperimentalRumApi
|
|
130
|
+
override fun startFeatureOperation(
|
|
131
|
+
name: String,
|
|
132
|
+
operationKey: String?,
|
|
133
|
+
attributes: Map<String, Any?>
|
|
134
|
+
) {}
|
|
135
|
+
|
|
136
|
+
@ExperimentalRumApi
|
|
137
|
+
override fun succeedFeatureOperation(
|
|
138
|
+
name: String,
|
|
139
|
+
operationKey: String?,
|
|
140
|
+
attributes: Map<String, Any?>
|
|
141
|
+
) {}
|
|
142
|
+
|
|
143
|
+
@ExperimentalRumApi
|
|
144
|
+
override fun failFeatureOperation(
|
|
145
|
+
name: String,
|
|
146
|
+
operationKey: String?,
|
|
147
|
+
failureReason: FailureReason,
|
|
148
|
+
attributes: Map<String, Any?>
|
|
149
|
+
) {}
|
|
130
150
|
}
|
package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt
CHANGED
|
@@ -7,39 +7,30 @@
|
|
|
7
7
|
package com.datadog.tools.unit.forge
|
|
8
8
|
|
|
9
9
|
import com.datadog.reactnative.ConfigurationForTelemetry
|
|
10
|
-
import com.datadog.reactnative.CustomEndpoints
|
|
11
10
|
import com.datadog.reactnative.DdSdkConfiguration
|
|
11
|
+
import com.datadog.reactnative.LogsConfiguration
|
|
12
|
+
import com.datadog.reactnative.RumConfiguration
|
|
13
|
+
import com.datadog.reactnative.TraceConfiguration
|
|
12
14
|
import fr.xgouchet.elmyr.Forge
|
|
13
15
|
import fr.xgouchet.elmyr.ForgeryFactory
|
|
14
16
|
import java.util.UUID
|
|
15
17
|
|
|
16
18
|
class DdSdkConfigurationForgeryFactory : ForgeryFactory<DdSdkConfiguration> {
|
|
19
|
+
|
|
17
20
|
override fun getForgery(forge: Forge): DdSdkConfiguration {
|
|
18
21
|
return DdSdkConfiguration(
|
|
19
|
-
|
|
20
|
-
env = forge.anAlphabeticalString(),
|
|
21
|
-
applicationId = forge.getForgery<UUID>().toString(),
|
|
22
|
-
nativeCrashReportEnabled = forge.aNullable { aBool() },
|
|
23
|
-
nativeLongTaskThresholdMs = forge.aNullable { aDouble(100.0, 5000.0) },
|
|
24
|
-
longTaskThresholdMs = forge.aDouble(0.0, 100.0),
|
|
25
|
-
sampleRate = forge.aNullable { aDouble(0.0, 100.0) },
|
|
26
|
-
telemetrySampleRate = forge.aNullable { aDouble(0.0, 100.0) },
|
|
27
|
-
vitalsUpdateFrequency = forge.aNullable {
|
|
28
|
-
anElementFrom(
|
|
29
|
-
"RARE",
|
|
30
|
-
"NEVER",
|
|
31
|
-
"FREQUENT",
|
|
32
|
-
"AVERAGE"
|
|
33
|
-
)
|
|
34
|
-
},
|
|
35
|
-
site = forge.aNullable { anElementFrom("US", "EU", "GOV") },
|
|
36
|
-
additionalConfig = forge.aMap {
|
|
22
|
+
additionalConfiguration = forge.aMap {
|
|
37
23
|
forge.anAsciiString() to forge.anElementFrom(
|
|
38
24
|
forge.aMap { forge.anAsciiString() to forge.aString() },
|
|
39
25
|
forge.aString(),
|
|
40
26
|
null
|
|
41
27
|
)
|
|
42
28
|
},
|
|
29
|
+
clientToken = forge.aStringMatching("pub[a-f0-9]{32}"),
|
|
30
|
+
env = forge.anAlphabeticalString(),
|
|
31
|
+
site = forge.aNullable { anElementFrom("US", "EU", "GOV") },
|
|
32
|
+
service = forge.aNullable { forge.anAlphabeticalString() },
|
|
33
|
+
verbosity = forge.aNullable { anElementFrom("debug", "info", "warn", "error") },
|
|
43
34
|
trackingConsent = forge.aNullable {
|
|
44
35
|
anElementFrom("pending", "granted", "not_granted")
|
|
45
36
|
},
|
|
@@ -57,7 +48,42 @@ class DdSdkConfigurationForgeryFactory : ForgeryFactory<DdSdkConfiguration> {
|
|
|
57
48
|
"LARGE"
|
|
58
49
|
)
|
|
59
50
|
},
|
|
60
|
-
|
|
51
|
+
batchProcessingLevel = forge.aNullable {
|
|
52
|
+
anElementFrom(
|
|
53
|
+
"LOW",
|
|
54
|
+
"MEDIUM",
|
|
55
|
+
"HIGH"
|
|
56
|
+
)
|
|
57
|
+
},
|
|
58
|
+
proxyConfiguration = null,
|
|
59
|
+
firstPartyHosts = null,
|
|
60
|
+
rumConfiguration = RumConfiguration(
|
|
61
|
+
applicationId = forge.getForgery<UUID>().toString(),
|
|
62
|
+
trackFrustrations = forge.aNullable { aBool() },
|
|
63
|
+
longTaskThresholdMs = forge.aNullable { aDouble(0.0, 100.0) },
|
|
64
|
+
sessionSampleRate = forge.aNullable { aDouble(0.0, 100.0) },
|
|
65
|
+
resourceTraceSampleRate = forge.aNullable { aDouble(0.0, 100.0) },
|
|
66
|
+
vitalsUpdateFrequency = forge.aNullable {
|
|
67
|
+
anElementFrom("RARE", "NEVER", "FREQUENT", "AVERAGE")
|
|
68
|
+
},
|
|
69
|
+
trackBackgroundEvents = forge.aNullable { forge.aBool() },
|
|
70
|
+
nativeCrashReportEnabled = forge.aNullable { aBool() },
|
|
71
|
+
nativeLongTaskThresholdMs = forge.aNullable { aDouble(100.0, 5000.0) },
|
|
72
|
+
nativeViewTracking = forge.aNullable { aBool() },
|
|
73
|
+
nativeInteractionTracking = forge.aNullable { aBool() },
|
|
74
|
+
trackNonFatalAnrs = forge.aNullable { aBool() },
|
|
75
|
+
initialResourceThreshold = forge.aNullable { aDouble(0.0, 2.0) },
|
|
76
|
+
telemetrySampleRate = forge.aNullable { aDouble(0.0, 100.0) },
|
|
77
|
+
customEndpoint = forge.aNullable { aString() }
|
|
78
|
+
),
|
|
79
|
+
logsConfiguration = LogsConfiguration(
|
|
80
|
+
bundleLogsWithRum = forge.aBool(),
|
|
81
|
+
bundleLogsWithTraces = forge.aBool(),
|
|
82
|
+
customEndpoint = forge.aNullable { aString() }
|
|
83
|
+
),
|
|
84
|
+
traceConfiguration = TraceConfiguration(
|
|
85
|
+
customEndpoint = forge.aNullable { aString() }
|
|
86
|
+
),
|
|
61
87
|
configurationForTelemetry = ConfigurationForTelemetry(
|
|
62
88
|
initializationType = forge.anAlphabeticalString(),
|
|
63
89
|
trackErrors = forge.aBool(),
|
|
@@ -65,29 +91,7 @@ class DdSdkConfigurationForgeryFactory : ForgeryFactory<DdSdkConfiguration> {
|
|
|
65
91
|
trackNetworkRequests = forge.aBool(),
|
|
66
92
|
reactVersion = forge.aString(),
|
|
67
93
|
reactNativeVersion = forge.aString()
|
|
68
|
-
)
|
|
69
|
-
trackFrustrations = forge.aNullable { aBool() },
|
|
70
|
-
customEndpoints = CustomEndpoints(
|
|
71
|
-
rum = forge.aNullable { aString() },
|
|
72
|
-
logs = forge.aNullable { aString() },
|
|
73
|
-
trace = forge.aNullable { aString() }
|
|
74
|
-
),
|
|
75
|
-
nativeViewTracking = forge.aBool(),
|
|
76
|
-
nativeInteractionTracking = forge.aBool(),
|
|
77
|
-
verbosity = forge.aNullable { anElementFrom("debug", "info", "warn", "error") },
|
|
78
|
-
proxyConfig = null,
|
|
79
|
-
serviceName = forge.aNullable { forge.anAlphabeticalString() },
|
|
80
|
-
firstPartyHosts = null,
|
|
81
|
-
bundleLogsWithRum = forge.aBool(),
|
|
82
|
-
bundleLogsWithTraces = forge.aBool(),
|
|
83
|
-
trackNonFatalAnrs = forge.aBool(),
|
|
84
|
-
batchProcessingLevel = forge.aNullable {
|
|
85
|
-
anElementFrom(
|
|
86
|
-
"LOW",
|
|
87
|
-
"MEDIUM",
|
|
88
|
-
"HIGH"
|
|
89
|
-
)
|
|
90
|
-
}
|
|
94
|
+
)
|
|
91
95
|
)
|
|
92
96
|
}
|
|
93
97
|
}
|
|
@@ -86,7 +86,6 @@ internal class TelemetryConfigurationEventForgeryFactory :
|
|
|
86
86
|
)
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
-
defaultPrivacyLevel = forge.aNullable { aString() },
|
|
90
89
|
enablePrivacyForActionName = forge.aNullable { aBool() },
|
|
91
90
|
useExcludedActivityUrls = forge.aNullable { aBool() },
|
|
92
91
|
useWorkerUrl = forge.aNullable { aBool() },
|