@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,29 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
import { NativeModules } from 'react-native';
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
DdNativeLogsType,
|
|
11
|
-
DdNativeRumType
|
|
12
|
-
} from '../../../nativeModulesTypes';
|
|
9
|
+
import type { DdNativeRumType } from '../../../nativeModulesTypes';
|
|
13
10
|
import { DdRumErrorTracking } from '../../../rum/instrumentation/DdRumErrorTracking';
|
|
14
11
|
import { BufferSingleton } from '../../../sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
15
12
|
|
|
16
13
|
jest.mock('../../../utils/jsUtils');
|
|
17
14
|
|
|
18
15
|
const DdRum = NativeModules.DdRum as DdNativeRumType;
|
|
19
|
-
const DdLogs = NativeModules.DdLogs as DdNativeLogsType;
|
|
20
16
|
|
|
21
17
|
let baseErrorHandlerCalled = false;
|
|
22
18
|
const baseErrorHandler = (error: any, isFatal?: boolean) => {
|
|
23
19
|
baseErrorHandlerCalled = true;
|
|
24
20
|
};
|
|
25
|
-
let originalErrorHandler;
|
|
21
|
+
let originalErrorHandler: any;
|
|
26
22
|
|
|
27
23
|
let baseConsoleErrorCalled = false;
|
|
28
|
-
const baseConsoleError = (...params: unknown) => {
|
|
24
|
+
const baseConsoleError = (...params: unknown[]) => {
|
|
29
25
|
baseConsoleErrorCalled = true;
|
|
30
26
|
};
|
|
31
|
-
let originalConsoleError;
|
|
27
|
+
let originalConsoleError: any;
|
|
32
28
|
|
|
33
29
|
const flushPromises = () =>
|
|
34
30
|
new Promise(jest.requireActual('timers').setImmediate);
|
|
@@ -65,11 +61,16 @@ it('M intercept and send a RUM event W onGlobalError() {no message}', async () =
|
|
|
65
61
|
// THEN
|
|
66
62
|
expect(DdRum.addError).toHaveBeenCalledTimes(1);
|
|
67
63
|
expect(DdRum.addError).toHaveBeenCalledWith(
|
|
68
|
-
'
|
|
64
|
+
'Unknown Error',
|
|
69
65
|
'SOURCE',
|
|
70
66
|
'doSomething() at ./path/to/file.js:67:3',
|
|
71
67
|
{
|
|
72
|
-
'_dd.error.raw':
|
|
68
|
+
'_dd.error.raw': {
|
|
69
|
+
name: 'Error',
|
|
70
|
+
message: 'Unknown Error',
|
|
71
|
+
cause: undefined,
|
|
72
|
+
stack: 'doSomething() at ./path/to/file.js:67:3'
|
|
73
|
+
},
|
|
73
74
|
'_dd.error.is_crash': is_fatal,
|
|
74
75
|
'_dd.error.source_type': 'react-native'
|
|
75
76
|
},
|
|
@@ -77,19 +78,6 @@ it('M intercept and send a RUM event W onGlobalError() {no message}', async () =
|
|
|
77
78
|
''
|
|
78
79
|
);
|
|
79
80
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
80
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
81
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
82
|
-
'[object Object]',
|
|
83
|
-
'Error',
|
|
84
|
-
'[object Object]',
|
|
85
|
-
'doSomething() at ./path/to/file.js:67:3',
|
|
86
|
-
{
|
|
87
|
-
'_dd.error.raw': error,
|
|
88
|
-
'_dd.error.is_crash': is_fatal,
|
|
89
|
-
'_dd.error.source_type': 'react-native',
|
|
90
|
-
'_dd.error_log.is_crash': true
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
81
|
});
|
|
94
82
|
|
|
95
83
|
it('M intercept and send a RUM event W onGlobalError() {empty stack trace}', async () => {
|
|
@@ -111,7 +99,12 @@ it('M intercept and send a RUM event W onGlobalError() {empty stack trace}', asy
|
|
|
111
99
|
'SOURCE',
|
|
112
100
|
'',
|
|
113
101
|
{
|
|
114
|
-
'_dd.error.raw':
|
|
102
|
+
'_dd.error.raw': {
|
|
103
|
+
name: 'Error',
|
|
104
|
+
message: 'Something bad happened',
|
|
105
|
+
cause: undefined,
|
|
106
|
+
stack: ''
|
|
107
|
+
},
|
|
115
108
|
'_dd.error.is_crash': is_fatal,
|
|
116
109
|
'_dd.error.source_type': 'react-native'
|
|
117
110
|
},
|
|
@@ -119,19 +112,6 @@ it('M intercept and send a RUM event W onGlobalError() {empty stack trace}', asy
|
|
|
119
112
|
''
|
|
120
113
|
);
|
|
121
114
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
122
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
123
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
124
|
-
'Something bad happened',
|
|
125
|
-
'Error',
|
|
126
|
-
'Something bad happened',
|
|
127
|
-
'',
|
|
128
|
-
{
|
|
129
|
-
'_dd.error.raw': error,
|
|
130
|
-
'_dd.error.is_crash': is_fatal,
|
|
131
|
-
'_dd.error.source_type': 'react-native',
|
|
132
|
-
'_dd.error_log.is_crash': true
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
115
|
});
|
|
136
116
|
|
|
137
117
|
it('M intercept and send a RUM event W onGlobalError() {Error object}', async () => {
|
|
@@ -151,30 +131,22 @@ it('M intercept and send a RUM event W onGlobalError() {Error object}', async ()
|
|
|
151
131
|
'SOURCE',
|
|
152
132
|
expect.stringContaining('Error: Something bad happened'),
|
|
153
133
|
{
|
|
154
|
-
'_dd.error.raw':
|
|
134
|
+
'_dd.error.raw': {
|
|
135
|
+
name: error.name,
|
|
136
|
+
message: error.message,
|
|
137
|
+
stack: error.stack,
|
|
138
|
+
cause: undefined
|
|
139
|
+
},
|
|
155
140
|
'_dd.error.is_crash': is_fatal,
|
|
156
141
|
'_dd.error.source_type': 'react-native'
|
|
157
142
|
},
|
|
158
143
|
expect.any(Number),
|
|
159
144
|
''
|
|
160
145
|
);
|
|
161
|
-
expect(DdRum.addError.mock.calls[0][2]).toContain(
|
|
146
|
+
expect((DdRum.addError as any).mock.calls[0][2]).toContain(
|
|
162
147
|
'/packages/core/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx'
|
|
163
148
|
);
|
|
164
149
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
165
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
166
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
167
|
-
'Something bad happened',
|
|
168
|
-
'Error',
|
|
169
|
-
'Something bad happened',
|
|
170
|
-
expect.stringContaining('Error: Something bad happened'),
|
|
171
|
-
{
|
|
172
|
-
'_dd.error.raw': error,
|
|
173
|
-
'_dd.error.is_crash': is_fatal,
|
|
174
|
-
'_dd.error.source_type': 'react-native',
|
|
175
|
-
'_dd.error_log.is_crash': true
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
150
|
});
|
|
179
151
|
|
|
180
152
|
it('M intercept and send a RUM event W onGlobalError() {CustomError object}', async () => {
|
|
@@ -198,30 +170,22 @@ it('M intercept and send a RUM event W onGlobalError() {CustomError object}', as
|
|
|
198
170
|
'SOURCE',
|
|
199
171
|
expect.stringContaining('Error: Something bad happened'),
|
|
200
172
|
{
|
|
201
|
-
'_dd.error.raw':
|
|
173
|
+
'_dd.error.raw': {
|
|
174
|
+
name: error.name,
|
|
175
|
+
message: error.message,
|
|
176
|
+
stack: error.stack,
|
|
177
|
+
cause: undefined
|
|
178
|
+
},
|
|
202
179
|
'_dd.error.is_crash': is_fatal,
|
|
203
180
|
'_dd.error.source_type': 'react-native'
|
|
204
181
|
},
|
|
205
182
|
expect.any(Number),
|
|
206
183
|
''
|
|
207
184
|
);
|
|
208
|
-
expect(DdRum.addError.mock.calls[0][2]).toContain(
|
|
185
|
+
expect((DdRum.addError as any).mock.calls[0][2]).toContain(
|
|
209
186
|
'/packages/core/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx'
|
|
210
187
|
);
|
|
211
188
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
212
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
213
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
214
|
-
'Something bad happened',
|
|
215
|
-
'CustomError',
|
|
216
|
-
'Something bad happened',
|
|
217
|
-
expect.stringContaining('Error: Something bad happened'),
|
|
218
|
-
{
|
|
219
|
-
'_dd.error.raw': error,
|
|
220
|
-
'_dd.error.is_crash': is_fatal,
|
|
221
|
-
'_dd.error.source_type': 'react-native',
|
|
222
|
-
'_dd.error_log.is_crash': true
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
189
|
});
|
|
226
190
|
|
|
227
191
|
it('M intercept and send a RUM event W onGlobalError() {with source file info}', async () => {
|
|
@@ -246,27 +210,22 @@ it('M intercept and send a RUM event W onGlobalError() {with source file info}',
|
|
|
246
210
|
'SOURCE',
|
|
247
211
|
'at ./path/to/file.js:1038:57',
|
|
248
212
|
{
|
|
249
|
-
'_dd.error.raw': error,
|
|
250
213
|
'_dd.error.is_crash': is_fatal,
|
|
251
|
-
'_dd.error.source_type': 'react-native'
|
|
214
|
+
'_dd.error.source_type': 'react-native',
|
|
215
|
+
'_dd.error.raw': {
|
|
216
|
+
sourceURL: './path/to/file.js',
|
|
217
|
+
line: 1038,
|
|
218
|
+
column: 57,
|
|
219
|
+
message: 'Something bad happened',
|
|
220
|
+
name: 'Error',
|
|
221
|
+
cause: undefined,
|
|
222
|
+
stack: 'at ./path/to/file.js:1038:57'
|
|
223
|
+
}
|
|
252
224
|
},
|
|
253
225
|
expect.any(Number),
|
|
254
226
|
''
|
|
255
227
|
);
|
|
256
228
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
257
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
258
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
259
|
-
'Something bad happened',
|
|
260
|
-
'Error',
|
|
261
|
-
'Something bad happened',
|
|
262
|
-
'at ./path/to/file.js:1038:57',
|
|
263
|
-
{
|
|
264
|
-
'_dd.error.raw': error,
|
|
265
|
-
'_dd.error.is_crash': is_fatal,
|
|
266
|
-
'_dd.error.source_type': 'react-native',
|
|
267
|
-
'_dd.error_log.is_crash': true
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
229
|
});
|
|
271
230
|
|
|
272
231
|
it('M intercept and send a RUM event W onGlobalError() {with component stack}', async () => {
|
|
@@ -293,7 +252,16 @@ it('M intercept and send a RUM event W onGlobalError() {with component stack}',
|
|
|
293
252
|
'SOURCE',
|
|
294
253
|
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
295
254
|
{
|
|
296
|
-
'_dd.error.raw':
|
|
255
|
+
'_dd.error.raw': {
|
|
256
|
+
message: 'Something bad happened',
|
|
257
|
+
name: 'Error',
|
|
258
|
+
stack: [
|
|
259
|
+
'doSomething() at ./path/to/file.js:67:3',
|
|
260
|
+
'nestedCall() at ./path/to/file.js:1064:9',
|
|
261
|
+
'root() at ./path/to/index.js:10:1'
|
|
262
|
+
].join(','),
|
|
263
|
+
cause: undefined
|
|
264
|
+
},
|
|
297
265
|
'_dd.error.is_crash': is_fatal,
|
|
298
266
|
'_dd.error.source_type': 'react-native'
|
|
299
267
|
},
|
|
@@ -301,19 +269,57 @@ it('M intercept and send a RUM event W onGlobalError() {with component stack}',
|
|
|
301
269
|
''
|
|
302
270
|
);
|
|
303
271
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
it('M intercept and send a RUM event W onGlobalError() {with stack and component stack}', async () => {
|
|
275
|
+
// GIVEN
|
|
276
|
+
DdRumErrorTracking.startTracking();
|
|
277
|
+
const is_fatal = Math.random() < 0.5;
|
|
278
|
+
const error = {
|
|
279
|
+
stack: [
|
|
280
|
+
'example() at ./path/to/file.js:77:2',
|
|
281
|
+
'test() at ./path/to/index.js:22:3'
|
|
282
|
+
],
|
|
283
|
+
componentStack: [
|
|
284
|
+
'doSomething() at ./path/to/file.js:67:3',
|
|
285
|
+
'nestedCall() at ./path/to/file.js:1064:9',
|
|
286
|
+
'root() at ./path/to/index.js:10:1'
|
|
287
|
+
],
|
|
288
|
+
message: 'Something bad happened'
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// WHEN
|
|
292
|
+
DdRumErrorTracking.onGlobalError(error, is_fatal);
|
|
293
|
+
await flushPromises();
|
|
294
|
+
|
|
295
|
+
// THEN
|
|
296
|
+
expect(DdRum.addError).toHaveBeenCalledTimes(1);
|
|
297
|
+
expect(DdRum.addError).toHaveBeenCalledWith(
|
|
308
298
|
'Something bad happened',
|
|
309
|
-
'
|
|
299
|
+
'SOURCE',
|
|
300
|
+
'example() at ./path/to/file.js:77:2,test() at ./path/to/index.js:22:3',
|
|
310
301
|
{
|
|
311
|
-
'_dd.error.raw':
|
|
302
|
+
'_dd.error.raw': {
|
|
303
|
+
message: 'Something bad happened',
|
|
304
|
+
name: 'Error',
|
|
305
|
+
stack: [
|
|
306
|
+
'example() at ./path/to/file.js:77:2',
|
|
307
|
+
'test() at ./path/to/index.js:22:3'
|
|
308
|
+
].join(','),
|
|
309
|
+
componentStack: [
|
|
310
|
+
'doSomething() at ./path/to/file.js:67:3',
|
|
311
|
+
'nestedCall() at ./path/to/file.js:1064:9',
|
|
312
|
+
'root() at ./path/to/index.js:10:1'
|
|
313
|
+
],
|
|
314
|
+
cause: undefined
|
|
315
|
+
},
|
|
312
316
|
'_dd.error.is_crash': is_fatal,
|
|
313
|
-
'_dd.error.source_type': 'react-native'
|
|
314
|
-
|
|
315
|
-
|
|
317
|
+
'_dd.error.source_type': 'react-native'
|
|
318
|
+
},
|
|
319
|
+
expect.any(Number),
|
|
320
|
+
''
|
|
316
321
|
);
|
|
322
|
+
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
317
323
|
});
|
|
318
324
|
|
|
319
325
|
it('M intercept and send a RUM event W onGlobalError() {with stack}', async () => {
|
|
@@ -340,7 +346,16 @@ it('M intercept and send a RUM event W onGlobalError() {with stack}', async () =
|
|
|
340
346
|
'SOURCE',
|
|
341
347
|
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
342
348
|
{
|
|
343
|
-
'_dd.error.raw':
|
|
349
|
+
'_dd.error.raw': {
|
|
350
|
+
name: 'Error',
|
|
351
|
+
message: 'Something bad happened',
|
|
352
|
+
cause: undefined,
|
|
353
|
+
stack: [
|
|
354
|
+
'doSomething() at ./path/to/file.js:67:3',
|
|
355
|
+
'nestedCall() at ./path/to/file.js:1064:9',
|
|
356
|
+
'root() at ./path/to/index.js:10:1'
|
|
357
|
+
].join(',')
|
|
358
|
+
},
|
|
344
359
|
'_dd.error.is_crash': is_fatal,
|
|
345
360
|
'_dd.error.source_type': 'react-native'
|
|
346
361
|
},
|
|
@@ -348,19 +363,6 @@ it('M intercept and send a RUM event W onGlobalError() {with stack}', async () =
|
|
|
348
363
|
''
|
|
349
364
|
);
|
|
350
365
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
351
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
352
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
353
|
-
'Something bad happened',
|
|
354
|
-
'Error',
|
|
355
|
-
'Something bad happened',
|
|
356
|
-
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
357
|
-
{
|
|
358
|
-
'_dd.error.raw': error,
|
|
359
|
-
'_dd.error.is_crash': is_fatal,
|
|
360
|
-
'_dd.error.source_type': 'react-native',
|
|
361
|
-
'_dd.error_log.is_crash': true
|
|
362
|
-
}
|
|
363
|
-
);
|
|
364
366
|
});
|
|
365
367
|
|
|
366
368
|
it('M intercept and send a RUM event W onGlobalError() {with stacktrace}', async () => {
|
|
@@ -387,7 +389,16 @@ it('M intercept and send a RUM event W onGlobalError() {with stacktrace}', async
|
|
|
387
389
|
'SOURCE',
|
|
388
390
|
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
389
391
|
{
|
|
390
|
-
'_dd.error.raw':
|
|
392
|
+
'_dd.error.raw': {
|
|
393
|
+
name: 'Error',
|
|
394
|
+
message: 'Something bad happened',
|
|
395
|
+
stack: [
|
|
396
|
+
'doSomething() at ./path/to/file.js:67:3',
|
|
397
|
+
'nestedCall() at ./path/to/file.js:1064:9',
|
|
398
|
+
'root() at ./path/to/index.js:10:1'
|
|
399
|
+
].join(','),
|
|
400
|
+
cause: undefined
|
|
401
|
+
},
|
|
391
402
|
'_dd.error.is_crash': is_fatal,
|
|
392
403
|
'_dd.error.source_type': 'react-native'
|
|
393
404
|
},
|
|
@@ -396,19 +407,6 @@ it('M intercept and send a RUM event W onGlobalError() {with stacktrace}', async
|
|
|
396
407
|
);
|
|
397
408
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
398
409
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
399
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
400
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
401
|
-
'Something bad happened',
|
|
402
|
-
'Error',
|
|
403
|
-
'Something bad happened',
|
|
404
|
-
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
405
|
-
{
|
|
406
|
-
'_dd.error.raw': error,
|
|
407
|
-
'_dd.error.is_crash': is_fatal,
|
|
408
|
-
'_dd.error.source_type': 'react-native',
|
|
409
|
-
'_dd.error_log.is_crash': true
|
|
410
|
-
}
|
|
411
|
-
);
|
|
412
410
|
});
|
|
413
411
|
|
|
414
412
|
it('M not report error in console handler W onGlobalError() {with console reporting handler}', async () => {
|
|
@@ -440,7 +438,16 @@ it('M not report error in console handler W onGlobalError() {with console report
|
|
|
440
438
|
'SOURCE',
|
|
441
439
|
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
442
440
|
{
|
|
443
|
-
'_dd.error.raw':
|
|
441
|
+
'_dd.error.raw': {
|
|
442
|
+
name: 'Error',
|
|
443
|
+
cause: undefined,
|
|
444
|
+
message: 'Something bad happened',
|
|
445
|
+
stack: [
|
|
446
|
+
'doSomething() at ./path/to/file.js:67:3',
|
|
447
|
+
'nestedCall() at ./path/to/file.js:1064:9',
|
|
448
|
+
'root() at ./path/to/index.js:10:1'
|
|
449
|
+
].join(',')
|
|
450
|
+
},
|
|
444
451
|
'_dd.error.is_crash': is_fatal,
|
|
445
452
|
'_dd.error.source_type': 'react-native'
|
|
446
453
|
},
|
|
@@ -450,19 +457,6 @@ it('M not report error in console handler W onGlobalError() {with console report
|
|
|
450
457
|
expect(consoleReportingErrorHandler).toBeCalledTimes(1);
|
|
451
458
|
expect(baseConsoleErrorCalled).toStrictEqual(false);
|
|
452
459
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
453
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
454
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
455
|
-
'Something bad happened',
|
|
456
|
-
'Error',
|
|
457
|
-
'Something bad happened',
|
|
458
|
-
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
459
|
-
{
|
|
460
|
-
'_dd.error.raw': error,
|
|
461
|
-
'_dd.error.is_crash': is_fatal,
|
|
462
|
-
'_dd.error.source_type': 'react-native',
|
|
463
|
-
'_dd.error_log.is_crash': true
|
|
464
|
-
}
|
|
465
|
-
);
|
|
466
460
|
});
|
|
467
461
|
|
|
468
462
|
it('M intercept and send a RUM event W onConsole() {Error with source file info}', async () => {
|
|
@@ -493,17 +487,6 @@ it('M intercept and send a RUM event W onConsole() {Error with source file info}
|
|
|
493
487
|
''
|
|
494
488
|
);
|
|
495
489
|
expect(baseConsoleErrorCalled).toStrictEqual(true);
|
|
496
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
497
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
498
|
-
'Oops I did it again! Something bad happened',
|
|
499
|
-
'Error',
|
|
500
|
-
'Oops I did it again! Something bad happened',
|
|
501
|
-
'at ./path/to/file.js:1038:57',
|
|
502
|
-
{
|
|
503
|
-
'_dd.error.source_type': 'react-native',
|
|
504
|
-
'_dd.error_log.is_crash': true
|
|
505
|
-
}
|
|
506
|
-
);
|
|
507
490
|
});
|
|
508
491
|
|
|
509
492
|
it('M intercept and send a RUM event W onConsole() {Error with component stack}', async () => {
|
|
@@ -536,17 +519,6 @@ it('M intercept and send a RUM event W onConsole() {Error with component stack}'
|
|
|
536
519
|
''
|
|
537
520
|
);
|
|
538
521
|
expect(baseConsoleErrorCalled).toStrictEqual(true);
|
|
539
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
540
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
541
|
-
'Oops I did it again! Something bad happened',
|
|
542
|
-
'Error',
|
|
543
|
-
'Oops I did it again! Something bad happened',
|
|
544
|
-
'doSomething() at ./path/to/file.js:67:3,nestedCall() at ./path/to/file.js:1064:9,root() at ./path/to/index.js:10:1',
|
|
545
|
-
{
|
|
546
|
-
'_dd.error.source_type': 'react-native',
|
|
547
|
-
'_dd.error_log.is_crash': true
|
|
548
|
-
}
|
|
549
|
-
);
|
|
550
522
|
});
|
|
551
523
|
|
|
552
524
|
it('M intercept and send a RUM event W onConsole() {message only}', async () => {
|
|
@@ -571,17 +543,6 @@ it('M intercept and send a RUM event W onConsole() {message only}', async () =>
|
|
|
571
543
|
''
|
|
572
544
|
);
|
|
573
545
|
expect(baseConsoleErrorCalled).toStrictEqual(true);
|
|
574
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
575
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
576
|
-
'Something bad happened',
|
|
577
|
-
'Error',
|
|
578
|
-
'Something bad happened',
|
|
579
|
-
'',
|
|
580
|
-
{
|
|
581
|
-
'_dd.error.source_type': 'react-native',
|
|
582
|
-
'_dd.error_log.is_crash': true
|
|
583
|
-
}
|
|
584
|
-
);
|
|
585
546
|
});
|
|
586
547
|
|
|
587
548
|
it('M intercept and send a RUM event W onConsole() {Error with source file and name}', async () => {
|
|
@@ -613,17 +574,6 @@ it('M intercept and send a RUM event W onConsole() {Error with source file and n
|
|
|
613
574
|
''
|
|
614
575
|
);
|
|
615
576
|
expect(baseConsoleErrorCalled).toStrictEqual(true);
|
|
616
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
617
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
618
|
-
'Oops I did it again! Something bad happened',
|
|
619
|
-
'CustomConsoleError',
|
|
620
|
-
'Oops I did it again! Something bad happened',
|
|
621
|
-
'at ./path/to/file.js:1038:57',
|
|
622
|
-
{
|
|
623
|
-
'_dd.error.source_type': 'react-native',
|
|
624
|
-
'_dd.error_log.is_crash': true
|
|
625
|
-
}
|
|
626
|
-
);
|
|
627
577
|
});
|
|
628
578
|
|
|
629
579
|
describe.each([
|
|
@@ -648,7 +598,10 @@ describe.each([
|
|
|
648
598
|
const errorMessage =
|
|
649
599
|
message === undefined || message === null
|
|
650
600
|
? 'Unknown Error'
|
|
651
|
-
:
|
|
601
|
+
: typeof message?.toString === 'function' &&
|
|
602
|
+
message.toString !== Object.prototype.toString
|
|
603
|
+
? String(message)
|
|
604
|
+
: 'Unknown Error';
|
|
652
605
|
expect(DdRum.addError).toHaveBeenCalledTimes(1);
|
|
653
606
|
expect(DdRum.addError).toHaveBeenCalledWith(
|
|
654
607
|
errorMessage,
|
|
@@ -661,17 +614,6 @@ describe.each([
|
|
|
661
614
|
''
|
|
662
615
|
);
|
|
663
616
|
expect(baseConsoleErrorCalled).toStrictEqual(true);
|
|
664
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
665
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
666
|
-
errorMessage,
|
|
667
|
-
'Error',
|
|
668
|
-
errorMessage,
|
|
669
|
-
'',
|
|
670
|
-
{
|
|
671
|
-
'_dd.error.source_type': 'react-native',
|
|
672
|
-
'_dd.error_log.is_crash': true
|
|
673
|
-
}
|
|
674
|
-
);
|
|
675
617
|
});
|
|
676
618
|
});
|
|
677
619
|
|
|
@@ -693,30 +635,22 @@ it('M intercept and send a RUM event W on error() {called from RNErrorHandler}',
|
|
|
693
635
|
'SOURCE',
|
|
694
636
|
expect.stringContaining('Error: Something bad happened'),
|
|
695
637
|
{
|
|
696
|
-
'_dd.error.raw':
|
|
638
|
+
'_dd.error.raw': {
|
|
639
|
+
name: error.name,
|
|
640
|
+
message: error.message,
|
|
641
|
+
stack: error.stack,
|
|
642
|
+
cause: undefined
|
|
643
|
+
},
|
|
697
644
|
'_dd.error.is_crash': is_fatal,
|
|
698
645
|
'_dd.error.source_type': 'react-native'
|
|
699
646
|
},
|
|
700
647
|
expect.any(Number),
|
|
701
648
|
''
|
|
702
649
|
);
|
|
703
|
-
expect(DdRum.addError.mock.calls[0][2]).toContain(
|
|
650
|
+
expect((DdRum.addError as any).mock.calls[0][2]).toContain(
|
|
704
651
|
'/packages/core/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx'
|
|
705
652
|
);
|
|
706
653
|
expect(baseErrorHandlerCalled).toStrictEqual(true);
|
|
707
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
708
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
709
|
-
'Something bad happened',
|
|
710
|
-
'Error',
|
|
711
|
-
'Something bad happened',
|
|
712
|
-
expect.stringContaining('Error: Something bad happened'),
|
|
713
|
-
{
|
|
714
|
-
'_dd.error.raw': error,
|
|
715
|
-
'_dd.error.is_crash': is_fatal,
|
|
716
|
-
'_dd.error.source_type': 'react-native',
|
|
717
|
-
'_dd.error_log.is_crash': true
|
|
718
|
-
}
|
|
719
|
-
);
|
|
720
654
|
});
|
|
721
655
|
|
|
722
656
|
it('M intercept and send a RUM event W onConsole() {called from RNErrorHandler}', async () => {
|
|
@@ -742,17 +676,6 @@ it('M intercept and send a RUM event W onConsole() {called from RNErrorHandler}'
|
|
|
742
676
|
''
|
|
743
677
|
);
|
|
744
678
|
expect(baseConsoleErrorCalled).toStrictEqual(true);
|
|
745
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledTimes(1);
|
|
746
|
-
expect(DdLogs.errorWithError).toHaveBeenCalledWith(
|
|
747
|
-
'Oops I did it again!',
|
|
748
|
-
'Error',
|
|
749
|
-
'Oops I did it again!',
|
|
750
|
-
'',
|
|
751
|
-
{
|
|
752
|
-
'_dd.error.source_type': 'react-native',
|
|
753
|
-
'_dd.error_log.is_crash': true
|
|
754
|
-
}
|
|
755
|
-
);
|
|
756
679
|
});
|
|
757
680
|
|
|
758
681
|
/**
|
|
@@ -21,7 +21,7 @@ import React from 'react';
|
|
|
21
21
|
import type { DdNativeRumType } from '../../../nativeModulesTypes';
|
|
22
22
|
import { DdRumUserInteractionTracking } from '../../../rum/instrumentation/interactionTracking/DdRumUserInteractionTracking';
|
|
23
23
|
import { BufferSingleton } from '../../../sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
24
|
-
import {
|
|
24
|
+
import { NativeDdSdk } from '../../../sdk/DdSdkInternal';
|
|
25
25
|
|
|
26
26
|
const styles = StyleSheet.create({
|
|
27
27
|
button: {
|
|
@@ -311,7 +311,7 @@ describe('startTracking memoization', () => {
|
|
|
311
311
|
// GIVEN
|
|
312
312
|
DdRumUserInteractionTracking.startTracking({});
|
|
313
313
|
let rendersCount = 0;
|
|
314
|
-
const DummyComponent = props => {
|
|
314
|
+
const DummyComponent = (props: { onPress: () => void }) => {
|
|
315
315
|
rendersCount++;
|
|
316
316
|
return (
|
|
317
317
|
<TouchableWithoutFeedback onPress={props.onPress}>
|
|
@@ -343,7 +343,7 @@ describe('startTracking memoization', () => {
|
|
|
343
343
|
// GIVEN
|
|
344
344
|
DdRumUserInteractionTracking.startTracking({});
|
|
345
345
|
let rendersCount = 0;
|
|
346
|
-
const DummyComponent = props => {
|
|
346
|
+
const DummyComponent = (props: { title: string }) => {
|
|
347
347
|
rendersCount++;
|
|
348
348
|
return (
|
|
349
349
|
<View style={styles.button}>
|
|
@@ -370,7 +370,10 @@ describe('startTracking memoization', () => {
|
|
|
370
370
|
// GIVEN
|
|
371
371
|
DdRumUserInteractionTracking.startTracking({});
|
|
372
372
|
let rendersCount = 0;
|
|
373
|
-
const DummyComponent = props
|
|
373
|
+
const DummyComponent = (props: {
|
|
374
|
+
onPress: () => void;
|
|
375
|
+
title: string;
|
|
376
|
+
}) => {
|
|
374
377
|
rendersCount++;
|
|
375
378
|
return (
|
|
376
379
|
<TouchableWithoutFeedback onPress={props.onPress}>
|
|
@@ -410,7 +413,7 @@ describe('startTracking memoization', () => {
|
|
|
410
413
|
// GIVEN
|
|
411
414
|
DdRumUserInteractionTracking.startTracking({});
|
|
412
415
|
let rendersCount = 0;
|
|
413
|
-
const DummyComponent = props => {
|
|
416
|
+
const DummyComponent = (props: { onPress: () => void }) => {
|
|
414
417
|
rendersCount++;
|
|
415
418
|
return (
|
|
416
419
|
<TouchableWithoutFeedback onPress={props.onPress}>
|
|
@@ -456,7 +459,7 @@ describe('startTracking', () => {
|
|
|
456
459
|
jest.setMock('react/jsx-runtime', {});
|
|
457
460
|
DdRumUserInteractionTracking.startTracking({});
|
|
458
461
|
expect(DdRumUserInteractionTracking['isTracking']).toBe(true);
|
|
459
|
-
expect(
|
|
462
|
+
expect(NativeDdSdk.telemetryDebug).toBeCalledWith(
|
|
460
463
|
'React jsx runtime does not export new jsx transform'
|
|
461
464
|
);
|
|
462
465
|
});
|
|
@@ -466,7 +469,7 @@ describe('startTracking', () => {
|
|
|
466
469
|
|
|
467
470
|
DdRumUserInteractionTracking.startTracking({});
|
|
468
471
|
expect(DdRumUserInteractionTracking['isTracking']).toBe(true);
|
|
469
|
-
expect(
|
|
472
|
+
expect(NativeDdSdk.telemetryDebug).toBeCalledWith(
|
|
470
473
|
'React version does not support new jsx transform'
|
|
471
474
|
);
|
|
472
475
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import { CoreConfiguration } from './features/CoreConfiguration';
|
|
7
|
+
import { InitializationMode } from './types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* SDK Initialization configuration for `DatadogProvider`.
|
|
11
|
+
*/
|
|
12
|
+
export class DatadogProviderConfiguration extends CoreConfiguration {
|
|
13
|
+
/**
|
|
14
|
+
* If set to ASYNC, the initialization will be delayed until all animations are completed.
|
|
15
|
+
*/
|
|
16
|
+
public initializationMode: InitializationMode = InitializationMode.SYNC;
|
|
17
|
+
}
|