@datadog/mobile-react-native 2.14.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +6 -6
- package/README.md +23 -13
- package/android/build.gradle +10 -11
- package/android/gradle.properties +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
- package/android/src/test/resources/input/complete-configuration.json +32 -28
- package/android/src/test/resources/input/malformed-configuration.json +1 -1
- package/android/src/test/resources/input/minimal-configuration.json +4 -2
- package/datadog-configuration.schema.json +187 -139
- package/datadog-sourcemaps.gradle +2 -1
- package/ios/Sources/AnyEncodable.swift +14 -7
- package/ios/Sources/Attributes.swift +0 -7
- package/ios/Sources/DatadogSDKWrapper.swift +12 -128
- package/ios/Sources/DdLogsImplementation.swift +9 -39
- package/ios/Sources/DdRum.mm +89 -1
- package/ios/Sources/DdRumImplementation.swift +79 -0
- package/ios/Sources/DdSdk.mm +76 -11
- package/ios/Sources/DdSdkConfiguration.swift +159 -117
- package/ios/Sources/DdSdkImplementation.swift +235 -82
- package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
- package/ios/Sources/DdTelemetry.swift +49 -0
- package/ios/Sources/GlobalState.swift +1 -1
- package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
- package/ios/Sources/SdkVersion.swift +1 -1
- package/jest/mock.js +43 -4
- package/lib/commonjs/DdAttributes.js.map +1 -0
- package/lib/commonjs/DdSdkReactNative.js +159 -56
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/InternalLog.js +1 -1
- package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
- package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
- package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
- package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.js +120 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
- package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/commonjs/config/types/BatchSize.js +31 -0
- package/lib/commonjs/config/types/BatchSize.js.map +1 -0
- package/lib/commonjs/config/types/InitializationMode.js +17 -0
- package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
- package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
- package/lib/commonjs/config/types/UploadFrequency.js +30 -0
- package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/commonjs/config/types/index.js +68 -0
- package/lib/commonjs/config/types/index.js.map +1 -0
- package/lib/commonjs/index.js +51 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +13 -9
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/logs/eventMapper.js +4 -1
- package/lib/commonjs/logs/eventMapper.js.map +1 -1
- package/lib/commonjs/metro/plugin/metroSerializer.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +0 -45
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +56 -28
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/helper.js +63 -0
- package/lib/commonjs/rum/helper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +16 -27
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/commonjs/rum/types.js +1 -9
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
- package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/commonjs/sdk/DdSdk.js +4 -2
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
- package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +7 -5
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/types.js +19 -46
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
- package/lib/commonjs/utils/singletonUtils.js +21 -0
- package/lib/commonjs/utils/singletonUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdAttributes.js.map +1 -0
- package/lib/module/DdSdkReactNative.js +155 -52
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/InternalLog.js +1 -1
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/config/DatadogProviderConfiguration.js +18 -0
- package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.js +341 -0
- package/lib/module/config/FileBasedConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.type.js +2 -0
- package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/module/config/async/asyncInitializationHelper.js +36 -0
- package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.js +98 -0
- package/lib/module/config/features/CoreConfiguration.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.type.js +2 -0
- package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/module/config/features/CoreConfigurationNative.js +31 -0
- package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.js +30 -0
- package/lib/module/config/features/LogsConfiguration.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.type.js +2 -0
- package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/module/config/features/LogsConfigurationNative.js +2 -0
- package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.js +114 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.type.js +2 -0
- package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/module/config/features/RumConfigurationNative.js +2 -0
- package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.js +18 -0
- package/lib/module/config/features/TraceConfiguration.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.type.js +2 -0
- package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/module/config/features/TraceConfigurationNative.js +2 -0
- package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/module/config/types/BatchProcessingLevel.js +25 -0
- package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/module/config/types/BatchSize.js +26 -0
- package/lib/module/config/types/BatchSize.js.map +1 -0
- package/lib/module/config/types/InitializationMode.js +11 -0
- package/lib/module/config/types/InitializationMode.js.map +1 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/module/config/types/SdkVerbosity.js.map +1 -0
- package/lib/module/config/types/TrackingConsent.js.map +1 -0
- package/lib/module/config/types/UploadFrequency.js +25 -0
- package/lib/module/config/types/UploadFrequency.js.map +1 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/module/config/types/index.js +15 -0
- package/lib/module/config/types/index.js.map +1 -0
- package/lib/module/index.js +13 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +13 -9
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/logs/eventMapper.js +4 -1
- package/lib/module/logs/eventMapper.js.map +1 -1
- package/lib/module/metro/plugin/metroSerializer.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +1 -43
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +54 -26
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/helper.js +49 -0
- package/lib/module/rum/helper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +16 -26
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/module/rum/types.js +0 -9
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
- package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/types.js +2 -0
- package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
- package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/module/sdk/DdSdk.js +4 -4
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +80 -0
- package/lib/module/sdk/DdSdkInternal.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
- package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/trace/DdTrace.js +7 -6
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/types.js +22 -42
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/longTasksUtils.js.map +1 -1
- package/lib/module/utils/singletonUtils.js +14 -0
- package/lib/module/utils/singletonUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/DdSdkReactNative.d.ts +49 -12
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/InternalLog.d.ts +1 -1
- package/lib/typescript/InternalLog.d.ts.map +1 -1
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +10 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +20 -9
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/logs/DdLogs.d.ts +2 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/logs/eventMapper.d.ts +3 -2
- package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
- package/lib/typescript/logs/types.d.ts +1 -16
- package/lib/typescript/logs/types.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +2 -15
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +10 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
- package/lib/typescript/rum/helper.d.ts +10 -0
- package/lib/typescript/rum/helper.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/rum/types.d.ts +47 -7
- package/lib/typescript/rum/types.d.ts.map +1 -1
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
- package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts +2 -3
- package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts +1 -2
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +74 -92
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
- package/lib/typescript/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +246 -104
- package/src/InternalLog.tsx +1 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
- package/src/__tests__/InternalLog.test.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
- package/src/config/DatadogProviderConfiguration.ts +17 -0
- package/src/config/FileBasedConfiguration.ts +464 -0
- package/src/config/FileBasedConfiguration.type.ts +66 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
- package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
- package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
- package/src/config/async/PartialInitializationConfiguration.ts +58 -0
- package/src/config/async/asyncInitializationHelper.tsx +51 -0
- package/src/config/features/CoreConfiguration.ts +130 -0
- package/src/config/features/CoreConfiguration.type.ts +119 -0
- package/src/config/features/CoreConfigurationNative.ts +50 -0
- package/src/config/features/LogsConfiguration.ts +38 -0
- package/src/config/features/LogsConfiguration.type.ts +33 -0
- package/src/config/features/LogsConfigurationNative.ts +10 -0
- package/src/config/features/RumConfiguration.ts +137 -0
- package/src/config/features/RumConfiguration.type.ts +164 -0
- package/src/config/features/RumConfigurationNative.ts +26 -0
- package/src/config/features/TraceConfiguration.ts +24 -0
- package/src/config/features/TraceConfiguration.type.ts +17 -0
- package/src/config/features/TraceConfigurationNative.ts +8 -0
- package/src/config/types/BatchProcessingLevel.ts +23 -0
- package/src/config/types/BatchSize.ts +24 -0
- package/src/config/types/InitializationMode.ts +9 -0
- package/src/config/types/InitializationModeForTelemetry.ts +11 -0
- package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
- package/src/config/types/UploadFrequency.tsx +23 -0
- package/src/config/types/VitalsUpdateFrequency.ts +11 -0
- package/src/config/types/index.ts +15 -0
- package/src/index.tsx +33 -16
- package/src/logs/DdLogs.ts +14 -13
- package/src/logs/__tests__/DdLogs.test.ts +60 -107
- package/src/logs/__tests__/eventMapper.test.ts +1 -1
- package/src/logs/eventMapper.ts +5 -4
- package/src/logs/types.ts +1 -20
- package/src/metro/plugin/metroSerializer.ts +3 -3
- package/src/nativeModulesTypes.ts +2 -17
- package/src/rum/DdRum.ts +139 -42
- package/src/rum/__tests__/DdRum.test.ts +217 -47
- package/src/rum/eventMappers/errorEventMapper.ts +1 -1
- package/src/rum/helper.ts +62 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +21 -35
- package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
- package/src/rum/types.ts +68 -8
- package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
- package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
- package/src/sdk/AccountInfoSingleton/types.ts +11 -0
- package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
- package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
- package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
- package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
- package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
- package/src/sdk/AttributesEncoding/helpers.ts +176 -0
- package/src/sdk/AttributesEncoding/types.ts +33 -0
- package/src/sdk/AttributesEncoding/utils.ts +31 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
- package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
- package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
- package/src/sdk/DdSdk.ts +8 -5
- package/src/sdk/DdSdkInternal.ts +121 -0
- package/src/sdk/EventMappers/EventMapper.ts +9 -4
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
- package/src/sdk/GlobalState/GlobalState.tsx +10 -11
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
- package/src/sdk/UserInfoSingleton/types.ts +1 -4
- package/src/specs/NativeDdRum.ts +65 -0
- package/src/specs/NativeDdSdk.ts +40 -6
- package/src/trace/DdTrace.ts +11 -7
- package/src/trace/__tests__/DdTrace.test.ts +7 -8
- package/src/types.tsx +97 -76
- package/src/utils/__tests__/errorUtils.test.ts +1 -1
- package/src/utils/__tests__/singletonUtils.test.ts +75 -0
- package/src/utils/longTasksUtils.ts +1 -3
- package/src/utils/singletonUtils.ts +17 -0
- package/src/version.ts +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/commonjs/ProxyConfiguration.js.map +0 -1
- package/lib/commonjs/SdkVerbosity.js.map +0 -1
- package/lib/commonjs/TrackingConsent.js.map +0 -1
- package/lib/commonjs/rum/DdAttributes.js.map +0 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/commonjs/utils/argsUtils.js +0 -41
- package/lib/commonjs/utils/argsUtils.js.map +0 -1
- package/lib/commonjs/utils/errorUtils.js.map +0 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
- package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/module/ProxyConfiguration.js.map +0 -1
- package/lib/module/SdkVerbosity.js.map +0 -1
- package/lib/module/TrackingConsent.js.map +0 -1
- package/lib/module/rum/DdAttributes.js.map +0 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/module/utils/argsUtils.js +0 -35
- package/lib/module/utils/argsUtils.js.map +0 -1
- package/lib/module/utils/errorUtils.js.map +0 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
- package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
- package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
- package/lib/typescript/TrackingConsent.d.ts.map +0 -1
- package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
- package/lib/typescript/utils/argsUtils.d.ts +0 -8
- package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
- package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
- package/src/DdSdkReactNativeConfiguration.tsx +0 -582
- package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
- package/src/utils/__tests__/argsUtils.test.ts +0 -66
- package/src/utils/argsUtils.ts +0 -41
- /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
- /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
- /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
- /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
- /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
- /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
- /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
|
@@ -6,30 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
package com.datadog.reactnative
|
|
8
8
|
|
|
9
|
-
import com.datadog.android.
|
|
10
|
-
import com.datadog.android.trace.
|
|
11
|
-
import com.datadog.android.trace.TraceConfiguration
|
|
9
|
+
import com.datadog.android.Datadog
|
|
10
|
+
import com.datadog.android.trace.DatadogTracing
|
|
12
11
|
import com.facebook.react.bridge.Promise
|
|
13
12
|
import com.facebook.react.bridge.ReadableMap
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
13
|
+
import com.datadog.android.trace.api.scope.DatadogScope
|
|
14
|
+
import com.datadog.android.trace.api.span.DatadogSpan
|
|
15
|
+
import com.datadog.android.trace.api.tracer.DatadogTracer
|
|
16
|
+
import com.datadog.android.trace.GlobalDatadogTracer
|
|
18
17
|
import java.util.concurrent.TimeUnit
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* The entry point to use Datadog's Trace feature.
|
|
22
21
|
*/
|
|
23
22
|
class DdTraceImplementation(
|
|
24
|
-
private val tracerProvider: () ->
|
|
25
|
-
val tracer =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
GlobalTracer.get()
|
|
23
|
+
private val tracerProvider: () -> DatadogTracer = {
|
|
24
|
+
val tracer = DatadogTracing.newTracerBuilder(Datadog.getInstance()).build()
|
|
25
|
+
GlobalDatadogTracer.registerIfAbsent(tracer)
|
|
26
|
+
GlobalDatadogTracer.get()
|
|
29
27
|
}
|
|
30
28
|
) {
|
|
31
|
-
private val spanMap: MutableMap<String,
|
|
32
|
-
private val scopeMap: MutableMap<String,
|
|
29
|
+
private val spanMap: MutableMap<String, DatadogSpan> = mutableMapOf()
|
|
30
|
+
private val scopeMap: MutableMap<String, DatadogScope> = mutableMapOf()
|
|
33
31
|
|
|
34
32
|
// lazy here is on purpose. The thing is that this class will be instantiated even
|
|
35
33
|
// before Sdk.initialize is called, but Tracer can be created only after SDK is initialized.
|
|
@@ -47,15 +45,18 @@ class DdTraceImplementation(
|
|
|
47
45
|
.start()
|
|
48
46
|
|
|
49
47
|
// This is required for traces to be able to be bundled with logs.
|
|
50
|
-
val scope = tracer.
|
|
51
|
-
|
|
48
|
+
val scope = tracer.activateSpan(span)
|
|
52
49
|
val spanContext = span.context()
|
|
53
50
|
|
|
54
51
|
span.setTags(context.toHashMap())
|
|
55
52
|
span.setTags(GlobalState.globalAttributes)
|
|
56
|
-
val spanId = spanContext.
|
|
53
|
+
val spanId = spanContext.spanId.toString()
|
|
54
|
+
|
|
57
55
|
spanMap[spanId] = span
|
|
58
|
-
|
|
56
|
+
if (scope != null) {
|
|
57
|
+
scopeMap[spanId] = scope
|
|
58
|
+
}
|
|
59
|
+
|
|
59
60
|
|
|
60
61
|
promise.resolve(spanId)
|
|
61
62
|
}
|
|
@@ -82,7 +83,7 @@ class DdTraceImplementation(
|
|
|
82
83
|
promise.resolve(null)
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
private fun
|
|
86
|
+
private fun DatadogSpan.setTags(tags: Map<String, Any?>) {
|
|
86
87
|
for ((key, value) in tags) {
|
|
87
88
|
when (value) {
|
|
88
89
|
is Boolean -> setTag(key, value)
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
package com.datadog.reactnative
|
|
8
8
|
|
|
9
|
+
import com.datadog.android.rum.featureoperations.FailureReason
|
|
9
10
|
import com.facebook.react.bridge.Promise
|
|
10
11
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
11
12
|
import com.facebook.react.bridge.ReactMethod
|
|
13
|
+
import com.facebook.react.bridge.ReadableArray
|
|
12
14
|
import com.facebook.react.bridge.ReadableMap
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -51,7 +53,12 @@ class DdRum(
|
|
|
51
53
|
* If not provided, current timestamp will be used.
|
|
52
54
|
*/
|
|
53
55
|
@ReactMethod
|
|
54
|
-
override fun stopView(
|
|
56
|
+
override fun stopView(
|
|
57
|
+
key: String,
|
|
58
|
+
context: ReadableMap,
|
|
59
|
+
timestampMs: Double,
|
|
60
|
+
promise: Promise
|
|
61
|
+
) {
|
|
55
62
|
implementation.stopView(key, context, timestampMs, promise)
|
|
56
63
|
}
|
|
57
64
|
|
|
@@ -201,6 +208,43 @@ class DdRum(
|
|
|
201
208
|
implementation.addTiming(name, promise)
|
|
202
209
|
}
|
|
203
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Adds a custom attribute to the active RUM View. It will be propagated to all future RUM events associated with the active View.
|
|
213
|
+
* @param key: key for this view attribute.
|
|
214
|
+
* @param value: value for this attribute.
|
|
215
|
+
*/
|
|
216
|
+
@ReactMethod
|
|
217
|
+
override fun addViewAttribute(key: String, value: ReadableMap, promise: Promise) {
|
|
218
|
+
implementation.addViewAttribute(key, value, promise)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Removes an attribute from the active RUM View.
|
|
223
|
+
* @param key: key for the attribute to be removed from the view.
|
|
224
|
+
*/
|
|
225
|
+
@ReactMethod
|
|
226
|
+
override fun removeViewAttribute(key: String, promise: Promise) {
|
|
227
|
+
implementation.removeViewAttribute(key, promise)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Adds multiple attributes to the active RUM View. They will be propagated to all future RUM events associated with the active View.
|
|
232
|
+
* @param attributes: key/value object containing all attributes to be added to the view.
|
|
233
|
+
*/
|
|
234
|
+
@ReactMethod
|
|
235
|
+
override fun addViewAttributes(attributes: ReadableMap, promise: Promise) {
|
|
236
|
+
implementation.addViewAttributes(attributes, promise)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Removes multiple attributes from the active RUM View.
|
|
241
|
+
* @param keys: keys for the attributes to be removed from the view.
|
|
242
|
+
*/
|
|
243
|
+
@ReactMethod
|
|
244
|
+
override fun removeViewAttributes(keys: ReadableArray, promise: Promise) {
|
|
245
|
+
implementation.removeViewAttributes(keys, promise)
|
|
246
|
+
}
|
|
247
|
+
|
|
204
248
|
/**
|
|
205
249
|
* Adds the loading time of the view to the active view.
|
|
206
250
|
* It is calculated as the difference between the current time and the start time of the view.
|
|
@@ -238,4 +282,59 @@ class DdRum(
|
|
|
238
282
|
override fun getCurrentSessionId(promise: Promise) {
|
|
239
283
|
implementation.getCurrentSessionId(promise)
|
|
240
284
|
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Starts a RUM Feature Operation.
|
|
288
|
+
*
|
|
289
|
+
* @param name Human-readable operation name (e.g., "login_flow").
|
|
290
|
+
* @param operationKey Optional key that uniquely identifies this operation instance.
|
|
291
|
+
* @param attributes Additional attributes to attach to the operation.
|
|
292
|
+
* @param promise Resolved with `null` when the call completes.
|
|
293
|
+
*/
|
|
294
|
+
@ReactMethod
|
|
295
|
+
override fun startFeatureOperation(
|
|
296
|
+
name: String,
|
|
297
|
+
operationKey: String?,
|
|
298
|
+
attributes: ReadableMap,
|
|
299
|
+
promise: Promise
|
|
300
|
+
) {
|
|
301
|
+
implementation.startFeatureOperation(name, operationKey, attributes, promise)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Marks a Feature Operation as successfully completed.
|
|
306
|
+
*
|
|
307
|
+
* @param name The name of the feature operation (for example, `"login_flow"`).
|
|
308
|
+
* @param operationKey The key of the operation instance to complete, if one was provided when starting it.
|
|
309
|
+
* @param attributes A map of custom attributes to attach to this completion event.
|
|
310
|
+
*/
|
|
311
|
+
@ReactMethod
|
|
312
|
+
override fun succeedFeatureOperation(
|
|
313
|
+
name: String,
|
|
314
|
+
operationKey: String?,
|
|
315
|
+
attributes: ReadableMap,
|
|
316
|
+
promise: Promise
|
|
317
|
+
) {
|
|
318
|
+
implementation.succeedFeatureOperation(name, operationKey, attributes, promise)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Marks a Feature Operation as failed.
|
|
323
|
+
*
|
|
324
|
+
* @param name The name of the feature operation (for example, `"login_flow"`).
|
|
325
|
+
* @param operationKey The key of the operation instance to fail, if one was provided when starting it.
|
|
326
|
+
* @param failureReason The reason for the failure. Possible values are defined in [FailureReason]
|
|
327
|
+
* (e.g., `FailureReason.ERROR`, `FailureReason.ABANDONED`, `FailureReason.OTHER`).
|
|
328
|
+
* @param attributes A map of custom attributes to attach to this failure event.
|
|
329
|
+
*/
|
|
330
|
+
@ReactMethod
|
|
331
|
+
override fun failFeatureOperation(
|
|
332
|
+
name: String,
|
|
333
|
+
operationKey: String?,
|
|
334
|
+
failureReason: String,
|
|
335
|
+
attributes: ReadableMap,
|
|
336
|
+
promise: Promise
|
|
337
|
+
) {
|
|
338
|
+
implementation.failFeatureOperation(name, operationKey, failureReason, attributes, promise)
|
|
339
|
+
}
|
|
241
340
|
}
|
|
@@ -12,16 +12,18 @@ import com.facebook.react.bridge.LifecycleEventListener
|
|
|
12
12
|
import com.facebook.react.bridge.Promise
|
|
13
13
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
14
14
|
import com.facebook.react.bridge.ReactMethod
|
|
15
|
+
import com.facebook.react.bridge.ReadableArray
|
|
15
16
|
import com.facebook.react.bridge.ReadableMap
|
|
16
17
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
17
18
|
|
|
18
19
|
/** The entry point to initialize Datadog's features. */
|
|
19
20
|
class DdSdk(
|
|
20
21
|
reactContext: ReactApplicationContext,
|
|
21
|
-
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
22
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper(),
|
|
23
|
+
ddTelemetry: DdTelemetry = DdTelemetry()
|
|
22
24
|
) : NativeDdSdkSpec(reactContext) {
|
|
23
25
|
|
|
24
|
-
private val implementation = DdSdkImplementation(reactContext, datadog = datadogWrapper)
|
|
26
|
+
private val implementation = DdSdkImplementation(reactContext, datadog = datadogWrapper, ddTelemetry)
|
|
25
27
|
|
|
26
28
|
override fun getName(): String = DdSdkImplementation.NAME
|
|
27
29
|
|
|
@@ -39,30 +41,48 @@ class DdSdk(
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
|
-
* Sets the global context
|
|
44
|
+
* Sets a specific attribute in the global context attached with all future Logs, Spans and RUM
|
|
45
|
+
*
|
|
46
|
+
* @param key: Key that identifies the attribute.
|
|
47
|
+
* @param value: Value linked to the attribute.
|
|
48
|
+
*/
|
|
49
|
+
@ReactMethod
|
|
50
|
+
override fun addAttribute(key: String, value: ReadableMap, promise: Promise) {
|
|
51
|
+
implementation.addAttribute(key, value, promise)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Removes an attribute from the context attached with all future Logs, Spans and RUM events.
|
|
56
|
+
* @param key: They key associated with the attribute to be removed.
|
|
57
|
+
*/
|
|
58
|
+
@ReactMethod
|
|
59
|
+
override fun removeAttribute(key: String, promise: Promise) {
|
|
60
|
+
implementation.removeAttribute(key, promise)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Adds a set of attributes to the global context that is attached with all future Logs, Spans and RUM
|
|
43
65
|
* events.
|
|
44
66
|
* @param attributes The global context attributes.
|
|
45
67
|
*/
|
|
46
68
|
@ReactMethod
|
|
47
|
-
override fun
|
|
48
|
-
implementation.
|
|
69
|
+
override fun addAttributes(attributes: ReadableMap, promise: Promise) {
|
|
70
|
+
implementation.addAttributes(attributes, promise)
|
|
49
71
|
}
|
|
50
72
|
|
|
51
73
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
74
|
+
* Removes a set of attributes from the global context that is attached with all future Logs, Spans and RUM
|
|
75
|
+
* events.
|
|
76
|
+
* @param keys: They keys associated with the attributes to be removed.
|
|
55
77
|
*/
|
|
56
|
-
@Deprecated("Use setUserInfo instead; the user ID is now required.")
|
|
57
78
|
@ReactMethod
|
|
58
|
-
override fun
|
|
59
|
-
implementation.
|
|
79
|
+
override fun removeAttributes(keys: ReadableArray, promise: Promise) {
|
|
80
|
+
implementation.removeAttributes(keys, promise)
|
|
60
81
|
}
|
|
61
82
|
|
|
62
|
-
|
|
83
|
+
/**
|
|
63
84
|
* Set the user information.
|
|
64
|
-
* @param user The user object (use builtin attributes: 'id', 'email', 'name', and any custom
|
|
65
|
-
* attribute inside 'extraInfo').
|
|
85
|
+
* @param user The user object (use builtin attributes: 'id', 'email', 'name', and any custom * attribute inside 'extraInfo').
|
|
66
86
|
*/
|
|
67
87
|
@ReactMethod
|
|
68
88
|
override fun setUserInfo(user: ReadableMap, promise: Promise) {
|
|
@@ -78,6 +98,40 @@ class DdSdk(
|
|
|
78
98
|
implementation.addUserExtraInfo(extraInfo, promise)
|
|
79
99
|
}
|
|
80
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Clears the user information.
|
|
103
|
+
*/
|
|
104
|
+
@ReactMethod
|
|
105
|
+
override fun clearUserInfo(promise: Promise) {
|
|
106
|
+
implementation.clearUserInfo(promise)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Set the account information.
|
|
111
|
+
* @param account The account object (use builtin attributes: 'id', 'name', and any custom * attribute inside 'extraInfo').
|
|
112
|
+
*/
|
|
113
|
+
@ReactMethod
|
|
114
|
+
override fun setAccountInfo(account: ReadableMap, promise: Promise) {
|
|
115
|
+
implementation.setAccountInfo(account, promise)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Sets the account information.
|
|
120
|
+
* @param extraAccountInfo: The additional information. (To set the id or name please use setAccountInfo).
|
|
121
|
+
*/
|
|
122
|
+
@ReactMethod
|
|
123
|
+
override fun addAccountExtraInfo(extraInfo: ReadableMap, promise: Promise) {
|
|
124
|
+
implementation.addAccountExtraInfo(extraInfo, promise)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Clears the account information.
|
|
129
|
+
*/
|
|
130
|
+
@ReactMethod
|
|
131
|
+
override fun clearAccountInfo(promise: Promise) {
|
|
132
|
+
implementation.clearAccountInfo(promise)
|
|
133
|
+
}
|
|
134
|
+
|
|
81
135
|
/**
|
|
82
136
|
* Set the tracking consent regarding the data collection.
|
|
83
137
|
* @param trackingConsent Consent, which can take one of the following values: 'pending',
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
package com.datadog.reactnative
|
|
8
8
|
|
|
9
|
+
import com.datadog.android.rum.featureoperations.FailureReason
|
|
9
10
|
import com.facebook.react.bridge.Promise
|
|
10
11
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
11
12
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
12
13
|
import com.facebook.react.bridge.ReactMethod
|
|
14
|
+
import com.facebook.react.bridge.ReadableArray
|
|
13
15
|
import com.facebook.react.bridge.ReadableMap
|
|
14
16
|
|
|
15
17
|
/**
|
|
@@ -192,6 +194,43 @@ class DdRum(
|
|
|
192
194
|
implementation.addTiming(name, promise)
|
|
193
195
|
}
|
|
194
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Adds a custom attribute to the active RUM View. It will be propagated to all future RUM events associated with the active View.
|
|
199
|
+
* @param key: key for this view attribute.
|
|
200
|
+
* @param value: value for this attribute.
|
|
201
|
+
*/
|
|
202
|
+
@ReactMethod
|
|
203
|
+
fun addViewAttribute(key: String, value: ReadableMap, promise: Promise) {
|
|
204
|
+
implementation.addViewAttribute(key, value, promise)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Removes an attribute from the active RUM View.
|
|
209
|
+
* @param key: key for the attribute to be removed from the view.
|
|
210
|
+
*/
|
|
211
|
+
@ReactMethod
|
|
212
|
+
fun removeViewAttribute(key: String, promise: Promise) {
|
|
213
|
+
implementation.removeViewAttribute(key, promise)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Adds multiple attributes to the active RUM View. They will be propagated to all future RUM events associated with the active View.
|
|
218
|
+
* @param attributes: key/value object containing all attributes to be added to the view.
|
|
219
|
+
*/
|
|
220
|
+
@ReactMethod
|
|
221
|
+
fun addViewAttributes(attributes: ReadableMap, promise: Promise) {
|
|
222
|
+
implementation.addViewAttributes(attributes, promise)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Removes multiple attributes from the active RUM View.
|
|
227
|
+
* @param keys: keys for the attributes to be removed from the view.
|
|
228
|
+
*/
|
|
229
|
+
@ReactMethod
|
|
230
|
+
fun removeViewAttributes(keys: ReadableArray, promise: Promise) {
|
|
231
|
+
implementation.removeViewAttributes(keys, promise)
|
|
232
|
+
}
|
|
233
|
+
|
|
195
234
|
/**
|
|
196
235
|
* Adds the loading time of the view to the active view.
|
|
197
236
|
* It is calculated as the difference between the current time and the start time of the view.
|
|
@@ -228,4 +267,59 @@ class DdRum(
|
|
|
228
267
|
fun getCurrentSessionId(promise: Promise) {
|
|
229
268
|
implementation.getCurrentSessionId(promise)
|
|
230
269
|
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Starts a RUM Feature Operation.
|
|
273
|
+
*
|
|
274
|
+
* @param name Human-readable operation name (e.g., "login_flow").
|
|
275
|
+
* @param operationKey Optional key that uniquely identifies this operation instance.
|
|
276
|
+
* @param attributes Additional attributes to attach to the operation.
|
|
277
|
+
* @param promise Resolved with `null` when the call completes.
|
|
278
|
+
*/
|
|
279
|
+
@ReactMethod
|
|
280
|
+
fun startFeatureOperation(
|
|
281
|
+
name: String,
|
|
282
|
+
operationKey: String? = null,
|
|
283
|
+
attributes: ReadableMap,
|
|
284
|
+
promise: Promise
|
|
285
|
+
) {
|
|
286
|
+
implementation.startFeatureOperation(name, operationKey, attributes, promise)
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Marks a Feature Operation as successfully completed.
|
|
291
|
+
*
|
|
292
|
+
* @param name The name of the feature operation (for example, "login_flow").
|
|
293
|
+
* @param operationKey The key of the operation instance to complete, if one was provided.
|
|
294
|
+
* @param attributes A map of custom attributes to attach to this completion event.
|
|
295
|
+
*/
|
|
296
|
+
@ReactMethod
|
|
297
|
+
fun succeedFeatureOperation(
|
|
298
|
+
name: String,
|
|
299
|
+
operationKey: String? = null,
|
|
300
|
+
attributes: ReadableMap,
|
|
301
|
+
promise: Promise
|
|
302
|
+
) {
|
|
303
|
+
implementation.succeedFeatureOperation(name, operationKey, attributes, promise)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Marks a Feature Operation as failed.
|
|
308
|
+
*
|
|
309
|
+
* @param name The name of the feature operation (for example, "login_flow").
|
|
310
|
+
* @param operationKey The key of the operation instance to fail, if one was provided.
|
|
311
|
+
* @param failureReason The reason for the failure. Values are defined in [FailureReason]
|
|
312
|
+
* (e.g., `FailureReason.ERROR`, `FailureReason.ABANDONED`, `FailureReason.OTHER`).
|
|
313
|
+
* @param attributes A map of custom attributes to attach to this failure event.
|
|
314
|
+
*/
|
|
315
|
+
@ReactMethod
|
|
316
|
+
fun failFeatureOperation(
|
|
317
|
+
name: String,
|
|
318
|
+
operationKey: String? = null,
|
|
319
|
+
failureReason: String,
|
|
320
|
+
attributes: ReadableMap,
|
|
321
|
+
promise: Promise
|
|
322
|
+
) {
|
|
323
|
+
implementation.failFeatureOperation(name, operationKey, failureReason, attributes, promise)
|
|
324
|
+
}
|
|
231
325
|
}
|
|
@@ -12,15 +12,21 @@ import com.facebook.react.bridge.Promise
|
|
|
12
12
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
13
13
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
14
14
|
import com.facebook.react.bridge.ReactMethod
|
|
15
|
+
import com.facebook.react.bridge.ReadableArray
|
|
15
16
|
import com.facebook.react.bridge.ReadableMap
|
|
16
17
|
|
|
17
18
|
/** The entry point to initialize Datadog's features. */
|
|
18
19
|
class DdSdk(
|
|
19
20
|
reactContext: ReactApplicationContext,
|
|
20
|
-
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
21
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper(),
|
|
22
|
+
ddTelemetry: DdTelemetry = DdTelemetry()
|
|
21
23
|
) : ReactContextBaseJavaModule(reactContext) {
|
|
22
24
|
|
|
23
|
-
private val implementation = DdSdkImplementation(
|
|
25
|
+
private val implementation = DdSdkImplementation(
|
|
26
|
+
reactContext,
|
|
27
|
+
datadog = datadogWrapper,
|
|
28
|
+
ddTelemetry
|
|
29
|
+
)
|
|
24
30
|
private var lifecycleEventListener: LifecycleEventListener? = null
|
|
25
31
|
|
|
26
32
|
override fun getName(): String = DdSdkImplementation.NAME
|
|
@@ -61,24 +67,43 @@ class DdSdk(
|
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
/**
|
|
64
|
-
* Sets the global context
|
|
70
|
+
* Sets a specific attribute in the global context attached with all future Logs, Spans and RUM
|
|
71
|
+
*
|
|
72
|
+
* @param key: Key that identifies the attribute.
|
|
73
|
+
* @param value: Value linked to the attribute.
|
|
74
|
+
*/
|
|
75
|
+
@ReactMethod
|
|
76
|
+
fun addAttribute(key: String, value: ReadableMap, promise: Promise) {
|
|
77
|
+
implementation.addAttribute(key, value, promise)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Removes an attribute from the context attached with all future Logs, Spans and RUM events.
|
|
82
|
+
* @param key: They key associated with the attribute to be removed.
|
|
83
|
+
*/
|
|
84
|
+
@ReactMethod
|
|
85
|
+
fun removeAttribute(key: String, promise: Promise) {
|
|
86
|
+
implementation.removeAttribute(key, promise)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Adds a set of attributes to the global context that is attached with all future Logs, Spans and RUM
|
|
65
91
|
* events.
|
|
66
92
|
* @param attributes The global context attributes.
|
|
67
93
|
*/
|
|
68
94
|
@ReactMethod
|
|
69
|
-
fun
|
|
70
|
-
implementation.
|
|
95
|
+
fun addAttributes(attributes: ReadableMap, promise: Promise) {
|
|
96
|
+
implementation.addAttributes(attributes, promise)
|
|
71
97
|
}
|
|
72
98
|
|
|
73
99
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
100
|
+
* Removes a set of attributes from the global context that is attached with all future Logs, Spans and RUM
|
|
101
|
+
* events.
|
|
102
|
+
* @param keys: They keys associated with the attributes to be removed.
|
|
77
103
|
*/
|
|
78
|
-
@Deprecated("Use setUserInfo instead; the user ID is now required.")
|
|
79
104
|
@ReactMethod
|
|
80
|
-
fun
|
|
81
|
-
implementation.
|
|
105
|
+
fun removeAttributes(keys: ReadableArray, promise: Promise) {
|
|
106
|
+
implementation.removeAttributes(keys, promise)
|
|
82
107
|
}
|
|
83
108
|
|
|
84
109
|
/**
|
|
@@ -99,6 +124,40 @@ class DdSdk(
|
|
|
99
124
|
implementation.addUserExtraInfo(extraInfo, promise)
|
|
100
125
|
}
|
|
101
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Clears the user information.
|
|
129
|
+
*/
|
|
130
|
+
@ReactMethod
|
|
131
|
+
fun clearUserInfo(promise: Promise) {
|
|
132
|
+
implementation.clearUserInfo(promise)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Set the account information.
|
|
137
|
+
* @param account The account object (use builtin attributes: 'id', 'name', and any custom * attribute inside 'extraInfo').
|
|
138
|
+
*/
|
|
139
|
+
@ReactMethod
|
|
140
|
+
fun setAccountInfo(account: ReadableMap, promise: Promise) {
|
|
141
|
+
implementation.setAccountInfo(account, promise)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Sets the account information.
|
|
146
|
+
* @param extraAccountInfo: The additional information. (To set the id or name please use setAccountInfo).
|
|
147
|
+
*/
|
|
148
|
+
@ReactMethod
|
|
149
|
+
fun addAccountExtraInfo(extraInfo: ReadableMap, promise: Promise) {
|
|
150
|
+
implementation.addAccountExtraInfo(extraInfo, promise)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Clears the account information.
|
|
155
|
+
*/
|
|
156
|
+
@ReactMethod
|
|
157
|
+
fun clearAccountInfo(promise: Promise) {
|
|
158
|
+
implementation.clearAccountInfo(promise)
|
|
159
|
+
}
|
|
160
|
+
|
|
102
161
|
/**
|
|
103
162
|
* Set the tracking consent regarding the data collection.
|
|
104
163
|
* @param trackingConsent Consent, which can take one of the following values: 'pending',
|
|
@@ -13,13 +13,16 @@ import com.datadog.android.rum.RumMonitor
|
|
|
13
13
|
import com.datadog.android.rum.RumResourceKind
|
|
14
14
|
import com.datadog.android.rum.RumResourceMethod
|
|
15
15
|
import com.datadog.tools.unit.forge.BaseConfigurator
|
|
16
|
+
import com.datadog.tools.unit.toReadableArray
|
|
16
17
|
import com.datadog.tools.unit.toReadableMap
|
|
17
18
|
import com.facebook.react.bridge.Promise
|
|
18
19
|
import fr.xgouchet.elmyr.Forge
|
|
20
|
+
import fr.xgouchet.elmyr.annotation.AdvancedForgery
|
|
19
21
|
import fr.xgouchet.elmyr.annotation.BoolForgery
|
|
20
22
|
import fr.xgouchet.elmyr.annotation.DoubleForgery
|
|
21
23
|
import fr.xgouchet.elmyr.annotation.Forgery
|
|
22
24
|
import fr.xgouchet.elmyr.annotation.IntForgery
|
|
25
|
+
import fr.xgouchet.elmyr.annotation.MapForgery
|
|
23
26
|
import fr.xgouchet.elmyr.annotation.StringForgery
|
|
24
27
|
import fr.xgouchet.elmyr.annotation.StringForgeryType
|
|
25
28
|
import fr.xgouchet.elmyr.junit5.ForgeConfiguration
|
|
@@ -456,6 +459,61 @@ internal class DdRumTest {
|
|
|
456
459
|
verify(mockRumMonitor).addTiming(timing)
|
|
457
460
|
}
|
|
458
461
|
|
|
462
|
+
@Test
|
|
463
|
+
fun `M call addViewAttribute W addViewAttribute()`(
|
|
464
|
+
@StringForgery key: String,
|
|
465
|
+
@StringForgery value: String
|
|
466
|
+
) {
|
|
467
|
+
var attributeMap = mutableMapOf<String, Any?>()
|
|
468
|
+
attributeMap.put("value", value)
|
|
469
|
+
|
|
470
|
+
var attributes = mutableMapOf<String, Any?>()
|
|
471
|
+
attributes.put(key, value)
|
|
472
|
+
|
|
473
|
+
// When
|
|
474
|
+
testedDdRum.addViewAttribute(key, attributeMap.toReadableMap(), mockPromise)
|
|
475
|
+
|
|
476
|
+
// Then
|
|
477
|
+
verify(mockRumMonitor).addViewAttributes(attributes)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
@Test
|
|
481
|
+
fun `M call removeViewAttribute W removeViewAttribute()`(@StringForgery key: String) {
|
|
482
|
+
// When
|
|
483
|
+
testedDdRum.removeViewAttribute(key, mockPromise)
|
|
484
|
+
|
|
485
|
+
// Then
|
|
486
|
+
verify(mockRumMonitor).removeViewAttributes(listOf(key))
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
@Test
|
|
490
|
+
fun `M call addViewAttributes W addViewAttributes()`(
|
|
491
|
+
@MapForgery(
|
|
492
|
+
key = AdvancedForgery(string = [StringForgery(StringForgeryType.NUMERICAL)]),
|
|
493
|
+
value = AdvancedForgery(string = [StringForgery(StringForgeryType.ASCII)])
|
|
494
|
+
) customAttributes: Map<String, String>
|
|
495
|
+
) {
|
|
496
|
+
// When
|
|
497
|
+
testedDdRum.addViewAttributes(customAttributes.toReadableMap(), mockPromise)
|
|
498
|
+
|
|
499
|
+
// Then
|
|
500
|
+
verify(mockRumMonitor).addViewAttributes(customAttributes)
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
@Test
|
|
504
|
+
fun `𝕄 call removeViewAttributes 𝕎 removeViewAttributes`(
|
|
505
|
+
@MapForgery(
|
|
506
|
+
key = AdvancedForgery(string = [StringForgery(StringForgeryType.NUMERICAL)]),
|
|
507
|
+
value = AdvancedForgery(string = [StringForgery(StringForgeryType.ASCII)])
|
|
508
|
+
) customAttributes: Map<String, String>
|
|
509
|
+
) {
|
|
510
|
+
// When
|
|
511
|
+
testedDdRum.removeViewAttributes(customAttributes.keys.toReadableArray(), mockPromise)
|
|
512
|
+
|
|
513
|
+
// Then
|
|
514
|
+
verify(mockRumMonitor).removeViewAttributes(customAttributes.keys.toList())
|
|
515
|
+
}
|
|
516
|
+
|
|
459
517
|
@Test
|
|
460
518
|
fun `M call addViewLoadingTime w addViewLoadingTime()`(@BoolForgery overwrite: Boolean) {
|
|
461
519
|
// When
|