@datadog/mobile-react-native 2.14.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +6 -6
- package/README.md +23 -13
- package/android/build.gradle +10 -11
- package/android/gradle.properties +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
- package/android/src/test/resources/input/complete-configuration.json +32 -28
- package/android/src/test/resources/input/malformed-configuration.json +1 -1
- package/android/src/test/resources/input/minimal-configuration.json +4 -2
- package/datadog-configuration.schema.json +187 -139
- package/ios/Sources/AnyEncodable.swift +14 -7
- package/ios/Sources/Attributes.swift +0 -7
- package/ios/Sources/DatadogSDKWrapper.swift +12 -128
- package/ios/Sources/DdLogsImplementation.swift +9 -39
- package/ios/Sources/DdRum.mm +89 -1
- package/ios/Sources/DdRumImplementation.swift +79 -0
- package/ios/Sources/DdSdk.mm +76 -11
- package/ios/Sources/DdSdkConfiguration.swift +159 -117
- package/ios/Sources/DdSdkImplementation.swift +235 -82
- package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
- package/ios/Sources/DdTelemetry.swift +49 -0
- package/ios/Sources/GlobalState.swift +1 -1
- package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
- package/ios/Sources/SdkVersion.swift +1 -1
- package/jest/mock.js +43 -4
- package/lib/commonjs/DdAttributes.js.map +1 -0
- package/lib/commonjs/DdSdkReactNative.js +159 -56
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/InternalLog.js +1 -1
- package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
- package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
- package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
- package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.js +120 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
- package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/commonjs/config/types/BatchSize.js +31 -0
- package/lib/commonjs/config/types/BatchSize.js.map +1 -0
- package/lib/commonjs/config/types/InitializationMode.js +17 -0
- package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
- package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
- package/lib/commonjs/config/types/UploadFrequency.js +30 -0
- package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/commonjs/config/types/index.js +68 -0
- package/lib/commonjs/config/types/index.js.map +1 -0
- package/lib/commonjs/index.js +51 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +13 -9
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/logs/eventMapper.js +4 -1
- package/lib/commonjs/logs/eventMapper.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +0 -45
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +56 -28
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/helper.js +63 -0
- package/lib/commonjs/rum/helper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -25
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/commonjs/rum/types.js +1 -9
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
- package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/commonjs/sdk/DdSdk.js +4 -2
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
- package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +7 -5
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/types.js +19 -46
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
- package/lib/commonjs/utils/singletonUtils.js +21 -0
- package/lib/commonjs/utils/singletonUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdAttributes.js.map +1 -0
- package/lib/module/DdSdkReactNative.js +155 -52
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/InternalLog.js +1 -1
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/config/DatadogProviderConfiguration.js +18 -0
- package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.js +341 -0
- package/lib/module/config/FileBasedConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.type.js +2 -0
- package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/module/config/async/asyncInitializationHelper.js +36 -0
- package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.js +98 -0
- package/lib/module/config/features/CoreConfiguration.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.type.js +2 -0
- package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/module/config/features/CoreConfigurationNative.js +31 -0
- package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.js +30 -0
- package/lib/module/config/features/LogsConfiguration.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.type.js +2 -0
- package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/module/config/features/LogsConfigurationNative.js +2 -0
- package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.js +114 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.type.js +2 -0
- package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/module/config/features/RumConfigurationNative.js +2 -0
- package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.js +18 -0
- package/lib/module/config/features/TraceConfiguration.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.type.js +2 -0
- package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/module/config/features/TraceConfigurationNative.js +2 -0
- package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/module/config/types/BatchProcessingLevel.js +25 -0
- package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/module/config/types/BatchSize.js +26 -0
- package/lib/module/config/types/BatchSize.js.map +1 -0
- package/lib/module/config/types/InitializationMode.js +11 -0
- package/lib/module/config/types/InitializationMode.js.map +1 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/module/config/types/SdkVerbosity.js.map +1 -0
- package/lib/module/config/types/TrackingConsent.js.map +1 -0
- package/lib/module/config/types/UploadFrequency.js +25 -0
- package/lib/module/config/types/UploadFrequency.js.map +1 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/module/config/types/index.js +15 -0
- package/lib/module/config/types/index.js.map +1 -0
- package/lib/module/index.js +13 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +13 -9
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/logs/eventMapper.js +4 -1
- package/lib/module/logs/eventMapper.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +1 -43
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +54 -26
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/helper.js +49 -0
- package/lib/module/rum/helper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -24
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/module/rum/types.js +0 -9
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
- package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/types.js +2 -0
- package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
- package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/module/sdk/DdSdk.js +4 -4
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +80 -0
- package/lib/module/sdk/DdSdkInternal.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
- package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/trace/DdTrace.js +7 -6
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/types.js +22 -42
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/longTasksUtils.js.map +1 -1
- package/lib/module/utils/singletonUtils.js +14 -0
- package/lib/module/utils/singletonUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/DdSdkReactNative.d.ts +49 -12
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/InternalLog.d.ts +1 -1
- package/lib/typescript/InternalLog.d.ts.map +1 -1
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +10 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +20 -9
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/logs/DdLogs.d.ts +2 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/logs/eventMapper.d.ts +3 -2
- package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
- package/lib/typescript/logs/types.d.ts +1 -16
- package/lib/typescript/logs/types.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +2 -15
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +10 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
- package/lib/typescript/rum/helper.d.ts +10 -0
- package/lib/typescript/rum/helper.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/rum/types.d.ts +47 -7
- package/lib/typescript/rum/types.d.ts.map +1 -1
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
- package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts +2 -3
- package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts +1 -2
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +74 -92
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
- package/lib/typescript/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +246 -104
- package/src/InternalLog.tsx +1 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
- package/src/__tests__/InternalLog.test.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
- package/src/config/DatadogProviderConfiguration.ts +17 -0
- package/src/config/FileBasedConfiguration.ts +464 -0
- package/src/config/FileBasedConfiguration.type.ts +66 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
- package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
- package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
- package/src/config/async/PartialInitializationConfiguration.ts +58 -0
- package/src/config/async/asyncInitializationHelper.tsx +51 -0
- package/src/config/features/CoreConfiguration.ts +130 -0
- package/src/config/features/CoreConfiguration.type.ts +119 -0
- package/src/config/features/CoreConfigurationNative.ts +50 -0
- package/src/config/features/LogsConfiguration.ts +38 -0
- package/src/config/features/LogsConfiguration.type.ts +33 -0
- package/src/config/features/LogsConfigurationNative.ts +10 -0
- package/src/config/features/RumConfiguration.ts +137 -0
- package/src/config/features/RumConfiguration.type.ts +164 -0
- package/src/config/features/RumConfigurationNative.ts +26 -0
- package/src/config/features/TraceConfiguration.ts +24 -0
- package/src/config/features/TraceConfiguration.type.ts +17 -0
- package/src/config/features/TraceConfigurationNative.ts +8 -0
- package/src/config/types/BatchProcessingLevel.ts +23 -0
- package/src/config/types/BatchSize.ts +24 -0
- package/src/config/types/InitializationMode.ts +9 -0
- package/src/config/types/InitializationModeForTelemetry.ts +11 -0
- package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
- package/src/config/types/UploadFrequency.tsx +23 -0
- package/src/config/types/VitalsUpdateFrequency.ts +11 -0
- package/src/config/types/index.ts +15 -0
- package/src/index.tsx +33 -16
- package/src/logs/DdLogs.ts +14 -13
- package/src/logs/__tests__/DdLogs.test.ts +60 -107
- package/src/logs/__tests__/eventMapper.test.ts +1 -1
- package/src/logs/eventMapper.ts +5 -4
- package/src/logs/types.ts +1 -20
- package/src/nativeModulesTypes.ts +2 -17
- package/src/rum/DdRum.ts +139 -42
- package/src/rum/__tests__/DdRum.test.ts +217 -47
- package/src/rum/eventMappers/errorEventMapper.ts +1 -1
- package/src/rum/helper.ts +62 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +20 -32
- package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
- package/src/rum/types.ts +68 -8
- package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
- package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
- package/src/sdk/AccountInfoSingleton/types.ts +11 -0
- package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
- package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
- package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
- package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
- package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
- package/src/sdk/AttributesEncoding/helpers.ts +176 -0
- package/src/sdk/AttributesEncoding/types.ts +33 -0
- package/src/sdk/AttributesEncoding/utils.ts +31 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
- package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
- package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
- package/src/sdk/DdSdk.ts +8 -5
- package/src/sdk/DdSdkInternal.ts +121 -0
- package/src/sdk/EventMappers/EventMapper.ts +9 -4
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
- package/src/sdk/GlobalState/GlobalState.tsx +10 -11
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
- package/src/sdk/UserInfoSingleton/types.ts +1 -4
- package/src/specs/NativeDdRum.ts +65 -0
- package/src/specs/NativeDdSdk.ts +40 -6
- package/src/trace/DdTrace.ts +11 -7
- package/src/trace/__tests__/DdTrace.test.ts +7 -8
- package/src/types.tsx +97 -76
- package/src/utils/__tests__/errorUtils.test.ts +1 -1
- package/src/utils/__tests__/singletonUtils.test.ts +75 -0
- package/src/utils/longTasksUtils.ts +1 -3
- package/src/utils/singletonUtils.ts +17 -0
- package/src/version.ts +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/commonjs/ProxyConfiguration.js.map +0 -1
- package/lib/commonjs/SdkVerbosity.js.map +0 -1
- package/lib/commonjs/TrackingConsent.js.map +0 -1
- package/lib/commonjs/rum/DdAttributes.js.map +0 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/commonjs/utils/argsUtils.js +0 -41
- package/lib/commonjs/utils/argsUtils.js.map +0 -1
- package/lib/commonjs/utils/errorUtils.js.map +0 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
- package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/module/ProxyConfiguration.js.map +0 -1
- package/lib/module/SdkVerbosity.js.map +0 -1
- package/lib/module/TrackingConsent.js.map +0 -1
- package/lib/module/rum/DdAttributes.js.map +0 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/module/utils/argsUtils.js +0 -35
- package/lib/module/utils/argsUtils.js.map +0 -1
- package/lib/module/utils/errorUtils.js.map +0 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
- package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
- package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
- package/lib/typescript/TrackingConsent.d.ts.map +0 -1
- package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
- package/lib/typescript/utils/argsUtils.d.ts +0 -8
- package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
- package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
- package/src/DdSdkReactNativeConfiguration.tsx +0 -582
- package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
- package/src/utils/__tests__/argsUtils.test.ts +0 -66
- package/src/utils/argsUtils.ts +0 -41
- /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
- /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
- /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
- /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
- /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
- /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
- /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setCachedUserId = exports.setCachedSessionId = exports.setCachedAccountId = exports.getCachedUserId = exports.getCachedSessionId = exports.getCachedAccountId = exports.clearCachedUserId = exports.clearCachedSessionId = exports.clearCachedAccountId = void 0;
|
|
7
|
+
var _singletonUtils = require("../utils/singletonUtils");
|
|
8
|
+
/*
|
|
9
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
11
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
12
|
+
*/
|
|
13
|
+
const SESSION_INFO_MODULE = 'com.datadog.reactnative.sdk.session_info';
|
|
14
|
+
class _SessionInfo {
|
|
15
|
+
sessionId = undefined;
|
|
16
|
+
userId = undefined;
|
|
17
|
+
accountId = undefined;
|
|
18
|
+
_reset() {
|
|
19
|
+
this.sessionId = undefined;
|
|
20
|
+
this.userId = undefined;
|
|
21
|
+
this.accountId = undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const SessionInfo = (0, _singletonUtils.getGlobalInstance)(SESSION_INFO_MODULE, () => new _SessionInfo());
|
|
25
|
+
|
|
26
|
+
// Helper functions to interact with the SessionInfo singleton
|
|
27
|
+
const getCachedSessionId = () => {
|
|
28
|
+
return SessionInfo.sessionId;
|
|
29
|
+
};
|
|
30
|
+
exports.getCachedSessionId = getCachedSessionId;
|
|
31
|
+
const setCachedSessionId = sessionId => {
|
|
32
|
+
SessionInfo.sessionId = sessionId;
|
|
33
|
+
};
|
|
34
|
+
exports.setCachedSessionId = setCachedSessionId;
|
|
35
|
+
const clearCachedSessionId = () => {
|
|
36
|
+
SessionInfo.sessionId = undefined;
|
|
37
|
+
};
|
|
38
|
+
exports.clearCachedSessionId = clearCachedSessionId;
|
|
39
|
+
const getCachedUserId = () => {
|
|
40
|
+
return SessionInfo.userId;
|
|
41
|
+
};
|
|
42
|
+
exports.getCachedUserId = getCachedUserId;
|
|
43
|
+
const setCachedUserId = userId => {
|
|
44
|
+
SessionInfo.userId = userId;
|
|
45
|
+
};
|
|
46
|
+
exports.setCachedUserId = setCachedUserId;
|
|
47
|
+
const clearCachedUserId = () => {
|
|
48
|
+
SessionInfo.userId = undefined;
|
|
49
|
+
};
|
|
50
|
+
exports.clearCachedUserId = clearCachedUserId;
|
|
51
|
+
const getCachedAccountId = () => {
|
|
52
|
+
return SessionInfo.accountId;
|
|
53
|
+
};
|
|
54
|
+
exports.getCachedAccountId = getCachedAccountId;
|
|
55
|
+
const setCachedAccountId = accountId => {
|
|
56
|
+
SessionInfo.accountId = accountId;
|
|
57
|
+
};
|
|
58
|
+
exports.setCachedAccountId = setCachedAccountId;
|
|
59
|
+
const clearCachedAccountId = () => {
|
|
60
|
+
SessionInfo.accountId = undefined;
|
|
61
|
+
};
|
|
62
|
+
exports.clearCachedAccountId = clearCachedAccountId;
|
|
63
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_singletonUtils","require","SESSION_INFO_MODULE","_SessionInfo","sessionId","undefined","userId","accountId","_reset","SessionInfo","getGlobalInstance","getCachedSessionId","exports","setCachedSessionId","clearCachedSessionId","getCachedUserId","setCachedUserId","clearCachedUserId","getCachedAccountId","setCachedAccountId","clearCachedAccountId"],"sourceRoot":"../../../src","sources":["rum/helper.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,0CAA0C;AAEtE,MAAMC,YAAY,CAAC;EACfC,SAAS,GAAuBC,SAAS;EACzCC,MAAM,GAAuBD,SAAS;EACtCE,SAAS,GAAuBF,SAAS;EAEzCG,MAAMA,CAAA,EAAG;IACL,IAAI,CAACJ,SAAS,GAAGC,SAAS;IAC1B,IAAI,CAACC,MAAM,GAAGD,SAAS;IACvB,IAAI,CAACE,SAAS,GAAGF,SAAS;EAC9B;AACJ;AAEA,MAAMI,WAAW,GAAG,IAAAC,iCAAiB,EACjCR,mBAAmB,EACnB,MAAM,IAAIC,YAAY,CAAC,CAC3B,CAAC;;AAED;AACO,MAAMQ,kBAAkB,GAAGA,CAAA,KAAM;EACpC,OAAOF,WAAW,CAACL,SAAS;AAChC,CAAC;AAACQ,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAEK,MAAME,kBAAkB,GAAIT,SAAiB,IAAK;EACrDK,WAAW,CAACL,SAAS,GAAGA,SAAS;AACrC,CAAC;AAACQ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEK,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACtCL,WAAW,CAACL,SAAS,GAAGC,SAAS;AACrC,CAAC;AAACO,OAAA,CAAAE,oBAAA,GAAAA,oBAAA;AAEK,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,OAAON,WAAW,CAACH,MAAM;AAC7B,CAAC;AAACM,OAAA,CAAAG,eAAA,GAAAA,eAAA;AAEK,MAAMC,eAAe,GAAIV,MAAc,IAAK;EAC/CG,WAAW,CAACH,MAAM,GAAGA,MAAM;AAC/B,CAAC;AAACM,OAAA,CAAAI,eAAA,GAAAA,eAAA;AAEK,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACnCR,WAAW,CAACH,MAAM,GAAGD,SAAS;AAClC,CAAC;AAACO,OAAA,CAAAK,iBAAA,GAAAA,iBAAA;AAEK,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACpC,OAAOT,WAAW,CAACF,SAAS;AAChC,CAAC;AAACK,OAAA,CAAAM,kBAAA,GAAAA,kBAAA;AAEK,MAAMC,kBAAkB,GAAIZ,SAAiB,IAAK;EACrDE,WAAW,CAACF,SAAS,GAAGA,SAAS;AACrC,CAAC;AAACK,OAAA,CAAAO,kBAAA,GAAAA,kBAAA;AAEK,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACtCX,WAAW,CAACF,SAAS,GAAGF,SAAS;AACrC,CAAC;AAACO,OAAA,CAAAQ,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DdRumErrorTracking = void 0;
|
|
7
7
|
var _InternalLog = require("../../InternalLog");
|
|
8
|
-
var _SdkVerbosity = require("../../SdkVerbosity");
|
|
9
|
-
var
|
|
10
|
-
var _errorUtils = require("../../
|
|
8
|
+
var _SdkVerbosity = require("../../config/types/SdkVerbosity");
|
|
9
|
+
var _defaultEncoders = require("../../sdk/AttributesEncoding/defaultEncoders");
|
|
10
|
+
var _errorUtils = require("../../sdk/AttributesEncoding/errorUtils");
|
|
11
|
+
var _types = require("../../types");
|
|
11
12
|
var _jsUtils = require("../../utils/jsUtils");
|
|
12
13
|
var _DdRum = require("../DdRum");
|
|
13
|
-
var _types = require("../types");
|
|
14
14
|
/*
|
|
15
15
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
16
16
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
@@ -53,10 +53,9 @@ class DdRumErrorTracking {
|
|
|
53
53
|
static onGlobalError = (error, isFatal) => {
|
|
54
54
|
const message = (0, _errorUtils.getErrorMessage)(error);
|
|
55
55
|
const stacktrace = (0, _errorUtils.getErrorStackTrace)(error);
|
|
56
|
-
|
|
57
|
-
this.reportError(message, _types.ErrorSource.SOURCE, stacktrace, errorName, {
|
|
56
|
+
this.reportError(message, _types.ErrorSource.SOURCE, stacktrace, {
|
|
58
57
|
'_dd.error.is_crash': isFatal,
|
|
59
|
-
'_dd.error.raw': error
|
|
58
|
+
'_dd.error.raw': _defaultEncoders.errorEncoder.encode(error)
|
|
60
59
|
}).then(async () => {
|
|
61
60
|
DdRumErrorTracking.isInDefaultErrorHandler = true;
|
|
62
61
|
try {
|
|
@@ -74,19 +73,19 @@ class DdRumErrorTracking {
|
|
|
74
73
|
if (DdRumErrorTracking.isInDefaultErrorHandler) {
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
77
|
-
let stack = _errorUtils.
|
|
78
|
-
let errorName = _errorUtils.
|
|
76
|
+
let stack = _errorUtils.ERROR_EMPTY_STACKTRACE;
|
|
77
|
+
let errorName = _errorUtils.ERROR_DEFAULT_NAME;
|
|
79
78
|
for (let i = 0; i < params.length; i += 1) {
|
|
80
79
|
const param = params[i];
|
|
81
80
|
const paramStack = (0, _errorUtils.getErrorStackTrace)(param);
|
|
82
|
-
if (paramStack !== _errorUtils.
|
|
81
|
+
if (paramStack !== _errorUtils.ERROR_EMPTY_STACKTRACE) {
|
|
83
82
|
stack = paramStack;
|
|
84
83
|
}
|
|
85
84
|
const paramErrorName = (0, _errorUtils.getErrorName)(param);
|
|
86
|
-
if (paramErrorName !== _errorUtils.
|
|
85
|
+
if (paramErrorName !== _errorUtils.ERROR_DEFAULT_NAME) {
|
|
87
86
|
errorName = paramErrorName;
|
|
88
87
|
}
|
|
89
|
-
if (errorName !== _errorUtils.
|
|
88
|
+
if (errorName !== _errorUtils.ERROR_DEFAULT_NAME && stack !== _errorUtils.ERROR_EMPTY_STACKTRACE) {
|
|
90
89
|
break;
|
|
91
90
|
}
|
|
92
91
|
}
|
|
@@ -97,15 +96,12 @@ class DdRumErrorTracking {
|
|
|
97
96
|
return (0, _errorUtils.getErrorMessage)(param);
|
|
98
97
|
}
|
|
99
98
|
}).join(' ');
|
|
100
|
-
this.reportError(message, _types.ErrorSource.CONSOLE, stack
|
|
99
|
+
this.reportError(message, _types.ErrorSource.CONSOLE, stack).then(() => {
|
|
101
100
|
DdRumErrorTracking.defaultConsoleError.apply(console, params);
|
|
102
101
|
});
|
|
103
102
|
};
|
|
104
|
-
static reportError = (message, source, stacktrace,
|
|
105
|
-
return
|
|
106
|
-
...context,
|
|
107
|
-
'_dd.error_log.is_crash': true
|
|
108
|
-
}, undefined, source)]);
|
|
103
|
+
static reportError = (message, source, stacktrace, context = {}) => {
|
|
104
|
+
return _DdRum.DdRum.addError(message, source, stacktrace, context);
|
|
109
105
|
};
|
|
110
106
|
}
|
|
111
107
|
exports.DdRumErrorTracking = DdRumErrorTracking;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_InternalLog","require","_SdkVerbosity","
|
|
1
|
+
{"version":3,"names":["_InternalLog","require","_SdkVerbosity","_defaultEncoders","_errorUtils","_types","_jsUtils","_DdRum","DdRumErrorTracking","isTracking","isInDefaultErrorHandler","defaultErrorHandler","_error","_isFatal","defaultConsoleError","_params","startTracking","InternalLog","log","SdkVerbosity","WARN","ErrorUtils","getGlobalHandler","console","error","setGlobalHandler","onGlobalError","onConsoleError","INFO","ERROR","isFatal","message","getErrorMessage","stacktrace","getErrorStackTrace","reportError","ErrorSource","SOURCE","errorEncoder","encode","then","executeWithDelay","params","stack","ERROR_EMPTY_STACKTRACE","errorName","ERROR_DEFAULT_NAME","i","length","param","paramStack","paramErrorName","getErrorName","map","join","CONSOLE","apply","source","context","DdRum","addError","exports"],"sourceRoot":"../../../../src","sources":["rum/instrumentation/DdRumErrorTracking.tsx"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,a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AAKC,kCAAsB,EAClC;QACE;MACJ;IACJ;IAEA,MAAMb,OAAO,GAAGW,MAAM,CACjBW,GAAG,CAACJ,KAAK,IAAI;MACV,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAOA,KAAK;MAChB,CAAC,MAAM;QACH,OAAO,IAAAjB,2BAAe,EAACiB,KAAK,CAAC;MACjC;IACJ,CAAC,CAAC,CACDK,IAAI,CAAC,GAAG,CAAC;IAEd,IAAI,CAACnB,WAAW,CAACJ,OAAO,EAAEK,kBAAW,CAACmB,OAAO,EAAEZ,KAAK,CAAC,CAACH,IAAI,CAAC,MAAM;MAC7DhC,kBAAkB,CAACM,mBAAmB,CAAC0C,KAAK,CAACjC,OAAO,EAAEmB,MAAM,CAAC;IACjE,CAAC,CAAC;EACN,CAAC;EAED,OAAeP,WAAW,GAAGA,CACzBJ,OAAe,EACf0B,MAAmB,EACnBxB,UAAkB,EAClByB,OAAe,GAAG,CAAC,CAAC,KACJ;IAChB,OAAOC,YAAK,CAACC,QAAQ,CAAC7B,OAAO,EAAE0B,MAAM,EAAExB,UAAU,EAAEyB,OAAO,CAAC;EAC/D,CAAC;AACL;AAACG,OAAA,CAAArD,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DdBabelInteractionTracking = void 0;
|
|
7
7
|
var _NativeDdSdk = _interopRequireDefault(require("../../../specs/NativeDdSdk"));
|
|
8
|
+
var _singletonUtils = require("../../../utils/singletonUtils");
|
|
8
9
|
var _DefaultTimeProvider = require("../../../utils/time-provider/DefaultTimeProvider");
|
|
9
10
|
var _constants = require("../../constants");
|
|
10
11
|
var _types = require("../../types");
|
|
@@ -15,12 +16,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
16
|
* Copyright 2016-Present Datadog, Inc.
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class DdBabelInteractionTracking {
|
|
22
|
-
static instance = null;
|
|
23
|
-
static config = {
|
|
19
|
+
const BABEL_INTERACTION_TRACKING_MODULE = 'com.datadog.reactnative.rum.babel_interaction_tracking';
|
|
20
|
+
class BabelInteractionTracking {
|
|
21
|
+
config = {
|
|
24
22
|
trackInteractions: false,
|
|
25
23
|
useAccessibilityLabel: true
|
|
26
24
|
};
|
|
@@ -28,26 +26,18 @@ class DdBabelInteractionTracking {
|
|
|
28
26
|
telemetrySent = false;
|
|
29
27
|
ddRum = null;
|
|
30
28
|
isInitialized = false;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
throw new Error(StateErrors.ALREADY_INITIALIZED);
|
|
34
|
-
}
|
|
35
|
-
if (ddRum) {
|
|
36
|
-
this.ddRum = ddRum;
|
|
37
|
-
}
|
|
38
|
-
DdBabelInteractionTracking.instance = this;
|
|
29
|
+
getInstance() {
|
|
30
|
+
return DdBabelInteractionTracking;
|
|
39
31
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
return DdBabelInteractionTracking.instance;
|
|
32
|
+
attachRumInstance(ddRum) {
|
|
33
|
+
this.ddRum = ddRum;
|
|
34
|
+
this.isInitialized = true;
|
|
45
35
|
}
|
|
46
|
-
|
|
36
|
+
getTelemetryConfig() {
|
|
47
37
|
return {
|
|
48
38
|
babel_plugin: {
|
|
49
39
|
enabled: !!globalThis.__DD_RN_BABEL_PLUGIN_ENABLED__,
|
|
50
|
-
track_interactions: !!
|
|
40
|
+
track_interactions: !!this.config.trackInteractions
|
|
51
41
|
}
|
|
52
42
|
};
|
|
53
43
|
}
|
|
@@ -63,7 +53,7 @@ class DdBabelInteractionTracking {
|
|
|
63
53
|
} = targetObject;
|
|
64
54
|
const {
|
|
65
55
|
useAccessibilityLabel
|
|
66
|
-
} =
|
|
56
|
+
} = this.config;
|
|
67
57
|
const tryContent = () => {
|
|
68
58
|
const content = getContent?.();
|
|
69
59
|
if (content && content.length > 0) {
|
|
@@ -87,7 +77,7 @@ class DdBabelInteractionTracking {
|
|
|
87
77
|
wrapRumAction(func, action, targetObject) {
|
|
88
78
|
return (...args) => {
|
|
89
79
|
if (!this.telemetrySent) {
|
|
90
|
-
_NativeDdSdk.default?.sendTelemetryLog(_constants.BABEL_PLUGIN_TELEMETRY,
|
|
80
|
+
_NativeDdSdk.default?.sendTelemetryLog(_constants.BABEL_PLUGIN_TELEMETRY, this.getTelemetryConfig(), {
|
|
91
81
|
onlyOnce: true
|
|
92
82
|
});
|
|
93
83
|
this.telemetrySent = true;
|
|
@@ -95,7 +85,7 @@ class DdBabelInteractionTracking {
|
|
|
95
85
|
const targetName = this.getTargetName(targetObject);
|
|
96
86
|
const {
|
|
97
87
|
trackInteractions
|
|
98
|
-
} =
|
|
88
|
+
} = this.config;
|
|
99
89
|
if (trackInteractions) {
|
|
100
90
|
this.ddRum?.addAction(action, targetName, {
|
|
101
91
|
'__dd.action_source': _types.ActionSource.BABEL
|
|
@@ -109,5 +99,5 @@ class DdBabelInteractionTracking {
|
|
|
109
99
|
};
|
|
110
100
|
}
|
|
111
101
|
}
|
|
112
|
-
exports.DdBabelInteractionTracking =
|
|
102
|
+
const DdBabelInteractionTracking = exports.DdBabelInteractionTracking = (0, _singletonUtils.getGlobalInstance)(BABEL_INTERACTION_TRACKING_MODULE, () => new BabelInteractionTracking());
|
|
113
103
|
//# sourceMappingURL=DdBabelInteractionTracking.js.map
|
package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeDdSdk","_interopRequireDefault","require","_DefaultTimeProvider","_constants","_types","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_NativeDdSdk","_interopRequireDefault","require","_singletonUtils","_DefaultTimeProvider","_constants","_types","e","__esModule","default","BABEL_INTERACTION_TRACKING_MODULE","BabelInteractionTracking","config","trackInteractions","useAccessibilityLabel","timeProvider","DefaultTimeProvider","telemetrySent","ddRum","isInitialized","getInstance","DdBabelInteractionTracking","attachRumInstance","getTelemetryConfig","babel_plugin","enabled","globalThis","__DD_RN_BABEL_PLUGIN_ENABLED__","track_interactions","getTargetName","targetObject","getContent","options","handlerArgs","componentName","actionName","accessibilityLabel","attrs","tryContent","content","length","getAccessibilityLabel","index","find","x","selectedContent","Object","values","output","useNamePrefix","wrapRumAction","func","action","args","DdSdk","sendTelemetryLog","BABEL_PLUGIN_TELEMETRY","onlyOnce","targetName","addAction","ActionSource","BABEL","now","catch","Error","telemetryError","message","stack","exports","getGlobalInstance"],"sourceRoot":"../../../../../src","sources":["rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAA2C,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAb3C;AACA;AACA;AACA;AACA;;AAWA,MAAMG,iCAAiC,GACnC,wDAAwD;AAiB5D,MAAMC,wBAAwB,CAAC;EAC3BC,MAAM,GAAgB;IAClBC,iBAAiB,EAAE,KAAK;IACxBC,qBAAqB,EAAE;EAC3B,CAAC;EAEOC,YAAY,GAAiB,IAAIC,wCAAmB,CAAC,CAAC;EAEtDC,aAAa,GAAY,KAAK;EAE9BC,KAAK,GAAwB,IAAI;EAEzCC,aAAa,GAAY,KAAK;EAE9BC,WAAWA,CAAA,EAAG;IACV,OAAOC,0BAA0B;EACrC;EAEAC,iBAAiBA,CAACJ,KAAmB,EAAE;IACnC,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,aAA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Module", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.UNKNOWN_TARGET_NAME = exports.DdEventsInterceptor = void 0;
|
|
7
7
|
var _InternalLog = require("../../../InternalLog");
|
|
8
|
-
var _SdkVerbosity = require("../../../SdkVerbosity");
|
|
8
|
+
var _SdkVerbosity = require("../../../config/types/SdkVerbosity");
|
|
9
9
|
var _DdRum = require("../../DdRum");
|
|
10
10
|
var _types = require("../../types");
|
|
11
11
|
/*
|
package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.DdRumUserInteractionTracking = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _InternalLog = require("../../../InternalLog");
|
|
9
|
-
var _SdkVerbosity = require("../../../SdkVerbosity");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _SdkVerbosity = require("../../../config/types/SdkVerbosity");
|
|
10
|
+
var _errorUtils = require("../../../sdk/AttributesEncoding/errorUtils");
|
|
11
|
+
var _DdSdkInternal = require("../../../sdk/DdSdkInternal");
|
|
12
12
|
var _constants = require("../../constants");
|
|
13
13
|
var _DdBabelInteractionTracking = require("./DdBabelInteractionTracking");
|
|
14
14
|
var _DdEventsInterceptor = require("./DdEventsInterceptor");
|
|
@@ -25,6 +25,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
25
25
|
/**
|
|
26
26
|
* Provides RUM auto-instrumentation feature to track user interaction as RUM events.
|
|
27
27
|
* For now we are only covering the "onPress" events.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated since 3.0.0 – Use `@datadog/mobile-react-native-babel-plugin` instead.
|
|
28
30
|
*/
|
|
29
31
|
class DdRumUserInteractionTracking {
|
|
30
32
|
static isTracking = false;
|
|
@@ -51,14 +53,18 @@ class DdRumUserInteractionTracking {
|
|
|
51
53
|
* Starts tracking user interactions and sends a RUM Action event every time a new interaction was detected.
|
|
52
54
|
* Please note that we are only considering as valid - for - tracking only the user interactions that have
|
|
53
55
|
* a visible output (either an UI state change or a Resource request)
|
|
56
|
+
*
|
|
57
|
+
* @deprecated since version 3.0.0
|
|
54
58
|
*/
|
|
55
59
|
static startTracking(options) {
|
|
60
|
+
_InternalLog.InternalLog.log('[DEPRECATED] Interaction tracking via the core React Native SDK has been deprecated since v3.0.0. ' + 'Please migrate to @datadog/mobile-react-native-babel-plugin: https://www.npmjs.com/package/@datadog/mobile-react-native-babel-plugin.', _SdkVerbosity.SdkVerbosity.WARN);
|
|
61
|
+
|
|
56
62
|
// extra safety to avoid wrapping more than 1 time this function
|
|
57
63
|
if (DdRumUserInteractionTracking.isTracking) {
|
|
58
64
|
_InternalLog.InternalLog.log('Datadog SDK is already tracking interactions', _SdkVerbosity.SdkVerbosity.WARN);
|
|
59
65
|
return;
|
|
60
66
|
}
|
|
61
|
-
|
|
67
|
+
_DdSdkInternal.NativeDdSdk?.sendTelemetryLog(_constants.BABEL_PLUGIN_TELEMETRY, _DdBabelInteractionTracking.DdBabelInteractionTracking.getTelemetryConfig(), {
|
|
62
68
|
onlyOnce: true
|
|
63
69
|
});
|
|
64
70
|
DdRumUserInteractionTracking.eventsInterceptor = new _DdEventsInterceptor.DdEventsInterceptor(options);
|
|
@@ -83,7 +89,7 @@ class DdRumUserInteractionTracking {
|
|
|
83
89
|
};
|
|
84
90
|
}
|
|
85
91
|
} catch (e) {
|
|
86
|
-
|
|
92
|
+
_DdSdkInternal.NativeDdSdk.telemetryDebug((0, _errorUtils.getErrorMessage)(e));
|
|
87
93
|
}
|
|
88
94
|
const originalMemo = _react.default.memo;
|
|
89
95
|
_react.default.memo = (component, propsAreEqual) => {
|
|
@@ -116,6 +122,10 @@ class DdRumUserInteractionTracking {
|
|
|
116
122
|
DdRumUserInteractionTracking.isTracking = true;
|
|
117
123
|
_InternalLog.InternalLog.log('Datadog SDK is tracking interactions', _SdkVerbosity.SdkVerbosity.INFO);
|
|
118
124
|
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated since version 3.0.0
|
|
128
|
+
*/
|
|
119
129
|
static stopTracking() {
|
|
120
130
|
_react.default.createElement = this.originalCreateElement;
|
|
121
131
|
_react.default.memo = this.originalMemo;
|
package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_InternalLog","_SdkVerbosity","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_InternalLog","_SdkVerbosity","_errorUtils","_DdSdkInternal","_constants","_DdBabelInteractionTracking","_DdEventsInterceptor","_NoOpEventsInterceptor","_ShallowObjectEqualityChecker","_getJsxRuntime","e","__esModule","default","DdRumUserInteractionTracking","isTracking","eventsInterceptor","NoOpEventsInterceptor","originalCreateElement","React","createElement","originalMemo","memo","originalJsx","originalDevJsx","patchCreateElementFunction","originalFunction","element","props","rest","onPress","originalOnPress","args","interceptOnPress","__DATADOG_INTERNAL_ORIGINAL_ON_PRESS__","startTracking","options","InternalLog","log","SdkVerbosity","WARN","NativeDdSdk","sendTelemetryLog","BABEL_PLUGIN_TELEMETRY","DdBabelInteractionTracking","getTelemetryConfig","onlyOnce","DdEventsInterceptor","original","jsxRuntime","jsxDevRuntime","getJsxRuntimes","jsx","jsxDEV","telemetryDebug","getErrorMessage","component","propsAreEqual","prev","next","areObjectShallowEqual","_prevOnPress","partialPrevProps","prevProps","_nextOnPress","partialNextProps","nextProps","INFO","stopTracking","exports"],"sourceRoot":"../../../../../src","sources":["rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GA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AI,CAACF,qBAAqB;IAChDC,cAAK,CAACG,IAAI,GAAG,IAAI,CAACD,YAAY;IAC9BP,4BAA4B,CAACC,UAAU,GAAG,KAAK;IAC/C,IAAI,IAAI,CAACQ,WAAW,IAAI,IAAI,CAACC,cAAc,EAAE;MACzC,MAAM,CAACyB,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,6BAAc,EAAC,CAAC;MAEpDF,UAAU,CAACG,GAAG,GAAG,IAAI,CAAC7B,WAAW;MACjC2B,aAAa,CAACG,MAAM,GAAG,IAAI,CAAC7B,cAAc;MAE1C,IAAI,CAACD,WAAW,GAAG,IAAI;MACvB,IAAI,CAACC,cAAc,GAAG,IAAI;IAC9B;EACJ;AACJ;AAAC6C,OAAA,CAAAvD,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -4,55 +4,67 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DdRumResourceTracking = void 0;
|
|
7
|
+
var _bigInteger = _interopRequireDefault(require("big-integer"));
|
|
7
8
|
var _InternalLog = require("../../../InternalLog");
|
|
8
|
-
var _SdkVerbosity = require("../../../SdkVerbosity");
|
|
9
|
+
var _SdkVerbosity = require("../../../config/types/SdkVerbosity");
|
|
10
|
+
var _singletonUtils = require("../../../utils/singletonUtils");
|
|
11
|
+
var _distributedTracingSampling = require("./distributedTracing/distributedTracingSampling");
|
|
9
12
|
var _firstPartyHosts = require("./distributedTracing/firstPartyHosts");
|
|
10
|
-
var _ResourceReporter = require("./requestProxy/XHRProxy/DatadogRumResource/ResourceReporter");
|
|
11
|
-
var _internalDevResourceBlocklist = require("./requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist");
|
|
12
13
|
var _XHRProxy = require("./requestProxy/XHRProxy/XHRProxy");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
15
|
/*
|
|
14
16
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
15
17
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
16
18
|
* Copyright 2016-Present Datadog, Inc.
|
|
17
19
|
*/
|
|
18
20
|
|
|
21
|
+
const RUM_RESOURCE_TRACKING_MODULE = 'com.datadog.reactnative.rum.resource_tracking';
|
|
22
|
+
|
|
19
23
|
/**
|
|
20
24
|
* Provides RUM auto-instrumentation feature to track resources (fetch, XHR, axios) as RUM events.
|
|
21
25
|
*/
|
|
22
|
-
class
|
|
23
|
-
|
|
26
|
+
class RumResourceTracking {
|
|
27
|
+
_isTracking = false;
|
|
28
|
+
_requestProxy = null;
|
|
29
|
+
_maxSampledTraceId = null;
|
|
30
|
+
get isTracking() {
|
|
31
|
+
return this._isTracking;
|
|
32
|
+
}
|
|
33
|
+
get maxSampledTraceId() {
|
|
34
|
+
return this._maxSampledTraceId ?? (0, _bigInteger.default)(0);
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
/**
|
|
25
38
|
* Starts tracking resources and sends a RUM Resource event every time a network request is detected.
|
|
26
39
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
startTracking({
|
|
41
|
+
resourceTraceSampleRate,
|
|
29
42
|
firstPartyHosts
|
|
30
43
|
}) {
|
|
31
44
|
// extra safety to avoid proxying the XHR class twice
|
|
32
|
-
if (
|
|
45
|
+
if (this._isTracking) {
|
|
33
46
|
_InternalLog.InternalLog.log('Datadog SDK is already tracking XHR resources', _SdkVerbosity.SdkVerbosity.WARN);
|
|
34
47
|
return;
|
|
35
48
|
}
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
this.requestProxy.onTrackingStart({
|
|
41
|
-
tracingSamplingRate,
|
|
49
|
+
this._requestProxy = _XHRProxy.XHRProxy.createWithResourceReporter();
|
|
50
|
+
this._requestProxy.onTrackingStart({
|
|
51
|
+
tracingSamplingRate: resourceTraceSampleRate,
|
|
42
52
|
firstPartyHostsRegexMap: (0, _firstPartyHosts.firstPartyHostsRegexMapBuilder)(firstPartyHosts)
|
|
43
53
|
});
|
|
44
54
|
_InternalLog.InternalLog.log('Datadog SDK is tracking XHR resources', _SdkVerbosity.SdkVerbosity.INFO);
|
|
45
|
-
|
|
55
|
+
this._isTracking = true;
|
|
56
|
+
_distributedTracingSampling.DistributedTracingSampling.setResourceTraceSampleRate(resourceTraceSampleRate);
|
|
46
57
|
}
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
if (this.
|
|
51
|
-
this.
|
|
58
|
+
stopTracking() {
|
|
59
|
+
if (this._isTracking) {
|
|
60
|
+
this._isTracking = false;
|
|
61
|
+
if (this._requestProxy) {
|
|
62
|
+
this._requestProxy.onTrackingStop();
|
|
52
63
|
}
|
|
53
|
-
this.
|
|
64
|
+
this._requestProxy = null;
|
|
65
|
+
this._maxSampledTraceId = null;
|
|
54
66
|
}
|
|
55
67
|
}
|
|
56
68
|
}
|
|
57
|
-
exports.DdRumResourceTracking =
|
|
69
|
+
const DdRumResourceTracking = exports.DdRumResourceTracking = (0, _singletonUtils.getGlobalInstance)(RUM_RESOURCE_TRACKING_MODULE, () => new RumResourceTracking());
|
|
58
70
|
//# sourceMappingURL=DdRumResourceTracking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_bigInteger","_interopRequireDefault","require","_InternalLog","_SdkVerbosity","_singletonUtils","_distributedTracingSampling","_firstPartyHosts","_XHRProxy","e","__esModule","default","RUM_RESOURCE_TRACKING_MODULE","RumResourceTracking","_isTracking","_requestProxy","_maxSampledTraceId","isTracking","maxSampledTraceId","BigInt","startTracking","resourceTraceSampleRate","firstPartyHosts","InternalLog","log","SdkVerbosity","WARN","XHRProxy","createWithResourceReporter","onTrackingStart","tracingSamplingRate","firstPartyHostsRegexMap","firstPartyHostsRegexMapBuilder","INFO","DistributedTracingSampling","setResourceTraceSampleRate","stopTracking","onTrackingStop","DdRumResourceTracking","exports","getGlobalInstance"],"sourceRoot":"../../../../../src","sources":["rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx"],"mappings":";;;;;;AAMA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAGA,IAAAI,2BAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAA4D,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAf5D;AACA;AACA;AACA;AACA;;AAcA,MAAMG,4BAA4B,GAC9B,+CAA+C;;AAEnD;AACA;AACA;AACA,MAAMC,mBAAmB,CAAC;EACdC,WAAW,GAAG,KAAK;EACnBC,aAAa,GAAwB,IAAI;EACzCC,kBAAkB,GAA6B,IAAI;EAE3D,IAAIC,UAAUA,CAAA,EAAY;IACtB,OAAO,IAAI,CAACH,WAAW;EAC3B;EAEA,IAAII,iBAAiBA,CAAA,EAAsB;IACvC,OAAO,IAAI,CAACF,kBAAkB,IAAI,IAAAG,mBAAM,EAAC,CAAC,CAAC;EAC/C;;EAEA;AACJ;AACA;EACIC,aAAaA,CAAC;IACVC,uBAAuB;IACvBC;EAIJ,CAAC,EAAQ;IACL;IACA,IAAI,IAAI,CAACR,WAAW,EAAE;MAClBS,wBAAW,CAACC,GAAG,CACX,+CAA+C,EAC/CC,0BAAY,CAACC,IACjB,CAAC;MACD;IACJ;IAEA,IAAI,CAACX,aAAa,GAAGY,kBAAQ,CAACC,0BAA0B,CAAC,CAAC;IAC1D,IAAI,CAACb,aAAa,CAACc,eAAe,CAAC;MAC/BC,mBAAmB,EAAET,uBAAuB;MAC5CU,uBAAuB,EAAE,IAAAC,+CAA8B,EACnDV,eACJ;IACJ,CAAC,CAAC;IAEFC,wBAAW,CAACC,GAAG,CACX,uCAAuC,EACvCC,0BAAY,CAACQ,IACjB,CAAC;IAED,IAAI,CAACnB,WAAW,GAAG,IAAI;IACvBoB,sDAA0B,CAACC,0BAA0B,CACjDd,uBACJ,CAAC;EACL;EAEAe,YAAYA,CAAA,EAAS;IACjB,IAAI,IAAI,CAACtB,WAAW,EAAE;MAClB,IAAI,CAACA,WAAW,GAAG,KAAK;MACxB,IAAI,IAAI,CAACC,aAAa,EAAE;QACpB,IAAI,CAACA,aAAa,CAACsB,cAAc,CAAC,CAAC;MACvC;MACA,IAAI,CAACtB,aAAa,GAAG,IAAI;MACzB,IAAI,CAACC,kBAAkB,GAAG,IAAI;IAClC;EACJ;AACJ;AAEO,MAAMsB,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,IAAAE,iCAAiB,EAClD5B,4BAA4B,EAC5B,MAAM,IAAIC,mBAAmB,CAAC,CAClC,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DatadogTracingContext = void 0;
|
|
7
|
+
var _baggageHeaderUtils = require("../requestProxy/XHRProxy/baggageHeaderUtils");
|
|
7
8
|
var _DatadogTracingIdentifier = require("./DatadogTracingIdentifier");
|
|
9
|
+
var _headers = require("./headers");
|
|
8
10
|
/*
|
|
9
11
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
12
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
@@ -17,7 +19,7 @@ var _DatadogTracingIdentifier = require("./DatadogTracingIdentifier");
|
|
|
17
19
|
*/
|
|
18
20
|
class DatadogTracingContext {
|
|
19
21
|
constructor(requestHeaders, resourceContext, traceId, spanId) {
|
|
20
|
-
this.headersForRequest = requestHeaders;
|
|
22
|
+
this.headersForRequest = this.processHeaders(requestHeaders);
|
|
21
23
|
this.rumResourceContext = resourceContext;
|
|
22
24
|
this.traceId = traceId ? new _DatadogTracingIdentifier.DatadogTracingIdentifier(traceId) : undefined;
|
|
23
25
|
this.spanId = spanId ? new _DatadogTracingIdentifier.DatadogTracingIdentifier(spanId) : undefined;
|
|
@@ -72,6 +74,24 @@ class DatadogTracingContext {
|
|
|
72
74
|
inject(key, this.rumResourceContext[key]);
|
|
73
75
|
});
|
|
74
76
|
}
|
|
77
|
+
processHeaders(requestHeaders) {
|
|
78
|
+
const baggageHeaderEntries = requestHeaders.filter(({
|
|
79
|
+
header,
|
|
80
|
+
value
|
|
81
|
+
}) => header === _headers.BAGGAGE_HEADER_KEY && value).map(({
|
|
82
|
+
value
|
|
83
|
+
}) => value);
|
|
84
|
+
const baggageHeader = (0, _baggageHeaderUtils.formatBaggageHeader)(new Set(baggageHeaderEntries));
|
|
85
|
+
if (!baggageHeader) {
|
|
86
|
+
return requestHeaders;
|
|
87
|
+
}
|
|
88
|
+
return requestHeaders.filter(({
|
|
89
|
+
header
|
|
90
|
+
}) => header !== _headers.BAGGAGE_HEADER_KEY).concat({
|
|
91
|
+
header: _headers.BAGGAGE_HEADER_KEY,
|
|
92
|
+
value: baggageHeader
|
|
93
|
+
});
|
|
94
|
+
}
|
|
75
95
|
}
|
|
76
96
|
exports.DatadogTracingContext = DatadogTracingContext;
|
|
77
97
|
//# sourceMappingURL=DatadogTracingContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_baggageHeaderUtils","require","_DatadogTracingIdentifier","_headers","DatadogTracingContext","constructor","requestHeaders","resourceContext","traceId","spanId","headersForRequest","processHeaders","rumResourceContext","DatadogTracingIdentifier","undefined","getHeadersForRequest","Object","fromEntries","map","header","value","getHeadersForRequestAsArray","getRumResourceContext","injectHeadersForRequest","inject","forEach","injectRumResourceContext","keys","key","baggageHeaderEntries","filter","BAGGAGE_HEADER_KEY","baggageHeader","formatBaggageHeader","Set","concat","exports"],"sourceRoot":"../../../../../../src","sources":["rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts"],"mappings":";;;;;;AAMA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,IAAAC,yBAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAVA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACO,MAAMG,qBAAqB,CAAC;EAM/BC,WAAWA,CACPC,cAAmD,EACnDC,eAAgD,EAChDC,OAAmC,EACnCC,MAAiC,EACnC;IACE,IAAI,CAACC,iBAAiB,GAAG,IAAI,CAACC,cAAc,CAACL,cAAc,CAAC;IAC5D,IAAI,CAACM,kBAAkB,GAAGL,eAAe;IACzC,IAAI,CAACC,OAAO,GAAGA,OAAO,GAChB,IAAIK,kDAAwB,CAACL,OAAO,CAAC,GACrCM,SAAS;IACf,IAAI,CAACL,MAAM,GAAGA,MAAM,GAAG,IAAII,kDAAwB,CAACJ,MAAM,CAAC,GAAGK,SAAS;EAC3E;;EAEA;AACJ;AACA;AACA;EACIC,oBAAoBA,CAAA,EAA2B;IAC3C,OAAOC,MAAM,CAACC,WAAW,CACrB,IAAI,CAACP,iBAAiB,CAACQ,GAAG,CAAC,CAAC;MAAEC,MAAM;MAAEC;IAAM,CAAC,KAAK,CAACD,MAAM,EAAEC,KAAK,CAAC,CACrE,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACIC,2BAA2BA,CAAA,EAAwC;IAC/D,OAAO,CAAC,GAAG,IAAI,CAACX,iBAAiB,CAAC;EACtC;;EAEA;AACJ;AACA;AACA;EACIY,qBAAqBA,CAAA,EAAoC;IACrD,OAAO;MAAE,GAAG,IAAI,CAACV;IAAmB,CAAC;EACzC;;EAEA;AACJ;AACA;AACA;EACIW,uBAAuBA,CAACC,MAA+C,EAAE;IACrE,IAAI,CAACd,iBAAiB,CAACe,OAAO,CAAC,CAAC;MAAEN,MAAM;MAAEC;IAAM,CAAC,KAC7CI,MAAM,CAACL,MAAM,EAAEC,KAAK,CACxB,CAAC;EACL;;EAEA;AACJ;AACA;AACA;EACIM,wBAAwBA,CACpBF,MAA2D,EAC7D;IACER,MAAM,CAACW,IAAI,CAAC,IAAI,CAACf,kBAAkB,CAAC,CAACa,OAAO,CAAEG,GAAW,IAAK;MAC1DJ,MAAM,CAACI,GAAG,EAAE,IAAI,CAAChB,kBAAkB,CAACgB,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC;EACN;EAEQjB,cAAcA,CAClBL,cAAmD,EACrD;IACE,MAAMuB,oBAAoB,GAAGvB,cAAc,CACtCwB,MAAM,CACH,CAAC;MAAEX,MAAM;MAAEC;IAAM,CAAC,KAAKD,MAAM,KAAKY,2BAAkB,IAAIX,KAC5D,CAAC,CACAF,GAAG,CAAC,CAAC;MAAEE;IAAM,CAAC,KAAKA,KAAK,CAAC;IAC9B,MAAMY,aAAa,GAAG,IAAAC,uCAAmB,EACrC,IAAIC,GAAG,CAACL,oBAAoB,CAChC,CAAC;IACD,IAAI,CAACG,aAAa,EAAE;MAChB,OAAO1B,cAAc;IACzB;IAEA,OAAOA,cAAc,CAChBwB,MAAM,CAAC,CAAC;MAAEX;IAAO,CAAC,KAAKA,MAAM,KAAKY,2BAAkB,CAAC,CACrDI,MAAM,CAAC;MAAEhB,MAAM,EAAEY,2BAAkB;MAAEX,KAAK,EAAEY;IAAc,CAAC,CAAC;EACrE;AACJ;AAACI,OAAA,CAAAhC,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TracingIdentifier = exports.TracingIdType = exports.TracingIdFormat = void 0;
|
|
6
|
+
exports.TracingIdentifier = exports.TracingIdType = exports.TracingIdFormat = exports.MAX_TRACE_ID = void 0;
|
|
7
7
|
var _bigInteger = _interopRequireDefault(require("big-integer"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
/*
|
|
@@ -11,6 +11,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
11
11
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
12
12
|
* Copyright 2016-Present Datadog, Inc.
|
|
13
13
|
*/
|
|
14
|
+
|
|
15
|
+
const MAX_TRACE_ID = exports.MAX_TRACE_ID = _bigInteger.default.one.shiftLeft(64).minus(_bigInteger.default.one);
|
|
16
|
+
|
|
14
17
|
/**
|
|
15
18
|
* Available formats for representing the {@link TracingIdentifier} as a string.
|
|
16
19
|
*/
|
|
@@ -116,12 +119,22 @@ class TracingIdentifier {
|
|
|
116
119
|
return new TracingIdentifier(TracingIdType.span);
|
|
117
120
|
}
|
|
118
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Crate a Tracing Identifier from a given BigInt ID and type.
|
|
124
|
+
* @param id the BigInt ID.
|
|
125
|
+
* @param type the type of tracing identifier.
|
|
126
|
+
* @returns the generated {@link TraceId} or {@link SpanId}.
|
|
127
|
+
*/
|
|
128
|
+
static fromBigInt(id, type) {
|
|
129
|
+
return new TracingIdentifier(type, id);
|
|
130
|
+
}
|
|
131
|
+
|
|
119
132
|
/**
|
|
120
133
|
* Private constructor to initialize the {@link TracingIdentifier} based on the given
|
|
121
134
|
* {@link TracingIdType}.
|
|
122
135
|
*/
|
|
123
|
-
constructor(type) {
|
|
124
|
-
this.id = this.generateUUID(type);
|
|
136
|
+
constructor(type, id) {
|
|
137
|
+
this.id = id ?? this.generateUUID(type);
|
|
125
138
|
this.type = type;
|
|
126
139
|
}
|
|
127
140
|
|