@datadog/mobile-react-native 2.14.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +6 -6
- package/README.md +23 -13
- package/android/build.gradle +10 -11
- package/android/gradle.properties +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
- package/android/src/test/resources/input/complete-configuration.json +32 -28
- package/android/src/test/resources/input/malformed-configuration.json +1 -1
- package/android/src/test/resources/input/minimal-configuration.json +4 -2
- package/datadog-configuration.schema.json +187 -139
- package/ios/Sources/AnyEncodable.swift +14 -7
- package/ios/Sources/Attributes.swift +0 -7
- package/ios/Sources/DatadogSDKWrapper.swift +12 -128
- package/ios/Sources/DdLogsImplementation.swift +9 -39
- package/ios/Sources/DdRum.mm +89 -1
- package/ios/Sources/DdRumImplementation.swift +79 -0
- package/ios/Sources/DdSdk.mm +76 -11
- package/ios/Sources/DdSdkConfiguration.swift +159 -117
- package/ios/Sources/DdSdkImplementation.swift +235 -82
- package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
- package/ios/Sources/DdTelemetry.swift +49 -0
- package/ios/Sources/GlobalState.swift +1 -1
- package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
- package/ios/Sources/SdkVersion.swift +1 -1
- package/jest/mock.js +43 -4
- package/lib/commonjs/DdAttributes.js.map +1 -0
- package/lib/commonjs/DdSdkReactNative.js +159 -56
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/InternalLog.js +1 -1
- package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
- package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
- package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
- package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.js +120 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
- package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/commonjs/config/types/BatchSize.js +31 -0
- package/lib/commonjs/config/types/BatchSize.js.map +1 -0
- package/lib/commonjs/config/types/InitializationMode.js +17 -0
- package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
- package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
- package/lib/commonjs/config/types/UploadFrequency.js +30 -0
- package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/commonjs/config/types/index.js +68 -0
- package/lib/commonjs/config/types/index.js.map +1 -0
- package/lib/commonjs/index.js +51 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +13 -9
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/logs/eventMapper.js +4 -1
- package/lib/commonjs/logs/eventMapper.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +0 -45
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +56 -28
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/helper.js +63 -0
- package/lib/commonjs/rum/helper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -25
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/commonjs/rum/types.js +1 -9
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
- package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/commonjs/sdk/DdSdk.js +4 -2
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
- package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +7 -5
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/types.js +19 -46
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
- package/lib/commonjs/utils/singletonUtils.js +21 -0
- package/lib/commonjs/utils/singletonUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdAttributes.js.map +1 -0
- package/lib/module/DdSdkReactNative.js +155 -52
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/InternalLog.js +1 -1
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/config/DatadogProviderConfiguration.js +18 -0
- package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.js +341 -0
- package/lib/module/config/FileBasedConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.type.js +2 -0
- package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/module/config/async/asyncInitializationHelper.js +36 -0
- package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.js +98 -0
- package/lib/module/config/features/CoreConfiguration.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.type.js +2 -0
- package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/module/config/features/CoreConfigurationNative.js +31 -0
- package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.js +30 -0
- package/lib/module/config/features/LogsConfiguration.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.type.js +2 -0
- package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/module/config/features/LogsConfigurationNative.js +2 -0
- package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.js +114 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.type.js +2 -0
- package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/module/config/features/RumConfigurationNative.js +2 -0
- package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.js +18 -0
- package/lib/module/config/features/TraceConfiguration.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.type.js +2 -0
- package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/module/config/features/TraceConfigurationNative.js +2 -0
- package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/module/config/types/BatchProcessingLevel.js +25 -0
- package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/module/config/types/BatchSize.js +26 -0
- package/lib/module/config/types/BatchSize.js.map +1 -0
- package/lib/module/config/types/InitializationMode.js +11 -0
- package/lib/module/config/types/InitializationMode.js.map +1 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/module/config/types/SdkVerbosity.js.map +1 -0
- package/lib/module/config/types/TrackingConsent.js.map +1 -0
- package/lib/module/config/types/UploadFrequency.js +25 -0
- package/lib/module/config/types/UploadFrequency.js.map +1 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/module/config/types/index.js +15 -0
- package/lib/module/config/types/index.js.map +1 -0
- package/lib/module/index.js +13 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +13 -9
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/logs/eventMapper.js +4 -1
- package/lib/module/logs/eventMapper.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +1 -43
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +54 -26
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/helper.js +49 -0
- package/lib/module/rum/helper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -24
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/module/rum/types.js +0 -9
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
- package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/types.js +2 -0
- package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
- package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/module/sdk/DdSdk.js +4 -4
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +80 -0
- package/lib/module/sdk/DdSdkInternal.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
- package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/trace/DdTrace.js +7 -6
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/types.js +22 -42
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/longTasksUtils.js.map +1 -1
- package/lib/module/utils/singletonUtils.js +14 -0
- package/lib/module/utils/singletonUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/DdSdkReactNative.d.ts +49 -12
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/InternalLog.d.ts +1 -1
- package/lib/typescript/InternalLog.d.ts.map +1 -1
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +10 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +20 -9
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/logs/DdLogs.d.ts +2 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/logs/eventMapper.d.ts +3 -2
- package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
- package/lib/typescript/logs/types.d.ts +1 -16
- package/lib/typescript/logs/types.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +2 -15
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +10 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
- package/lib/typescript/rum/helper.d.ts +10 -0
- package/lib/typescript/rum/helper.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/rum/types.d.ts +47 -7
- package/lib/typescript/rum/types.d.ts.map +1 -1
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
- package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts +2 -3
- package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts +1 -2
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +74 -92
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
- package/lib/typescript/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +246 -104
- package/src/InternalLog.tsx +1 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
- package/src/__tests__/InternalLog.test.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
- package/src/config/DatadogProviderConfiguration.ts +17 -0
- package/src/config/FileBasedConfiguration.ts +464 -0
- package/src/config/FileBasedConfiguration.type.ts +66 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
- package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
- package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
- package/src/config/async/PartialInitializationConfiguration.ts +58 -0
- package/src/config/async/asyncInitializationHelper.tsx +51 -0
- package/src/config/features/CoreConfiguration.ts +130 -0
- package/src/config/features/CoreConfiguration.type.ts +119 -0
- package/src/config/features/CoreConfigurationNative.ts +50 -0
- package/src/config/features/LogsConfiguration.ts +38 -0
- package/src/config/features/LogsConfiguration.type.ts +33 -0
- package/src/config/features/LogsConfigurationNative.ts +10 -0
- package/src/config/features/RumConfiguration.ts +137 -0
- package/src/config/features/RumConfiguration.type.ts +164 -0
- package/src/config/features/RumConfigurationNative.ts +26 -0
- package/src/config/features/TraceConfiguration.ts +24 -0
- package/src/config/features/TraceConfiguration.type.ts +17 -0
- package/src/config/features/TraceConfigurationNative.ts +8 -0
- package/src/config/types/BatchProcessingLevel.ts +23 -0
- package/src/config/types/BatchSize.ts +24 -0
- package/src/config/types/InitializationMode.ts +9 -0
- package/src/config/types/InitializationModeForTelemetry.ts +11 -0
- package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
- package/src/config/types/UploadFrequency.tsx +23 -0
- package/src/config/types/VitalsUpdateFrequency.ts +11 -0
- package/src/config/types/index.ts +15 -0
- package/src/index.tsx +33 -16
- package/src/logs/DdLogs.ts +14 -13
- package/src/logs/__tests__/DdLogs.test.ts +60 -107
- package/src/logs/__tests__/eventMapper.test.ts +1 -1
- package/src/logs/eventMapper.ts +5 -4
- package/src/logs/types.ts +1 -20
- package/src/nativeModulesTypes.ts +2 -17
- package/src/rum/DdRum.ts +139 -42
- package/src/rum/__tests__/DdRum.test.ts +217 -47
- package/src/rum/eventMappers/errorEventMapper.ts +1 -1
- package/src/rum/helper.ts +62 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +20 -32
- package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
- package/src/rum/types.ts +68 -8
- package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
- package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
- package/src/sdk/AccountInfoSingleton/types.ts +11 -0
- package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
- package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
- package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
- package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
- package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
- package/src/sdk/AttributesEncoding/helpers.ts +176 -0
- package/src/sdk/AttributesEncoding/types.ts +33 -0
- package/src/sdk/AttributesEncoding/utils.ts +31 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
- package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
- package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
- package/src/sdk/DdSdk.ts +8 -5
- package/src/sdk/DdSdkInternal.ts +121 -0
- package/src/sdk/EventMappers/EventMapper.ts +9 -4
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
- package/src/sdk/GlobalState/GlobalState.tsx +10 -11
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
- package/src/sdk/UserInfoSingleton/types.ts +1 -4
- package/src/specs/NativeDdRum.ts +65 -0
- package/src/specs/NativeDdSdk.ts +40 -6
- package/src/trace/DdTrace.ts +11 -7
- package/src/trace/__tests__/DdTrace.test.ts +7 -8
- package/src/types.tsx +97 -76
- package/src/utils/__tests__/errorUtils.test.ts +1 -1
- package/src/utils/__tests__/singletonUtils.test.ts +75 -0
- package/src/utils/longTasksUtils.ts +1 -3
- package/src/utils/singletonUtils.ts +17 -0
- package/src/version.ts +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/commonjs/ProxyConfiguration.js.map +0 -1
- package/lib/commonjs/SdkVerbosity.js.map +0 -1
- package/lib/commonjs/TrackingConsent.js.map +0 -1
- package/lib/commonjs/rum/DdAttributes.js.map +0 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/commonjs/utils/argsUtils.js +0 -41
- package/lib/commonjs/utils/argsUtils.js.map +0 -1
- package/lib/commonjs/utils/errorUtils.js.map +0 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
- package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/module/ProxyConfiguration.js.map +0 -1
- package/lib/module/SdkVerbosity.js.map +0 -1
- package/lib/module/TrackingConsent.js.map +0 -1
- package/lib/module/rum/DdAttributes.js.map +0 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/module/utils/argsUtils.js +0 -35
- package/lib/module/utils/argsUtils.js.map +0 -1
- package/lib/module/utils/errorUtils.js.map +0 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
- package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
- package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
- package/lib/typescript/TrackingConsent.d.ts.map +0 -1
- package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
- package/lib/typescript/utils/argsUtils.d.ts +0 -8
- package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
- package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
- package/src/DdSdkReactNativeConfiguration.tsx +0 -582
- package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
- package/src/utils/__tests__/argsUtils.test.ts +0 -66
- package/src/utils/argsUtils.ts +0 -41
- /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
- /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
- /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
- /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
- /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
- /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
- /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
|
@@ -4,30 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GlobalState = void 0;
|
|
7
|
+
var _singletonUtils = require("../../utils/singletonUtils");
|
|
7
8
|
/*
|
|
8
9
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
9
10
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
10
11
|
* Copyright 2016-Present Datadog, Inc.
|
|
11
12
|
*/
|
|
12
13
|
|
|
14
|
+
const GLOBAL_STATE_MODULE = 'com.datadog.reactnative.sdk.global_state';
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* A singleton container for attributes that are shared internally across all
|
|
15
18
|
* the SDK classes.
|
|
16
19
|
*/
|
|
17
|
-
class
|
|
20
|
+
class _GlobalState {
|
|
18
21
|
/**
|
|
19
22
|
* `true` if the SDK is initialized, `false` otherwise.
|
|
20
23
|
*/
|
|
21
24
|
isInitialized = false;
|
|
22
|
-
|
|
23
|
-
// Singleton implementation
|
|
24
|
-
static _instance = undefined;
|
|
25
|
-
static get instance() {
|
|
26
|
-
if (this._instance === undefined) {
|
|
27
|
-
this._instance = new GlobalState();
|
|
28
|
-
}
|
|
29
|
-
return this._instance;
|
|
30
|
-
}
|
|
31
25
|
}
|
|
32
|
-
exports.GlobalState =
|
|
26
|
+
const GlobalState = exports.GlobalState = (0, _singletonUtils.getGlobalInstance)(GLOBAL_STATE_MODULE, () => new _GlobalState());
|
|
33
27
|
//# sourceMappingURL=GlobalState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_singletonUtils","require","GLOBAL_STATE_MODULE","_GlobalState","isInitialized","GlobalState","exports","getGlobalInstance"],"sourceRoot":"../../../../src","sources":["sdk/GlobalState/GlobalState.tsx"],"mappings":";;;;;;AAMA,IAAAA,eAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,mBAAmB,GAAG,0CAA0C;;AAEtE;AACA;AACA;AACA;AACA,MAAMC,YAAY,CAAC;EACf;AACJ;AACA;EACWC,aAAa,GAAG,KAAK;AAChC;AAEO,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,iCAAiB,EACxCL,mBAAmB,EACnB,MAAM,IAAIC,YAAY,CAAC,CAC3B,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UserInfoSingleton = void 0;
|
|
7
|
+
var _helper = require("../../rum/helper");
|
|
7
8
|
/*
|
|
8
9
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
9
10
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
@@ -11,13 +12,17 @@ exports.UserInfoSingleton = void 0;
|
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
class UserInfoProvider {
|
|
14
|
-
userInfo =
|
|
15
|
+
userInfo = undefined;
|
|
15
16
|
setUserInfo = userInfo => {
|
|
16
17
|
this.userInfo = userInfo;
|
|
18
|
+
(0, _helper.setCachedUserId)(this.userInfo.id);
|
|
17
19
|
};
|
|
18
20
|
getUserInfo = () => {
|
|
19
21
|
return this.userInfo;
|
|
20
22
|
};
|
|
23
|
+
clearUserInfo = () => {
|
|
24
|
+
this.userInfo = undefined;
|
|
25
|
+
};
|
|
21
26
|
}
|
|
22
27
|
class UserInfoSingleton {
|
|
23
28
|
static userInfoProvider = new UserInfoProvider();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UserInfoProvider","userInfo","setUserInfo","getUserInfo","UserInfoSingleton","userInfoProvider","getInstance","reset","exports"],"sourceRoot":"../../../../src","sources":["sdk/UserInfoSingleton/UserInfoSingleton.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_helper","require","UserInfoProvider","userInfo","undefined","setUserInfo","setCachedUserId","id","getUserInfo","clearUserInfo","UserInfoSingleton","userInfoProvider","getInstance","reset","exports"],"sourceRoot":"../../../../src","sources":["sdk/UserInfoSingleton/UserInfoSingleton.ts"],"mappings":";;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAMA,MAAMC,gBAAgB,CAAC;EACXC,QAAQ,GAAyBC,SAAS;EAElDC,WAAW,GAAIF,QAAkB,IAAK;IAClC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxB,IAAAG,uBAAe,EAAC,IAAI,CAACH,QAAQ,CAACI,EAAE,CAAC;EACrC,CAAC;EAEDC,WAAW,GAAGA,CAAA,KAA4B;IACtC,OAAO,IAAI,CAACL,QAAQ;EACxB,CAAC;EAEDM,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,CAACN,QAAQ,GAAGC,SAAS;EAC7B,CAAC;AACL;AAEO,MAAMM,iBAAiB,CAAC;EAC3B,OAAeC,gBAAgB,GAAG,IAAIT,gBAAgB,CAAC,CAAC;EAExD,OAAOU,WAAW,GAAGA,CAAA,KAAwB;IACzC,OAAOF,iBAAiB,CAACC,gBAAgB;EAC7C,CAAC;EAED,OAAOE,KAAK,GAAGA,CAAA,KAAM;IACjBH,iBAAiB,CAACC,gBAAgB,GAAG,IAAIT,gBAAgB,CAAC,CAAC;EAC/D,CAAC;AACL;AAACY,OAAA,CAAAJ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdRum.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdRum.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAyNA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,OAAO,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSdk.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSdk.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AA4HA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,OAAO,CAAC","ignoreList":[]}
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DdTrace = void 0;
|
|
7
7
|
var _InternalLog = require("../InternalLog");
|
|
8
|
-
var _SdkVerbosity = require("../SdkVerbosity");
|
|
8
|
+
var _SdkVerbosity = require("../config/types/SdkVerbosity");
|
|
9
|
+
var _attributesEncoding = require("../sdk/AttributesEncoding/attributesEncoding");
|
|
9
10
|
var _bufferNativeCall = require("../sdk/DatadogProvider/Buffer/bufferNativeCall");
|
|
10
|
-
var
|
|
11
|
+
var _singletonUtils = require("../utils/singletonUtils");
|
|
11
12
|
var _DefaultTimeProvider = require("../utils/time-provider/DefaultTimeProvider");
|
|
12
13
|
/*
|
|
13
14
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
@@ -15,19 +16,20 @@ var _DefaultTimeProvider = require("../utils/time-provider/DefaultTimeProvider")
|
|
|
15
16
|
* Copyright 2016-Present Datadog, Inc.
|
|
16
17
|
*/
|
|
17
18
|
|
|
19
|
+
const TRACE_MODULE = 'com.datadog.reactnative.trace';
|
|
18
20
|
const timeProvider = new _DefaultTimeProvider.DefaultTimeProvider();
|
|
19
21
|
class DdTraceWrapper {
|
|
20
22
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
21
23
|
nativeTrace = require('../specs/NativeDdTrace').default;
|
|
22
24
|
startSpan = (operation, context = {}, timestampMs = timeProvider.now()) => {
|
|
23
|
-
const spanId = (0, _bufferNativeCall.bufferNativeCallReturningId)(() => this.nativeTrace.startSpan(operation, (0,
|
|
25
|
+
const spanId = (0, _bufferNativeCall.bufferNativeCallReturningId)(() => this.nativeTrace.startSpan(operation, (0, _attributesEncoding.encodeAttributes)(context), timestampMs));
|
|
24
26
|
_InternalLog.InternalLog.log(`Starting span “${operation}” #${spanId}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
25
27
|
return spanId;
|
|
26
28
|
};
|
|
27
29
|
finishSpan = (spanId, context = {}, timestampMs = timeProvider.now()) => {
|
|
28
30
|
_InternalLog.InternalLog.log(`Finishing span #${spanId}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
29
|
-
return (0, _bufferNativeCall.bufferNativeCallWithId)(id => this.nativeTrace.finishSpan(id, (0,
|
|
31
|
+
return (0, _bufferNativeCall.bufferNativeCallWithId)(id => this.nativeTrace.finishSpan(id, (0, _attributesEncoding.encodeAttributes)(context), timestampMs), spanId);
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
const DdTrace = exports.DdTrace = new DdTraceWrapper();
|
|
34
|
+
const DdTrace = exports.DdTrace = (0, _singletonUtils.getGlobalInstance)(TRACE_MODULE, () => new DdTraceWrapper());
|
|
33
35
|
//# sourceMappingURL=DdTrace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_InternalLog","require","_SdkVerbosity","_bufferNativeCall","
|
|
1
|
+
{"version":3,"names":["_InternalLog","require","_SdkVerbosity","_attributesEncoding","_bufferNativeCall","_singletonUtils","_DefaultTimeProvider","TRACE_MODULE","timeProvider","DefaultTimeProvider","DdTraceWrapper","nativeTrace","default","startSpan","operation","context","timestampMs","now","spanId","bufferNativeCallReturningId","encodeAttributes","InternalLog","log","SdkVerbosity","DEBUG","finishSpan","bufferNativeCallWithId","id","DdTrace","exports","getGlobalInstance"],"sourceRoot":"../../../src","sources":["trace/DdTrace.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAhBA;AACA;AACA;AACA;AACA;;AAcA,MAAMM,YAAY,GAAG,+BAA+B;AAEpD,MAAMC,YAAY,GAAG,IAAIC,wCAAmB,CAAC,CAAC;AAE9C,MAAMC,cAAc,CAAwB;EACxC;EACQC,WAAW,GAAsBV,OAAO,CAAC,wBAAwB,CAAC,CACrEW,OAAO;EAEZC,SAAS,GAAGA,CACRC,SAAiB,EACjBC,OAAe,GAAG,CAAC,CAAC,EACpBC,WAAmB,GAAGR,YAAY,CAACS,GAAG,CAAC,CAAC,KACtB;IAClB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,MACvC,IAAI,CAACR,WAAW,CAACE,SAAS,CACtBC,SAAS,EACT,IAAAM,oCAAgB,EAACL,OAAO,CAAC,EACzBC,WACJ,CACJ,CAAC;IACDK,wBAAW,CAACC,GAAG,CACX,kBAAkBR,SAAS,MAAMI,MAAM,EAAE,EACzCK,0BAAY,CAACC,KACjB,CAAC;IACD,OAAON,MAAM;EACjB,CAAC;EAEDO,UAAU,GAAGA,CACTP,MAAc,EACdH,OAAe,GAAG,CAAC,CAAC,EACpBC,WAAmB,GAAGR,YAAY,CAACS,GAAG,CAAC,CAAC,KACxB;IAChBI,wBAAW,CAACC,GAAG,CAAC,mBAAmBJ,MAAM,EAAE,EAAEK,0BAAY,CAACC,KAAK,CAAC;IAChE,OAAO,IAAAE,wCAAsB,EACzBC,EAAE,IACE,IAAI,CAAChB,WAAW,CAACc,UAAU,CACvBE,EAAE,EACF,IAAAP,oCAAgB,EAACL,OAAO,CAAC,EACzBC,WACJ,CAAC,EACLE,MACJ,CAAC;EACL,CAAC;AACL;AAEO,MAAMU,OAAoB,GAAAC,OAAA,CAAAD,OAAA,GAAG,IAAAE,iCAAiB,EACjDvB,YAAY,EACZ,MAAM,IAAIG,cAAc,CAAC,CAC7B,CAAC","ignoreList":[]}
|
package/lib/commonjs/types.js
CHANGED
|
@@ -3,61 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.FeatureOperationFailure = exports.ErrorSource = void 0;
|
|
7
7
|
/*
|
|
8
8
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
9
9
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
10
10
|
* Copyright 2016-Present Datadog, Inc.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A configuration object to initialize Datadog's features.
|
|
15
|
-
*/
|
|
16
|
-
class DdSdkConfiguration {
|
|
17
|
-
constructor(clientToken, env, applicationId, nativeCrashReportEnabled, nativeLongTaskThresholdMs, longTaskThresholdMs, sampleRate, site, trackingConsent, additionalConfiguration, telemetrySampleRate, vitalsUpdateFrequency, uploadFrequency, batchSize, trackFrustrations, trackBackgroundEvents, customEndpoints, configurationForTelemetry, nativeViewTracking, nativeInteractionTracking, verbosity, proxyConfig, serviceName, firstPartyHosts, bundleLogsWithRum, bundleLogsWithTraces, trackNonFatalAnrs, appHangThreshold, resourceTracingSamplingRate, trackWatchdogTerminations, batchProcessingLevel,
|
|
18
|
-
// eslint-disable-next-line no-empty-function
|
|
19
|
-
initialResourceThreshold) {
|
|
20
|
-
this.clientToken = clientToken;
|
|
21
|
-
this.env = env;
|
|
22
|
-
this.applicationId = applicationId;
|
|
23
|
-
this.nativeCrashReportEnabled = nativeCrashReportEnabled;
|
|
24
|
-
this.nativeLongTaskThresholdMs = nativeLongTaskThresholdMs;
|
|
25
|
-
this.longTaskThresholdMs = longTaskThresholdMs;
|
|
26
|
-
this.sampleRate = sampleRate;
|
|
27
|
-
this.site = site;
|
|
28
|
-
this.trackingConsent = trackingConsent;
|
|
29
|
-
this.additionalConfiguration = additionalConfiguration;
|
|
30
|
-
this.telemetrySampleRate = telemetrySampleRate;
|
|
31
|
-
this.vitalsUpdateFrequency = vitalsUpdateFrequency;
|
|
32
|
-
this.uploadFrequency = uploadFrequency;
|
|
33
|
-
this.batchSize = batchSize;
|
|
34
|
-
this.trackFrustrations = trackFrustrations;
|
|
35
|
-
this.trackBackgroundEvents = trackBackgroundEvents;
|
|
36
|
-
this.customEndpoints = customEndpoints;
|
|
37
|
-
this.configurationForTelemetry = configurationForTelemetry;
|
|
38
|
-
this.nativeViewTracking = nativeViewTracking;
|
|
39
|
-
this.nativeInteractionTracking = nativeInteractionTracking;
|
|
40
|
-
this.verbosity = verbosity;
|
|
41
|
-
this.proxyConfig = proxyConfig;
|
|
42
|
-
this.serviceName = serviceName;
|
|
43
|
-
this.firstPartyHosts = firstPartyHosts;
|
|
44
|
-
this.bundleLogsWithRum = bundleLogsWithRum;
|
|
45
|
-
this.bundleLogsWithTraces = bundleLogsWithTraces;
|
|
46
|
-
this.trackNonFatalAnrs = trackNonFatalAnrs;
|
|
47
|
-
this.appHangThreshold = appHangThreshold;
|
|
48
|
-
this.resourceTracingSamplingRate = resourceTracingSamplingRate;
|
|
49
|
-
this.trackWatchdogTerminations = trackWatchdogTerminations;
|
|
50
|
-
this.batchProcessingLevel = batchProcessingLevel;
|
|
51
|
-
this.initialResourceThreshold = initialResourceThreshold;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
12
|
/**
|
|
56
13
|
* The entry point to initialize Datadog's features.
|
|
57
14
|
*/
|
|
58
|
-
|
|
59
15
|
/**
|
|
60
16
|
* The entry point to use Datadog's Trace feature.
|
|
61
17
|
*/
|
|
62
|
-
|
|
18
|
+
// Shared types across modules
|
|
19
|
+
// Core
|
|
20
|
+
// DdLogs
|
|
21
|
+
// DdRum
|
|
22
|
+
let ErrorSource = exports.ErrorSource = /*#__PURE__*/function (ErrorSource) {
|
|
23
|
+
ErrorSource["NETWORK"] = "NETWORK";
|
|
24
|
+
ErrorSource["SOURCE"] = "SOURCE";
|
|
25
|
+
ErrorSource["CONSOLE"] = "CONSOLE";
|
|
26
|
+
ErrorSource["WEBVIEW"] = "WEBVIEW";
|
|
27
|
+
ErrorSource["CUSTOM"] = "CUSTOM";
|
|
28
|
+
return ErrorSource;
|
|
29
|
+
}({});
|
|
30
|
+
let FeatureOperationFailure = exports.FeatureOperationFailure = /*#__PURE__*/function (FeatureOperationFailure) {
|
|
31
|
+
FeatureOperationFailure["ERROR"] = "ERROR";
|
|
32
|
+
FeatureOperationFailure["ABANDONED"] = "ABANDONED";
|
|
33
|
+
FeatureOperationFailure["OTHER"] = "OTHER";
|
|
34
|
+
return FeatureOperationFailure;
|
|
35
|
+
}({});
|
|
63
36
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ErrorSource","exports","FeatureOperationFailure"],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAiFA;AACA;AACA;AA2BA;AAEA;AAeA;AAoBA;AAAA,IACYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAA,IAQXE,uBAAuB,GAAAD,OAAA,CAAAC,uBAAA,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MIN_LONG_TASK_THRESHOLD_MS","MAX_LONG_TASK_THRESHOLD_MS","adaptLongTaskThreshold","longTaskThreshold","exports"],"sourceRoot":"../../../src","sources":["utils/longTasksUtils.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,MAAMA,0BAA0B,GAAG,GAAG;;AAEtC;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,
|
|
1
|
+
{"version":3,"names":["MIN_LONG_TASK_THRESHOLD_MS","MAX_LONG_TASK_THRESHOLD_MS","adaptLongTaskThreshold","longTaskThreshold","exports"],"sourceRoot":"../../../src","sources":["utils/longTasksUtils.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,MAAMA,0BAA0B,GAAG,GAAG;;AAEtC;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAIC,iBAAyB,IAAa;EACzE,IAAI,CAACA,iBAAiB,EAAE;IACpB,OAAO,CAAC;EACZ;EACA,IAAIA,iBAAiB,GAAGH,0BAA0B,EAAE;IAChD,OAAOA,0BAA0B;EACrC;EACA,IAAIG,iBAAiB,GAAGF,0BAA0B,EAAE;IAChD,OAAOA,0BAA0B;EACrC;EAEA,OAAOE,iBAAiB;AAC5B,CAAC;AAACC,OAAA,CAAAF,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getGlobalInstance = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
9
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
10
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
11
|
+
*/
|
|
12
|
+
const getGlobalInstance = (key, objectConstructor) => {
|
|
13
|
+
const symbol = Symbol.for(key);
|
|
14
|
+
const g = globalThis;
|
|
15
|
+
if (!(symbol in g)) {
|
|
16
|
+
g[symbol] = objectConstructor();
|
|
17
|
+
}
|
|
18
|
+
return g[symbol];
|
|
19
|
+
};
|
|
20
|
+
exports.getGlobalInstance = getGlobalInstance;
|
|
21
|
+
//# sourceMappingURL=singletonUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getGlobalInstance","key","objectConstructor","symbol","Symbol","for","g","globalThis","exports"],"sourceRoot":"../../../src","sources":["utils/singletonUtils.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAGA,CAC7BC,GAAW,EACXC,iBAA0B,KACtB;EACJ,MAAMC,MAAM,GAAGC,MAAM,CAACC,GAAG,CAACJ,GAAG,CAAC;EAC9B,MAAMK,CAAC,GAAIC,UAAsD;EAEjE,IAAI,EAAEJ,MAAM,IAAIG,CAAC,CAAC,EAAE;IAChBA,CAAC,CAACH,MAAM,CAAC,GAAGD,iBAAiB,CAAC,CAAC;EACnC;EACA,OAAOI,CAAC,CAACH,MAAM,CAAC;AACpB,CAAC;AAACK,OAAA,CAAAR,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,
|
|
1
|
+
{"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DdAttributes","errorSourceType","errorFingerprint","debugId"],"sourceRoot":"../../src","sources":["DdAttributes.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,YAAY,GAAG;EACxB;AACJ;AACA;AACA;AACA;EACIC,eAAe,EAAE,uBAAuB;EAExC;AACJ;AACA;AACA;EACIC,gBAAgB,EAAE,uBAAuB;EAEzC;AACJ;AACA;AACA;AACA;EACIC,OAAO,EAAE;AACb,CAAC","ignoreList":[]}
|
|
@@ -6,23 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
import { version as reactNativeVersion } from 'react-native/package.json';
|
|
8
8
|
import { InteractionManager } from 'react-native';
|
|
9
|
-
import { DdSdkReactNativeConfiguration, InitializationMode, addDefaultValuesToAutoInstrumentationConfiguration, buildConfigurationFromPartialConfiguration, formatFirstPartyHosts } from './DdSdkReactNativeConfiguration';
|
|
10
9
|
import { InternalLog } from './InternalLog';
|
|
11
|
-
import {
|
|
10
|
+
import { FileBasedConfiguration } from './config/FileBasedConfiguration';
|
|
11
|
+
import { addDefaultValuesToAutoInstrumentationConfiguration } from './config/async/AutoInstrumentationConfiguration';
|
|
12
|
+
import { buildConfigurationFromPartialConfiguration } from './config/async/asyncInitializationHelper';
|
|
13
|
+
import { DdSdkNativeConfiguration } from './config/features/CoreConfigurationNative';
|
|
14
|
+
import { CoreConfiguration } from './config/features/CoreConfiguration';
|
|
15
|
+
import { RUM_DEFAULTS } from './config/features/RumConfiguration';
|
|
16
|
+
import { SdkVerbosity } from './config/types/SdkVerbosity';
|
|
17
|
+
import { InitializationMode } from './config/types';
|
|
12
18
|
import { DdLogs } from './logs/DdLogs';
|
|
13
19
|
import { DdRum } from './rum/DdRum';
|
|
14
20
|
import { DdRumErrorTracking } from './rum/instrumentation/DdRumErrorTracking';
|
|
15
21
|
import { DdBabelInteractionTracking } from './rum/instrumentation/interactionTracking/DdBabelInteractionTracking';
|
|
16
22
|
import { DdRumUserInteractionTracking } from './rum/instrumentation/interactionTracking/DdRumUserInteractionTracking';
|
|
17
23
|
import { DdRumResourceTracking } from './rum/instrumentation/resourceTracking/DdRumResourceTracking';
|
|
24
|
+
import { AccountInfoSingleton } from './sdk/AccountInfoSingleton/AccountInfoSingleton';
|
|
18
25
|
import { AttributesSingleton } from './sdk/AttributesSingleton/AttributesSingleton';
|
|
19
26
|
import { registerNativeBridge } from './sdk/DatadogInternalBridge/DdSdkInternalNativeBridge';
|
|
20
27
|
import { BufferSingleton } from './sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
21
|
-
import {
|
|
22
|
-
import { FileBasedConfiguration } from './sdk/FileBasedConfiguration/FileBasedConfiguration';
|
|
28
|
+
import { NativeDdSdk } from './sdk/DdSdkInternal';
|
|
23
29
|
import { GlobalState } from './sdk/GlobalState/GlobalState';
|
|
24
30
|
import { UserInfoSingleton } from './sdk/UserInfoSingleton/UserInfoSingleton';
|
|
25
|
-
import { DdSdkConfiguration } from './types';
|
|
26
31
|
import { adaptLongTaskThreshold } from './utils/longTasksUtils';
|
|
27
32
|
import { version as sdkVersion } from './version';
|
|
28
33
|
|
|
@@ -48,18 +53,18 @@ export class DdSdkReactNative {
|
|
|
48
53
|
DdSdkReactNative.enableFeatures(configuration);
|
|
49
54
|
};
|
|
50
55
|
static initializeNativeSDK = async (configuration, params) => {
|
|
51
|
-
if (GlobalState.
|
|
56
|
+
if (GlobalState.isInitialized) {
|
|
52
57
|
InternalLog.log("Can't initialize Datadog, SDK was already initialized", SdkVerbosity.WARN);
|
|
53
58
|
if (!__DEV__) {
|
|
54
|
-
|
|
59
|
+
NativeDdSdk.telemetryDebug('RN SDK was already initialized in javascript');
|
|
55
60
|
}
|
|
56
61
|
return new Promise(resolve => resolve());
|
|
57
62
|
}
|
|
58
63
|
InternalLog.verbosity = configuration.verbosity;
|
|
59
64
|
registerNativeBridge();
|
|
60
|
-
await
|
|
65
|
+
await NativeDdSdk.initialize(DdSdkReactNative.buildConfiguration(configuration, params));
|
|
61
66
|
InternalLog.log('Datadog SDK was initialized', SdkVerbosity.INFO);
|
|
62
|
-
GlobalState.
|
|
67
|
+
GlobalState.isInitialized = true;
|
|
63
68
|
BufferSingleton.onInitialization();
|
|
64
69
|
};
|
|
65
70
|
|
|
@@ -86,7 +91,7 @@ export class DdSdkReactNative {
|
|
|
86
91
|
});
|
|
87
92
|
}
|
|
88
93
|
// TODO: Remove when DdSdkReactNativeConfiguration is deprecated
|
|
89
|
-
if (configuration instanceof
|
|
94
|
+
if (configuration instanceof CoreConfiguration) {
|
|
90
95
|
return DdSdkReactNative.initializeNativeSDK(configuration, {
|
|
91
96
|
initializationModeForTelemetry: 'SYNC'
|
|
92
97
|
});
|
|
@@ -116,30 +121,48 @@ export class DdSdkReactNative {
|
|
|
116
121
|
});
|
|
117
122
|
};
|
|
118
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Adds a specific attribute to the global context attached with all future Logs, Spans and RUM.
|
|
126
|
+
* @param key: Key that identifies the attribute.
|
|
127
|
+
* @param value: Value linked to the attribute.
|
|
128
|
+
*/
|
|
129
|
+
static addAttribute = async (key, value) => {
|
|
130
|
+
InternalLog.log(`Adding attribute ${JSON.stringify(value)} for key ${key}`, SdkVerbosity.DEBUG);
|
|
131
|
+
await NativeDdSdk.addAttribute(key, {
|
|
132
|
+
value
|
|
133
|
+
});
|
|
134
|
+
AttributesSingleton.getInstance().addAttribute(key, value);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Removes an attribute from the context attached with all future Logs, Spans and RUM events.
|
|
139
|
+
* @param key: They key associated with the attribute to be removed.
|
|
140
|
+
*/
|
|
141
|
+
static removeAttribute = async key => {
|
|
142
|
+
InternalLog.log(`Removing attribute for key ${key}`, SdkVerbosity.DEBUG);
|
|
143
|
+
await NativeDdSdk.removeAttribute(key);
|
|
144
|
+
AttributesSingleton.getInstance().removeAttribute(key);
|
|
145
|
+
};
|
|
146
|
+
|
|
119
147
|
/**
|
|
120
148
|
* Adds a set of attributes to the global context attached with all future Logs, Spans and RUM events.
|
|
121
|
-
* To remove an attribute, set it to `undefined` in a call to `setAttributes`.
|
|
122
149
|
* @param attributes: The global context attributes.
|
|
123
150
|
* @returns a Promise.
|
|
124
151
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
AttributesSingleton.getInstance().setAttributes(attributes);
|
|
152
|
+
static addAttributes = async attributes => {
|
|
153
|
+
InternalLog.log(`Adding attributes ${JSON.stringify(attributes)}`, SdkVerbosity.DEBUG);
|
|
154
|
+
await NativeDdSdk.addAttributes(attributes);
|
|
155
|
+
AttributesSingleton.getInstance().addAttributes(attributes);
|
|
130
156
|
};
|
|
131
157
|
|
|
132
158
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @
|
|
135
|
-
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
136
|
-
* @returns a Promise.
|
|
159
|
+
* Removes a set of attributes from the context attached with all future Logs, Spans and RUM events.
|
|
160
|
+
* @param keys: They keys associated with the attributes to be removed.
|
|
137
161
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
UserInfoSingleton.getInstance().setUserInfo(user);
|
|
162
|
+
static removeAttributes = async keys => {
|
|
163
|
+
InternalLog.log(`Removing attributes for keys ${JSON.stringify(keys)}`, SdkVerbosity.DEBUG);
|
|
164
|
+
await NativeDdSdk.removeAttributes(keys);
|
|
165
|
+
AttributesSingleton.getInstance().removeAttributes(keys);
|
|
143
166
|
};
|
|
144
167
|
|
|
145
168
|
/**
|
|
@@ -152,10 +175,20 @@ export class DdSdkReactNative {
|
|
|
152
175
|
*/
|
|
153
176
|
static setUserInfo = async userInfo => {
|
|
154
177
|
InternalLog.log(`Setting user ${JSON.stringify(userInfo)}`, SdkVerbosity.DEBUG);
|
|
155
|
-
await
|
|
178
|
+
await NativeDdSdk.setUserInfo(userInfo);
|
|
156
179
|
UserInfoSingleton.getInstance().setUserInfo(userInfo);
|
|
157
180
|
};
|
|
158
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Clears the user information.
|
|
184
|
+
* @returns a Promise.
|
|
185
|
+
*/
|
|
186
|
+
static clearUserInfo = async () => {
|
|
187
|
+
InternalLog.log('Clearing user info', SdkVerbosity.DEBUG);
|
|
188
|
+
await NativeDdSdk.clearUserInfo();
|
|
189
|
+
UserInfoSingleton.getInstance().clearUserInfo();
|
|
190
|
+
};
|
|
191
|
+
|
|
159
192
|
/**
|
|
160
193
|
* Set the user information.
|
|
161
194
|
* @param extraUserInfo: The additional information. (To set the id, name or email please user setUserInfo).
|
|
@@ -164,6 +197,10 @@ export class DdSdkReactNative {
|
|
|
164
197
|
static addUserExtraInfo = async extraUserInfo => {
|
|
165
198
|
InternalLog.log(`Adding extra user info ${JSON.stringify(extraUserInfo)}`, SdkVerbosity.DEBUG);
|
|
166
199
|
const userInfo = UserInfoSingleton.getInstance().getUserInfo();
|
|
200
|
+
if (!userInfo) {
|
|
201
|
+
InternalLog.log('Skipped adding User Extra Info: User Info is currently undefined. A user ID must be set before adding extra info. Please call setUserInfo() first.', SdkVerbosity.WARN);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
167
204
|
const updatedUserInfo = {
|
|
168
205
|
...userInfo,
|
|
169
206
|
extraInfo: {
|
|
@@ -171,10 +208,53 @@ export class DdSdkReactNative {
|
|
|
171
208
|
...extraUserInfo
|
|
172
209
|
}
|
|
173
210
|
};
|
|
174
|
-
await
|
|
211
|
+
await NativeDdSdk.addUserExtraInfo(extraUserInfo);
|
|
175
212
|
UserInfoSingleton.getInstance().setUserInfo(updatedUserInfo);
|
|
176
213
|
};
|
|
177
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Sets the account information.
|
|
217
|
+
* @param id: A mandatory unique account identifier (relevant to your business domain).
|
|
218
|
+
* @param name: The account name.
|
|
219
|
+
* @param extraInfo: Additional information.
|
|
220
|
+
* @returns a Promise.
|
|
221
|
+
*/
|
|
222
|
+
static setAccountInfo = async accountInfo => {
|
|
223
|
+
InternalLog.log(`Setting account ${JSON.stringify(accountInfo)}`, SdkVerbosity.DEBUG);
|
|
224
|
+
await NativeDdSdk.setAccountInfo(accountInfo);
|
|
225
|
+
AccountInfoSingleton.getInstance().setAccountInfo(accountInfo);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Clears the account information.
|
|
230
|
+
* @returns a Promise.
|
|
231
|
+
*/
|
|
232
|
+
static clearAccountInfo = async () => {
|
|
233
|
+
InternalLog.log('Clearing account info', SdkVerbosity.DEBUG);
|
|
234
|
+
await NativeDdSdk.clearAccountInfo();
|
|
235
|
+
AccountInfoSingleton.getInstance().clearAccountInfo();
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Set the account information.
|
|
240
|
+
* @param extraAccountInfo: The additional information. (To set the id or name please use setAccountInfo).
|
|
241
|
+
* @returns a Promise.
|
|
242
|
+
*/
|
|
243
|
+
static addAccountExtraInfo = async extraAccountInfo => {
|
|
244
|
+
InternalLog.log(`Adding extra account info ${JSON.stringify(extraAccountInfo)}`, SdkVerbosity.DEBUG);
|
|
245
|
+
const accountInfo = AccountInfoSingleton.getInstance().getAccountInfo();
|
|
246
|
+
if (!accountInfo) {
|
|
247
|
+
InternalLog.log('Skipped adding Account Extra Info: Account Info is currently undefined. An account ID must be set before adding extra info. Please call setAccountInfo() first.', SdkVerbosity.WARN);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const extraInfo = {
|
|
251
|
+
...accountInfo.extraInfo,
|
|
252
|
+
...extraAccountInfo
|
|
253
|
+
};
|
|
254
|
+
await NativeDdSdk.addAccountExtraInfo(extraInfo);
|
|
255
|
+
AccountInfoSingleton.getInstance().addAccountExtraInfo(extraAccountInfo);
|
|
256
|
+
};
|
|
257
|
+
|
|
178
258
|
/**
|
|
179
259
|
* Set the tracking consent regarding the data collection.
|
|
180
260
|
* @param trackingConsent: One of TrackingConsent values.
|
|
@@ -182,7 +262,7 @@ export class DdSdkReactNative {
|
|
|
182
262
|
*/
|
|
183
263
|
static setTrackingConsent = consent => {
|
|
184
264
|
InternalLog.log(`Setting consent ${consent}`, SdkVerbosity.DEBUG);
|
|
185
|
-
return
|
|
265
|
+
return NativeDdSdk.setTrackingConsent(consent);
|
|
186
266
|
};
|
|
187
267
|
|
|
188
268
|
/**
|
|
@@ -191,9 +271,12 @@ export class DdSdkReactNative {
|
|
|
191
271
|
*/
|
|
192
272
|
static clearAllData = () => {
|
|
193
273
|
InternalLog.log('Clearing all data', SdkVerbosity.DEBUG);
|
|
194
|
-
return
|
|
274
|
+
return NativeDdSdk.clearAllData();
|
|
195
275
|
};
|
|
196
276
|
static buildConfiguration = (configuration, params) => {
|
|
277
|
+
if (configuration.additionalConfiguration === undefined) {
|
|
278
|
+
configuration.additionalConfiguration = {};
|
|
279
|
+
}
|
|
197
280
|
configuration.additionalConfiguration[DdSdkReactNative.DD_SOURCE_KEY] = 'react-native';
|
|
198
281
|
configuration.additionalConfiguration[DdSdkReactNative.DD_SDK_VERSION] = sdkVersion;
|
|
199
282
|
if (configuration.version) {
|
|
@@ -207,55 +290,75 @@ export class DdSdkReactNative {
|
|
|
207
290
|
if (reactNativeVersion) {
|
|
208
291
|
configuration.additionalConfiguration[DdSdkReactNative.DD_REACT_NATIVE_VERSION] = `${reactNativeVersion}`;
|
|
209
292
|
}
|
|
210
|
-
|
|
293
|
+
const rumConfiguration = configuration.rumConfiguration;
|
|
294
|
+
if (rumConfiguration) {
|
|
295
|
+
const longTaskThresholdMs = rumConfiguration.longTaskThresholdMs || RUM_DEFAULTS.longTaskThresholdMs;
|
|
296
|
+
rumConfiguration.longTaskThresholdMs = adaptLongTaskThreshold(longTaskThresholdMs);
|
|
297
|
+
const nativeLongTaskThresholdMs = configuration.rumConfiguration?.nativeLongTaskThresholdMs ?? RUM_DEFAULTS.nativeLongTaskThresholdMs;
|
|
298
|
+
rumConfiguration.nativeLongTaskThresholdMs = adaptLongTaskThreshold(nativeLongTaskThresholdMs);
|
|
299
|
+
}
|
|
300
|
+
const trackInteractions = configuration.rumConfiguration?.trackInteractions || RUM_DEFAULTS.trackInteractions;
|
|
301
|
+
const trackResources = configuration.rumConfiguration?.trackResources || RUM_DEFAULTS.trackResources;
|
|
302
|
+
const trackErrors = configuration.rumConfiguration?.trackErrors || RUM_DEFAULTS.trackErrors;
|
|
303
|
+
return new DdSdkNativeConfiguration(configuration.additionalConfiguration, configuration.clientToken, configuration.env, configuration.site, configuration.service, configuration.verbosity, configuration.trackingConsent, configuration.uploadFrequency, configuration.batchSize, configuration.batchProcessingLevel, configuration.proxyConfiguration, configuration.attributeEncoders, rumConfiguration, configuration.logsConfiguration, configuration.traceConfiguration, {
|
|
211
304
|
initializationType: params.initializationModeForTelemetry,
|
|
212
|
-
trackErrors
|
|
213
|
-
trackInteractions
|
|
214
|
-
trackNetworkRequests:
|
|
305
|
+
trackErrors,
|
|
306
|
+
trackInteractions,
|
|
307
|
+
trackNetworkRequests: trackResources,
|
|
215
308
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
216
309
|
reactNativeVersion: require('react-native/package.json').version,
|
|
217
310
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
218
311
|
reactVersion: require('react/package.json').version
|
|
219
|
-
}
|
|
312
|
+
});
|
|
220
313
|
};
|
|
221
314
|
static enableFeatures(configuration) {
|
|
315
|
+
const firstPartyHosts = configuration.rumConfiguration?.firstPartyHosts || RUM_DEFAULTS.getFirstPartyHosts();
|
|
316
|
+
const trackInteractions = configuration.rumConfiguration?.trackInteractions || RUM_DEFAULTS.trackInteractions;
|
|
317
|
+
const trackResources = configuration.rumConfiguration?.trackResources || RUM_DEFAULTS.trackResources;
|
|
318
|
+
const trackErrors = configuration.rumConfiguration?.trackErrors || RUM_DEFAULTS.trackErrors;
|
|
319
|
+
const actionNameAttribute = configuration.rumConfiguration?.actionNameAttribute;
|
|
320
|
+
const resourceTraceSampleRate = configuration.rumConfiguration?.resourceTraceSampleRate || RUM_DEFAULTS.resourceTraceSampleRate;
|
|
321
|
+
const logEventMapper = configuration.logsConfiguration?.logEventMapper;
|
|
322
|
+
const errorEventMapper = configuration.rumConfiguration?.errorEventMapper;
|
|
323
|
+
const resourceEventMapper = configuration.rumConfiguration?.resourceEventMapper;
|
|
324
|
+
const actionEventMapper = configuration.rumConfiguration?.actionEventMapper;
|
|
222
325
|
if (globalThis.__DD_RN_BABEL_PLUGIN_ENABLED__) {
|
|
223
326
|
DdBabelInteractionTracking.config = {
|
|
224
|
-
trackInteractions
|
|
225
|
-
useAccessibilityLabel: configuration.useAccessibilityLabel
|
|
327
|
+
trackInteractions,
|
|
328
|
+
useAccessibilityLabel: configuration.rumConfiguration?.useAccessibilityLabel || RUM_DEFAULTS.useAccessibilityLabel
|
|
226
329
|
};
|
|
227
|
-
DdBabelInteractionTracking.
|
|
330
|
+
DdBabelInteractionTracking.attachRumInstance(DdRum);
|
|
228
331
|
}
|
|
229
332
|
if (DdSdkReactNative.wasAutoInstrumented) {
|
|
230
333
|
InternalLog.log("Can't auto instrument Datadog, SDK was already instrumented", SdkVerbosity.WARN);
|
|
231
334
|
return;
|
|
232
335
|
}
|
|
233
|
-
if (
|
|
336
|
+
if (trackInteractions && !globalThis.__DD_RN_BABEL_PLUGIN_ENABLED__) {
|
|
234
337
|
DdRumUserInteractionTracking.startTracking({
|
|
235
|
-
actionNameAttribute
|
|
236
|
-
useAccessibilityLabel: configuration.useAccessibilityLabel
|
|
338
|
+
actionNameAttribute,
|
|
339
|
+
useAccessibilityLabel: configuration.rumConfiguration?.useAccessibilityLabel
|
|
237
340
|
});
|
|
238
341
|
}
|
|
239
|
-
if (
|
|
342
|
+
if (trackResources) {
|
|
240
343
|
DdRumResourceTracking.startTracking({
|
|
241
|
-
|
|
242
|
-
firstPartyHosts
|
|
344
|
+
resourceTraceSampleRate,
|
|
345
|
+
firstPartyHosts
|
|
243
346
|
});
|
|
244
347
|
}
|
|
245
|
-
if (
|
|
348
|
+
if (trackErrors) {
|
|
246
349
|
DdRumErrorTracking.startTracking();
|
|
247
350
|
}
|
|
248
|
-
if (
|
|
249
|
-
DdLogs.registerLogEventMapper(
|
|
351
|
+
if (logEventMapper) {
|
|
352
|
+
DdLogs.registerLogEventMapper(logEventMapper);
|
|
250
353
|
}
|
|
251
|
-
if (
|
|
252
|
-
DdRum.registerErrorEventMapper(
|
|
354
|
+
if (errorEventMapper) {
|
|
355
|
+
DdRum.registerErrorEventMapper(errorEventMapper);
|
|
253
356
|
}
|
|
254
|
-
if (
|
|
255
|
-
DdRum.registerResourceEventMapper(
|
|
357
|
+
if (resourceEventMapper) {
|
|
358
|
+
DdRum.registerResourceEventMapper(resourceEventMapper);
|
|
256
359
|
}
|
|
257
|
-
if (
|
|
258
|
-
DdRum.registerActionEventMapper(
|
|
360
|
+
if (actionEventMapper) {
|
|
361
|
+
DdRum.registerActionEventMapper(actionEventMapper);
|
|
259
362
|
}
|
|
260
363
|
DdSdkReactNative.wasAutoInstrumented = true;
|
|
261
364
|
}
|