@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
|
@@ -19,14 +19,14 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
20
|
|
|
21
21
|
# /!\ Remember to keep the versions in sync with DatadogSDKReactNativeSessionReplay.podspec
|
|
22
|
-
s.dependency 'DatadogCore', '
|
|
23
|
-
s.dependency 'DatadogLogs', '
|
|
24
|
-
s.dependency 'DatadogTrace', '
|
|
25
|
-
s.dependency 'DatadogRUM', '
|
|
26
|
-
s.dependency 'DatadogCrashReporting', '
|
|
22
|
+
s.dependency 'DatadogCore', '3.4.0'
|
|
23
|
+
s.dependency 'DatadogLogs', '3.4.0'
|
|
24
|
+
s.dependency 'DatadogTrace', '3.4.0'
|
|
25
|
+
s.dependency 'DatadogRUM', '3.4.0'
|
|
26
|
+
s.dependency 'DatadogCrashReporting', '3.4.0'
|
|
27
27
|
|
|
28
28
|
# DatadogWebViewTracking is not available for tvOS
|
|
29
|
-
s.ios.dependency 'DatadogWebViewTracking', '
|
|
29
|
+
s.ios.dependency 'DatadogWebViewTracking', '3.4.0'
|
|
30
30
|
|
|
31
31
|
s.test_spec 'Tests' do |test_spec|
|
|
32
32
|
test_spec.source_files = 'ios/Tests/**/*.{swift,json}'
|
package/README.md
CHANGED
|
@@ -41,23 +41,33 @@ import {
|
|
|
41
41
|
const datadogConfiguration = new DatadogProviderConfiguration(
|
|
42
42
|
'<CLIENT_TOKEN>',
|
|
43
43
|
'<ENVIRONMENT_NAME>',
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
TrackingConsent.GRANTED,
|
|
45
|
+
{
|
|
46
|
+
rumConfiguration: {
|
|
47
|
+
applicationId: '<RUM_APPLICATION_ID>',
|
|
48
|
+
trackInteractions: true, // track User interactions (e.g.: Tap on buttons. You can use 'accessibilityLabel' element property to give tap action the name, otherwise element type will be reported)
|
|
49
|
+
trackResources: true, // track XHR Resources
|
|
50
|
+
trackFrustrations: true, // track Frustrations
|
|
51
|
+
trackErrors: true, // track errors
|
|
52
|
+
nativeCrashReportEnabled: true, // Optional: enable or disable native crash reports
|
|
53
|
+
sessionSampleRate: 80, // Optional: sample RUM sessions (here, 80% of session will be sent to Datadog. Default = 100%)
|
|
54
|
+
resourceTracingSamplingRate: 80, // Optional: sample tracing integrations for network calls between your app and your backend (here, 80% of calls to your instrumented backend will be linked from the RUM view to the APM view. Default = 20%)
|
|
55
|
+
// You need to specify the hosts of your backends to enable tracing with these backends
|
|
56
|
+
firstPartyHosts: ['example.com'], // matches 'example.com' and subdomains like 'api.example.com'
|
|
57
|
+
},
|
|
58
|
+
logsConfiguration: {
|
|
59
|
+
logEventMapper: (logEvent) => {
|
|
60
|
+
logEvent.message = `[CUSTOM] ${logEvent.message}`;
|
|
61
|
+
return logEvent;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
traceConfiguration: {}
|
|
65
|
+
}
|
|
48
66
|
);
|
|
49
67
|
// Optional: Select your Datadog website (one of "US1", "US3", "US5", "EU1", "AP1", "AP2", or "US1_FED"). Default is "US1".
|
|
50
68
|
datadogConfiguration.site = 'US1';
|
|
51
|
-
// Optional: enable or disable native crash reports
|
|
52
|
-
datadogConfiguration.nativeCrashReportEnabled = true;
|
|
53
|
-
// Optional: sample RUM sessions (here, 80% of session will be sent to Datadog. Default = 100%)
|
|
54
|
-
datadogConfiguration.sessionSamplingRate = 80;
|
|
55
|
-
// Optional: sample tracing integrations for network calls between your app and your backend (here, 80% of calls to your instrumented backend will be linked from the RUM view to the APM view. Default = 20%)
|
|
56
|
-
// You need to specify the hosts of your backends to enable tracing with these backends
|
|
57
|
-
datadogConfiguration.resourceTracingSamplingRate = 80;
|
|
58
|
-
datadogConfiguration.firstPartyHosts = ['example.com']; // matches 'example.com' and subdomains like 'api.example.com'
|
|
59
69
|
// Optional: set the reported service name (by default, it'll use the package name / bundleIdentifier of your Android / iOS app respectively)
|
|
60
|
-
datadogConfiguration.
|
|
70
|
+
datadogConfiguration.service = 'com.example.reactnative';
|
|
61
71
|
// Optional: let the SDK print internal logs (above or equal to the provided level. Default = undefined (meaning no logs))
|
|
62
72
|
datadogConfiguration.verbosity = SdkVerbosity.WARN;
|
|
63
73
|
|
package/android/build.gradle
CHANGED
|
@@ -195,22 +195,21 @@ dependencies {
|
|
|
195
195
|
}
|
|
196
196
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
197
197
|
compileOnly "com.squareup.okhttp3:okhttp:3.12.13"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
implementation("com.datadoghq:dd-sdk-android-rum:2.26.2") {
|
|
198
|
+
// dd-sdk-android-rum requires androidx.metrics:metrics-performance.
|
|
199
|
+
// From 2.21.0, it uses 1.0.0-beta02, which requires Gradle 8.6.0.
|
|
200
|
+
// This breaks builds if the React Native target is below 0.76.0. as it relies on Gradle 8.5.0.
|
|
201
|
+
// To avoid this, we enforce 1.0.0-beta01 on RN < 0.76.0
|
|
202
|
+
if (reactNativeMinorVersion < 76) {
|
|
203
|
+
implementation("com.datadoghq:dd-sdk-android-rum:3.4.0") {
|
|
205
204
|
exclude group: "androidx.metrics", module: "metrics-performance"
|
|
206
205
|
}
|
|
207
206
|
implementation "androidx.metrics:metrics-performance:1.0.0-beta01"
|
|
208
207
|
} else {
|
|
209
|
-
implementation "com.datadoghq:dd-sdk-android-rum:
|
|
208
|
+
implementation "com.datadoghq:dd-sdk-android-rum:3.4.0"
|
|
210
209
|
}
|
|
211
|
-
implementation "com.datadoghq:dd-sdk-android-logs:
|
|
212
|
-
implementation "com.datadoghq:dd-sdk-android-trace:
|
|
213
|
-
implementation "com.datadoghq:dd-sdk-android-webview:
|
|
210
|
+
implementation "com.datadoghq:dd-sdk-android-logs:3.4.0"
|
|
211
|
+
implementation "com.datadoghq:dd-sdk-android-trace:3.4.0"
|
|
212
|
+
implementation "com.datadoghq:dd-sdk-android-webview:3.4.0"
|
|
214
213
|
implementation "com.google.code.gson:gson:2.10.0"
|
|
215
214
|
testImplementation "org.junit.platform:junit-platform-launcher:1.6.2"
|
|
216
215
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.2"
|
|
@@ -8,23 +8,14 @@
|
|
|
8
8
|
package com.datadog.reactnative
|
|
9
9
|
|
|
10
10
|
import android.content.Context
|
|
11
|
-
import android.util.Log
|
|
12
11
|
import com.datadog.android.Datadog
|
|
13
|
-
import com.datadog.android._InternalProxy
|
|
14
12
|
import com.datadog.android.api.InternalLogger
|
|
15
|
-
import com.datadog.android.api.SdkCore
|
|
16
13
|
import com.datadog.android.api.feature.FeatureSdkCore
|
|
17
14
|
import com.datadog.android.core.InternalSdkCore
|
|
18
15
|
import com.datadog.android.core.configuration.Configuration
|
|
19
|
-
import com.datadog.android.log.Logs
|
|
20
|
-
import com.datadog.android.log.LogsConfiguration
|
|
21
16
|
import com.datadog.android.privacy.TrackingConsent
|
|
22
17
|
import com.datadog.android.rum.GlobalRumMonitor
|
|
23
|
-
import com.datadog.android.rum.Rum
|
|
24
|
-
import com.datadog.android.rum.RumConfiguration
|
|
25
18
|
import com.datadog.android.rum.RumMonitor
|
|
26
|
-
import com.datadog.android.trace.Trace
|
|
27
|
-
import com.datadog.android.trace.TraceConfiguration
|
|
28
19
|
import com.datadog.android.webview.WebViewTracking
|
|
29
20
|
import com.facebook.react.bridge.ReadableMap
|
|
30
21
|
|
|
@@ -50,50 +41,18 @@ object DatadogSDKWrapperStorage {
|
|
|
50
41
|
listener(ddCore)
|
|
51
42
|
}
|
|
52
43
|
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Sets instance of core SDK to be used to initialize features.
|
|
56
|
-
*/
|
|
57
|
-
fun setSdkCore(core: InternalSdkCore?) {
|
|
58
|
-
this.core = core
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Returns the core set by setSdkCore or the default core instance by default.
|
|
63
|
-
*/
|
|
64
|
-
fun getSdkCore(): SdkCore {
|
|
65
|
-
core?.let {
|
|
66
|
-
return it
|
|
67
|
-
}
|
|
68
|
-
Log.d(
|
|
69
|
-
DatadogSDKWrapperStorage::class.java.canonicalName,
|
|
70
|
-
"SdkCore was not set in DatadogSDKWrapperStorage, using default instance."
|
|
71
|
-
)
|
|
72
|
-
return Datadog.getInstance()
|
|
73
|
-
}
|
|
74
44
|
}
|
|
75
45
|
|
|
76
46
|
internal class DatadogSDKWrapper : DatadogWrapper {
|
|
77
47
|
override var bundleLogsWithRum = DefaultConfiguration.bundleLogsWithRum
|
|
78
48
|
override var bundleLogsWithTraces = DefaultConfiguration.bundleLogsWithTraces
|
|
79
49
|
|
|
80
|
-
// We use Kotlin backing field here to initialize once the telemetry proxy
|
|
81
|
-
// and make sure it is only after SDK is initialized.
|
|
82
|
-
private var telemetryProxy: _InternalProxy._TelemetryProxy? = null
|
|
83
|
-
get() {
|
|
84
|
-
if (field == null && isInitialized()) {
|
|
85
|
-
field = Datadog._internalProxy()._telemetry
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return field
|
|
89
|
-
}
|
|
90
|
-
|
|
91
50
|
// We use Kotlin backing field here to initialize once the telemetry proxy
|
|
92
51
|
// and make sure it is only after SDK is initialized.
|
|
93
52
|
private var webViewProxy: WebViewTracking._InternalWebViewProxy? = null
|
|
94
53
|
get() {
|
|
95
54
|
if (field == null && isInitialized()) {
|
|
96
|
-
field = WebViewTracking._InternalWebViewProxy(
|
|
55
|
+
field = WebViewTracking._InternalWebViewProxy(Datadog.getInstance())
|
|
97
56
|
}
|
|
98
57
|
|
|
99
58
|
return field
|
|
@@ -109,30 +68,7 @@ internal class DatadogSDKWrapper : DatadogWrapper {
|
|
|
109
68
|
consent: TrackingConsent
|
|
110
69
|
) {
|
|
111
70
|
val core = Datadog.initialize(context, configuration, consent)
|
|
112
|
-
DatadogSDKWrapperStorage.
|
|
113
|
-
DatadogSDKWrapperStorage.notifyOnInitializedListeners(core)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
override fun enableRum(configuration: RumConfiguration) {
|
|
117
|
-
Rum.enable(configuration, DatadogSDKWrapperStorage.getSdkCore())
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
override fun enableLogs(configuration: LogsConfiguration) {
|
|
121
|
-
Logs.enable(configuration, DatadogSDKWrapperStorage.getSdkCore())
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
override fun enableTrace(configuration: TraceConfiguration) {
|
|
125
|
-
Trace.enable(configuration, DatadogSDKWrapperStorage.getSdkCore())
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
@Deprecated("Use setUserInfo instead; the user ID is now required.")
|
|
129
|
-
override fun setUser(
|
|
130
|
-
id: String?,
|
|
131
|
-
name: String?,
|
|
132
|
-
email: String?,
|
|
133
|
-
extraInfo: Map<String, Any?>
|
|
134
|
-
) {
|
|
135
|
-
Datadog.setUserInfo(id, name, email, extraInfo)
|
|
71
|
+
DatadogSDKWrapperStorage.notifyOnInitializedListeners(core as InternalSdkCore)
|
|
136
72
|
}
|
|
137
73
|
|
|
138
74
|
override fun setUserInfo(
|
|
@@ -150,43 +86,50 @@ internal class DatadogSDKWrapper : DatadogWrapper {
|
|
|
150
86
|
Datadog.addUserProperties(extraInfo)
|
|
151
87
|
}
|
|
152
88
|
|
|
153
|
-
override fun
|
|
154
|
-
|
|
155
|
-
for (attribute in attributes) {
|
|
156
|
-
rumMonitor.addAttribute(attribute.key, attribute.value)
|
|
157
|
-
}
|
|
89
|
+
override fun clearUserInfo() {
|
|
90
|
+
Datadog.clearUserInfo()
|
|
158
91
|
}
|
|
159
92
|
|
|
160
|
-
override fun
|
|
161
|
-
|
|
93
|
+
override fun setAccountInfo(
|
|
94
|
+
id: String,
|
|
95
|
+
name: String?,
|
|
96
|
+
extraInfo: Map<String, Any?>
|
|
97
|
+
) {
|
|
98
|
+
Datadog.setAccountInfo(id, name, extraInfo)
|
|
162
99
|
}
|
|
163
100
|
|
|
164
|
-
override fun
|
|
165
|
-
|
|
166
|
-
|
|
101
|
+
override fun addAccountExtraInfo(
|
|
102
|
+
extraInfo: Map<String, Any?>
|
|
103
|
+
) {
|
|
104
|
+
Datadog.addAccountExtraInfo(extraInfo)
|
|
105
|
+
}
|
|
167
106
|
|
|
168
|
-
|
|
169
|
-
|
|
107
|
+
override fun clearAccountInfo() {
|
|
108
|
+
Datadog.clearAccountInfo()
|
|
109
|
+
}
|
|
170
110
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
target = InternalLogger.Target.TELEMETRY,
|
|
174
|
-
messageBuilder = { message },
|
|
175
|
-
onlyOnce = (telemetryConfig["onlyOnce"] as? Boolean) ?: true,
|
|
176
|
-
additionalProperties = additionalProperties
|
|
177
|
-
)
|
|
111
|
+
override fun addRumGlobalAttribute(key: String, value: Any?) {
|
|
112
|
+
this.getRumMonitor().addAttribute(key, value)
|
|
178
113
|
}
|
|
179
114
|
|
|
180
|
-
override fun
|
|
181
|
-
|
|
115
|
+
override fun removeRumGlobalAttribute(key: String) {
|
|
116
|
+
this.getRumMonitor().removeAttribute(key)
|
|
182
117
|
}
|
|
183
118
|
|
|
184
|
-
override fun
|
|
185
|
-
|
|
119
|
+
override fun addRumGlobalAttributes(attributes: Map<String, Any?>) {
|
|
120
|
+
for (attribute in attributes) {
|
|
121
|
+
this.addRumGlobalAttribute(attribute.key, attribute.value)
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
override fun removeRumGlobalAttributes(keys: Array<String>) {
|
|
126
|
+
for (key in keys) {
|
|
127
|
+
this.removeRumGlobalAttribute(key)
|
|
128
|
+
}
|
|
186
129
|
}
|
|
187
130
|
|
|
188
|
-
override fun
|
|
189
|
-
|
|
131
|
+
override fun setTrackingConsent(trackingConsent: TrackingConsent) {
|
|
132
|
+
Datadog.setTrackingConsent(trackingConsent)
|
|
190
133
|
}
|
|
191
134
|
|
|
192
135
|
override fun consumeWebviewEvent(message: String) {
|
|
@@ -198,11 +141,11 @@ internal class DatadogSDKWrapper : DatadogWrapper {
|
|
|
198
141
|
}
|
|
199
142
|
|
|
200
143
|
override fun getRumMonitor(): RumMonitor {
|
|
201
|
-
return GlobalRumMonitor.get(
|
|
144
|
+
return GlobalRumMonitor.get(Datadog.getInstance())
|
|
202
145
|
}
|
|
203
146
|
|
|
204
147
|
override fun clearAllData() {
|
|
205
|
-
return Datadog.clearAllData(
|
|
148
|
+
return Datadog.clearAllData(Datadog.getInstance())
|
|
206
149
|
}
|
|
207
150
|
}
|
|
208
151
|
|
|
@@ -18,7 +18,7 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
18
18
|
import java.lang.IllegalArgumentException
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Wrapper around [Datadog].
|
|
21
|
+
* Wrapper around [com.datadog.android.Datadog].
|
|
22
22
|
*/
|
|
23
23
|
@Suppress("ComplexInterface", "TooManyFunctions")
|
|
24
24
|
interface DatadogWrapper {
|
|
@@ -49,10 +49,8 @@ interface DatadogWrapper {
|
|
|
49
49
|
/**
|
|
50
50
|
* Initializes the Datadog SDK.
|
|
51
51
|
* @param context your application context
|
|
52
|
-
* @param credentials your organization credentials
|
|
53
52
|
* @param configuration the configuration for the SDK library
|
|
54
|
-
* @param
|
|
55
|
-
* @see [Credentials]
|
|
53
|
+
* @param consent as the initial state of the tracking consent flag.
|
|
56
54
|
* @see [Configuration]
|
|
57
55
|
* @see [TrackingConsent]
|
|
58
56
|
* @throws IllegalArgumentException if the env name is using illegal characters and your
|
|
@@ -64,45 +62,17 @@ interface DatadogWrapper {
|
|
|
64
62
|
consent: TrackingConsent
|
|
65
63
|
)
|
|
66
64
|
|
|
67
|
-
/**
|
|
68
|
-
* Enables the RUM feature of the SDK.
|
|
69
|
-
*
|
|
70
|
-
* @param configuration the configuration for the RUM feature
|
|
71
|
-
*/
|
|
72
|
-
fun enableRum(
|
|
73
|
-
configuration: RumConfiguration
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Enables the Logs feature of the SDK.
|
|
78
|
-
*
|
|
79
|
-
* @param configuration the configuration for the Logs feature
|
|
80
|
-
*/
|
|
81
|
-
fun enableLogs(
|
|
82
|
-
configuration: LogsConfiguration
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Enables the Trace feature of the SDK.
|
|
87
|
-
*
|
|
88
|
-
* @param configuration the configuration for the Trace feature
|
|
89
|
-
*/
|
|
90
|
-
fun enableTrace(
|
|
91
|
-
configuration: TraceConfiguration
|
|
92
|
-
)
|
|
93
|
-
|
|
94
65
|
/**
|
|
95
66
|
* Sets the user information.
|
|
96
67
|
*
|
|
97
|
-
* @param id
|
|
68
|
+
* @param id a unique user identifier (relevant to your business domain)
|
|
98
69
|
* @param name (nullable) the user name or alias
|
|
99
70
|
* @param email (nullable) the user email
|
|
100
71
|
* @param extraInfo additional information. An extra information can be
|
|
101
72
|
* nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK.
|
|
102
73
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
id: String?,
|
|
74
|
+
fun setUserInfo(
|
|
75
|
+
id: String,
|
|
106
76
|
name: String?,
|
|
107
77
|
email: String?,
|
|
108
78
|
extraInfo: Map<String, Any?>
|
|
@@ -110,60 +80,77 @@ interface DatadogWrapper {
|
|
|
110
80
|
|
|
111
81
|
/**
|
|
112
82
|
* Sets the user information.
|
|
83
|
+
* @param extraInfo: The additional information. (To set the id, name or email please user setUserInfo).
|
|
84
|
+
*/
|
|
85
|
+
fun addUserExtraInfo(
|
|
86
|
+
extraInfo: Map<String, Any?>
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Clears the user information.
|
|
91
|
+
*/
|
|
92
|
+
fun clearUserInfo()
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Sets the account information.
|
|
113
96
|
*
|
|
114
|
-
* @param id a unique
|
|
115
|
-
* @param name (nullable) the
|
|
116
|
-
* @param email (nullable) the user email
|
|
97
|
+
* @param id a unique account identifier (relevant to your business domain)
|
|
98
|
+
* @param name (nullable) the account name
|
|
117
99
|
* @param extraInfo additional information. An extra information can be
|
|
118
100
|
* nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK.
|
|
119
101
|
*/
|
|
120
|
-
fun
|
|
102
|
+
fun setAccountInfo(
|
|
121
103
|
id: String,
|
|
122
104
|
name: String?,
|
|
123
|
-
email: String?,
|
|
124
105
|
extraInfo: Map<String, Any?>
|
|
125
106
|
)
|
|
126
107
|
|
|
127
108
|
/**
|
|
128
|
-
* Sets the
|
|
129
|
-
* @param
|
|
109
|
+
* Sets the account information.
|
|
110
|
+
* @param extraInfo: The additional information. (To set the id or name please use setAccountInfo).
|
|
130
111
|
*/
|
|
131
|
-
fun
|
|
112
|
+
fun addAccountExtraInfo(
|
|
132
113
|
extraInfo: Map<String, Any?>
|
|
133
114
|
)
|
|
134
115
|
|
|
135
116
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* @param attributes Attributes to add
|
|
117
|
+
* Clears the account information.
|
|
139
118
|
*/
|
|
140
|
-
fun
|
|
119
|
+
fun clearAccountInfo()
|
|
141
120
|
|
|
142
|
-
/**
|
|
143
|
-
* Sets tracking consent.
|
|
144
|
-
*/
|
|
145
|
-
fun setTrackingConsent(trackingConsent: TrackingConsent)
|
|
146
121
|
|
|
122
|
+
/** Adds a global attribute.
|
|
123
|
+
*
|
|
124
|
+
* @param key: Key that identifies the attribute.
|
|
125
|
+
* @param value: Value linked to the attribute.
|
|
126
|
+
*/
|
|
127
|
+
fun addRumGlobalAttribute(key: String, value: Any?)
|
|
147
128
|
|
|
148
129
|
/**
|
|
149
|
-
*
|
|
130
|
+
* Removes a global attribute.
|
|
131
|
+
*
|
|
132
|
+
* @param key: Key that identifies the attribute.
|
|
150
133
|
*/
|
|
151
|
-
fun
|
|
134
|
+
fun removeRumGlobalAttribute(key: String)
|
|
152
135
|
|
|
153
136
|
/**
|
|
154
|
-
*
|
|
137
|
+
* Adds global attributes.
|
|
138
|
+
*
|
|
139
|
+
* @param attributes Attributes to add
|
|
155
140
|
*/
|
|
156
|
-
fun
|
|
141
|
+
fun addRumGlobalAttributes(attributes: Map<String, Any?>)
|
|
157
142
|
|
|
158
143
|
/**
|
|
159
|
-
*
|
|
144
|
+
* Removes global attributes.
|
|
145
|
+
*
|
|
146
|
+
* @param keys Keys linked to the attributes to be removed
|
|
160
147
|
*/
|
|
161
|
-
fun
|
|
148
|
+
fun removeRumGlobalAttributes(keys: Array<String>)
|
|
162
149
|
|
|
163
150
|
/**
|
|
164
|
-
*
|
|
151
|
+
* Sets tracking consent.
|
|
165
152
|
*/
|
|
166
|
-
fun
|
|
153
|
+
fun setTrackingConsent(trackingConsent: TrackingConsent)
|
|
167
154
|
|
|
168
155
|
/**
|
|
169
156
|
* Sends Webview events.
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
package com.datadog.reactnative
|
|
8
8
|
|
|
9
9
|
import android.util.Log as AndroidLog
|
|
10
|
+
import com.datadog.android.Datadog
|
|
10
11
|
import com.datadog.android.log.Logger
|
|
11
12
|
import com.facebook.react.bridge.Promise
|
|
12
13
|
import com.facebook.react.bridge.ReadableMap
|
|
@@ -22,7 +23,7 @@ class DdLogsImplementation(
|
|
|
22
23
|
val bundleLogsWithRum = datadog.bundleLogsWithRum
|
|
23
24
|
val bundleLogsWithTraces = datadog.bundleLogsWithTraces
|
|
24
25
|
|
|
25
|
-
logger ?: Logger.Builder(
|
|
26
|
+
logger ?: Logger.Builder(Datadog.getInstance())
|
|
26
27
|
.setLogcatLogsEnabled(true)
|
|
27
28
|
.setBundleWithRumEnabled(bundleLogsWithRum)
|
|
28
29
|
.setBundleWithTraceEnabled(bundleLogsWithTraces)
|
|
@@ -12,7 +12,9 @@ import com.datadog.android.rum.RumAttributes
|
|
|
12
12
|
import com.datadog.android.rum.RumErrorSource
|
|
13
13
|
import com.datadog.android.rum.RumResourceKind
|
|
14
14
|
import com.datadog.android.rum.RumResourceMethod
|
|
15
|
+
import com.datadog.android.rum.featureoperations.FailureReason
|
|
15
16
|
import com.facebook.react.bridge.Promise
|
|
17
|
+
import com.facebook.react.bridge.ReadableArray
|
|
16
18
|
import com.facebook.react.bridge.ReadableMap
|
|
17
19
|
import java.util.Locale
|
|
18
20
|
|
|
@@ -248,6 +250,49 @@ class DdRumImplementation(private val datadog: DatadogWrapper = DatadogSDKWrappe
|
|
|
248
250
|
promise.resolve(null)
|
|
249
251
|
}
|
|
250
252
|
|
|
253
|
+
/**
|
|
254
|
+
* Adds a custom attribute to the active RUM View. It will be propagated to all future RUM events associated with the active View.
|
|
255
|
+
* @param key: key for this view attribute.
|
|
256
|
+
* @param value: value for this attribute.
|
|
257
|
+
*/
|
|
258
|
+
fun addViewAttribute(key: String, value: ReadableMap, promise: Promise) {
|
|
259
|
+
val attributeValue = value.toMap()["value"]
|
|
260
|
+
val attributes = mutableMapOf<String, Any?>()
|
|
261
|
+
attributes[key] = attributeValue
|
|
262
|
+
datadog.getRumMonitor().addViewAttributes(attributes)
|
|
263
|
+
promise.resolve(null)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Removes an attribute from the active RUM View.
|
|
268
|
+
* @param key: key for the attribute to be removed from the view.
|
|
269
|
+
*/
|
|
270
|
+
fun removeViewAttribute(key: String, promise: Promise) {
|
|
271
|
+
val keysToDelete: Collection<String> = listOf(key)
|
|
272
|
+
datadog.getRumMonitor().removeViewAttributes(keysToDelete)
|
|
273
|
+
promise.resolve(null)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Adds multiple attributes to the active RUM View. They will be propagated to all future RUM events associated with the active View.
|
|
278
|
+
* @param attributes: key/value object containing all attributes to be added to the view.
|
|
279
|
+
*/
|
|
280
|
+
fun addViewAttributes(attributes: ReadableMap, promise: Promise) {
|
|
281
|
+
datadog.getRumMonitor().addViewAttributes(attributes.toMap())
|
|
282
|
+
promise.resolve(null)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Removes multiple attributes from the active RUM View.
|
|
287
|
+
* @param keys: keys for the attributes to be removed from the view.
|
|
288
|
+
*/
|
|
289
|
+
fun removeViewAttributes(keys: ReadableArray, promise: Promise) {
|
|
290
|
+
val keysToDelete = (0 until keys.size())
|
|
291
|
+
.mapNotNull { keys.getString(it) }
|
|
292
|
+
datadog.getRumMonitor().removeViewAttributes(keysToDelete)
|
|
293
|
+
promise.resolve(null)
|
|
294
|
+
}
|
|
295
|
+
|
|
251
296
|
/**
|
|
252
297
|
* Adds the loading time of the view to the active view.
|
|
253
298
|
* It is calculated as the difference between the current time and the start time of the view.
|
|
@@ -289,6 +334,59 @@ class DdRumImplementation(private val datadog: DatadogWrapper = DatadogSDKWrappe
|
|
|
289
334
|
}
|
|
290
335
|
}
|
|
291
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Starts a Feature Operation.
|
|
339
|
+
*
|
|
340
|
+
* @param name Human-readable operation name (e.g., "login_flow").
|
|
341
|
+
* @param operationKey Optional key that uniquely identifies this operation instance.
|
|
342
|
+
* @param attributes Additional attributes to attach to the operation.
|
|
343
|
+
* @param promise Resolved with `null` when the call completes.
|
|
344
|
+
*/
|
|
345
|
+
fun startFeatureOperation(name: String, operationKey: String? = null, attributes: ReadableMap, promise: Promise) {
|
|
346
|
+
val attributesMap = attributes.toHashMap().toMutableMap()
|
|
347
|
+
datadog.getRumMonitor().startFeatureOperation(name, operationKey, attributesMap);
|
|
348
|
+
promise.resolve(null)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Marks a Feature Operation as successfully completed.
|
|
353
|
+
*
|
|
354
|
+
* @param name The name of the feature operation (for example, `"login_flow"`).
|
|
355
|
+
* @param operationKey The key of the operation instance to complete, if one was provided when starting it.
|
|
356
|
+
* @param attributes A map of custom attributes to attach to this completion event.
|
|
357
|
+
*/
|
|
358
|
+
fun succeedFeatureOperation(name: String, operationKey: String? = null, attributes: ReadableMap, promise: Promise) {
|
|
359
|
+
val attributesMap = attributes.toHashMap().toMutableMap()
|
|
360
|
+
datadog.getRumMonitor().succeedFeatureOperation(name, operationKey, attributesMap)
|
|
361
|
+
promise.resolve(null)
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Marks a Feature Operation as failed.
|
|
367
|
+
*
|
|
368
|
+
* @param name The name of the feature operation (for example, `"login_flow"`).
|
|
369
|
+
* @param operationKey The key of the operation instance to fail, if one was provided when starting it.
|
|
370
|
+
* @param failureReason The reason for the failure. Possible values are defined in [FailureReason]
|
|
371
|
+
* (e.g., `FailureReason.ERROR`, `FailureReason.ABANDONED`, `FailureReason.OTHER`).
|
|
372
|
+
* @param attributes A map of custom attributes to attach to this failure event.
|
|
373
|
+
*/
|
|
374
|
+
fun failFeatureOperation(
|
|
375
|
+
name: String,
|
|
376
|
+
operationKey: String? = null,
|
|
377
|
+
failureReason: String,
|
|
378
|
+
attributes: ReadableMap,
|
|
379
|
+
promise: Promise
|
|
380
|
+
) {
|
|
381
|
+
val attributesMap = attributes.toHashMap().toMutableMap()
|
|
382
|
+
val reason = runCatching {
|
|
383
|
+
enumValueOf<FailureReason>(failureReason.uppercase())
|
|
384
|
+
}.getOrDefault(FailureReason.OTHER)
|
|
385
|
+
|
|
386
|
+
datadog.getRumMonitor().failFeatureOperation(name, operationKey, reason, attributesMap)
|
|
387
|
+
promise.resolve(null)
|
|
388
|
+
}
|
|
389
|
+
|
|
292
390
|
// region Internal
|
|
293
391
|
|
|
294
392
|
private fun String.asRumActionType(): RumActionType {
|