@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
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { AttributeEncoder } from '../../sdk/AttributesEncoding/types';
|
|
7
|
+
import type { SdkVerbosity, ProxyConfiguration } from '../types';
|
|
8
|
+
import {
|
|
9
|
+
TrackingConsent,
|
|
10
|
+
BatchProcessingLevel,
|
|
11
|
+
BatchSize,
|
|
12
|
+
UploadFrequency
|
|
13
|
+
} from '../types';
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
CoreConfigurationOptions,
|
|
17
|
+
CoreConfigurationType
|
|
18
|
+
} from './CoreConfiguration.type';
|
|
19
|
+
import { LogsConfiguration } from './LogsConfiguration';
|
|
20
|
+
import { RumConfiguration } from './RumConfiguration';
|
|
21
|
+
import { TraceConfiguration } from './TraceConfiguration';
|
|
22
|
+
|
|
23
|
+
const DEFAULTS = {
|
|
24
|
+
getAdditionalConfiguration: () => ({}),
|
|
25
|
+
attributeEncoders: [] as AttributeEncoder<any>[],
|
|
26
|
+
batchProcessingLevel: BatchProcessingLevel.MEDIUM,
|
|
27
|
+
batchSize: BatchSize.MEDIUM,
|
|
28
|
+
logsConfiguration: undefined,
|
|
29
|
+
proxyConfiguration: undefined,
|
|
30
|
+
rumConfiguration: undefined,
|
|
31
|
+
service: undefined,
|
|
32
|
+
site: 'US1',
|
|
33
|
+
traceConfiguration: undefined,
|
|
34
|
+
uploadFrequency: UploadFrequency.AVERAGE,
|
|
35
|
+
verbosity: undefined,
|
|
36
|
+
version: undefined,
|
|
37
|
+
versionSuffix: undefined,
|
|
38
|
+
trackingConsent: TrackingConsent.GRANTED
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The Core configuration class.
|
|
43
|
+
* Used to configure the SDK functionality at initialization.
|
|
44
|
+
*/
|
|
45
|
+
class CoreConfiguration implements CoreConfigurationType {
|
|
46
|
+
// Additional Configuration
|
|
47
|
+
public additionalConfiguration?: {
|
|
48
|
+
[k: string]: any;
|
|
49
|
+
} = DEFAULTS.getAdditionalConfiguration();
|
|
50
|
+
|
|
51
|
+
// Attribute Encoders
|
|
52
|
+
public attributeEncoders: AttributeEncoder<any>[] =
|
|
53
|
+
DEFAULTS.attributeEncoders;
|
|
54
|
+
|
|
55
|
+
// Batch Processing Level
|
|
56
|
+
public batchProcessingLevel: BatchProcessingLevel =
|
|
57
|
+
DEFAULTS.batchProcessingLevel;
|
|
58
|
+
|
|
59
|
+
// Batch Size
|
|
60
|
+
public batchSize: BatchSize = DEFAULTS.batchSize;
|
|
61
|
+
|
|
62
|
+
// Logs Configuration
|
|
63
|
+
public logsConfiguration?: LogsConfiguration = DEFAULTS.logsConfiguration;
|
|
64
|
+
|
|
65
|
+
// Proxy Configuration
|
|
66
|
+
public proxyConfiguration?: ProxyConfiguration =
|
|
67
|
+
DEFAULTS.proxyConfiguration;
|
|
68
|
+
|
|
69
|
+
// RUM Configuration
|
|
70
|
+
public rumConfiguration?: RumConfiguration = DEFAULTS.rumConfiguration;
|
|
71
|
+
|
|
72
|
+
// Service Name
|
|
73
|
+
public service?: string = DEFAULTS.service;
|
|
74
|
+
|
|
75
|
+
// Datadog Site
|
|
76
|
+
public site: string = DEFAULTS.site;
|
|
77
|
+
|
|
78
|
+
// Trace Configuration
|
|
79
|
+
public traceConfiguration?: TraceConfiguration =
|
|
80
|
+
DEFAULTS.traceConfiguration;
|
|
81
|
+
|
|
82
|
+
// Batch Upload Frequency
|
|
83
|
+
public uploadFrequency: UploadFrequency = DEFAULTS.uploadFrequency;
|
|
84
|
+
|
|
85
|
+
// SDK Logs Verbosity
|
|
86
|
+
public verbosity?: SdkVerbosity = DEFAULTS.verbosity;
|
|
87
|
+
|
|
88
|
+
// Custom Version Name
|
|
89
|
+
public version?: string = DEFAULTS.version;
|
|
90
|
+
|
|
91
|
+
// Custom Version Suffix
|
|
92
|
+
public versionSuffix?: string = DEFAULTS.versionSuffix;
|
|
93
|
+
|
|
94
|
+
constructor(
|
|
95
|
+
readonly clientToken: string,
|
|
96
|
+
readonly env: string,
|
|
97
|
+
readonly trackingConsent: TrackingConsent = DEFAULTS.trackingConsent,
|
|
98
|
+
options: CoreConfigurationOptions = {}
|
|
99
|
+
) {
|
|
100
|
+
const {
|
|
101
|
+
rumConfiguration,
|
|
102
|
+
logsConfiguration,
|
|
103
|
+
traceConfiguration,
|
|
104
|
+
...rest
|
|
105
|
+
} = options;
|
|
106
|
+
|
|
107
|
+
Object.assign(this, rest);
|
|
108
|
+
if (rumConfiguration !== undefined) {
|
|
109
|
+
this.rumConfiguration = new RumConfiguration(
|
|
110
|
+
rumConfiguration.applicationId,
|
|
111
|
+
rumConfiguration.trackInteractions,
|
|
112
|
+
rumConfiguration.trackResources,
|
|
113
|
+
rumConfiguration.trackErrors,
|
|
114
|
+
rumConfiguration
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (logsConfiguration !== undefined) {
|
|
119
|
+
this.logsConfiguration = new LogsConfiguration(logsConfiguration);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (traceConfiguration !== undefined) {
|
|
123
|
+
this.traceConfiguration = new TraceConfiguration(
|
|
124
|
+
traceConfiguration
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { DEFAULTS as CORE_DEFAULTS, CoreConfiguration };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { AttributeEncoder } from '../../sdk/AttributesEncoding/types';
|
|
7
|
+
import type {
|
|
8
|
+
BatchProcessingLevel,
|
|
9
|
+
BatchSize,
|
|
10
|
+
ProxyConfiguration,
|
|
11
|
+
SdkVerbosity,
|
|
12
|
+
TrackingConsent,
|
|
13
|
+
UploadFrequency
|
|
14
|
+
} from '../types';
|
|
15
|
+
|
|
16
|
+
import type { LogsConfigurationType } from './LogsConfiguration.type';
|
|
17
|
+
import type { RumConfigurationType } from './RumConfiguration.type';
|
|
18
|
+
import type { TraceConfigurationType } from './TraceConfiguration.type';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Required core configuration values.
|
|
22
|
+
*/
|
|
23
|
+
export interface CoreConfigurationRequired {
|
|
24
|
+
/**
|
|
25
|
+
* The Datadog client token.
|
|
26
|
+
*/
|
|
27
|
+
clientToken: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The environment name (e.g. prod, staging).
|
|
31
|
+
*/
|
|
32
|
+
env: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Initial tracking consent value.
|
|
36
|
+
*/
|
|
37
|
+
trackingConsent: TrackingConsent;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional core configuration values.
|
|
42
|
+
*/
|
|
43
|
+
export interface CoreConfigurationOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Additional arbitrary configuration values.
|
|
46
|
+
*/
|
|
47
|
+
additionalConfiguration?: { [k: string]: any };
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Custom attribute encoders.
|
|
51
|
+
*/
|
|
52
|
+
attributeEncoders?: AttributeEncoder<any>[];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Batch size used when sending data.
|
|
56
|
+
*/
|
|
57
|
+
batchSize?: BatchSize;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Processing level used when batching data.
|
|
61
|
+
*/
|
|
62
|
+
batchProcessingLevel?: BatchProcessingLevel;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Logs feature configuration.
|
|
66
|
+
*/
|
|
67
|
+
logsConfiguration?: LogsConfigurationType;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Proxy configuration.
|
|
71
|
+
*/
|
|
72
|
+
proxyConfiguration?: ProxyConfiguration;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* RUM feature configuration.
|
|
76
|
+
*/
|
|
77
|
+
rumConfiguration?: RumConfigurationType;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Name of the service.
|
|
81
|
+
*/
|
|
82
|
+
service?: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Datadog site to send data to.
|
|
86
|
+
*/
|
|
87
|
+
site?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Trace feature configuration.
|
|
91
|
+
*/
|
|
92
|
+
traceConfiguration?: TraceConfigurationType;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Frequency used to upload data batches.
|
|
96
|
+
*/
|
|
97
|
+
uploadFrequency?: UploadFrequency;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Overrides the reported application version.
|
|
101
|
+
*/
|
|
102
|
+
version?: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Suffix added to the reported application version.
|
|
106
|
+
*/
|
|
107
|
+
versionSuffix?: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* SDK internal logging verbosity.
|
|
111
|
+
*/
|
|
112
|
+
verbosity?: SdkVerbosity;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Complete core configuration type.
|
|
117
|
+
*/
|
|
118
|
+
export type CoreConfigurationType = CoreConfigurationRequired &
|
|
119
|
+
CoreConfigurationOptions;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { AttributeEncoder } from '../../sdk/AttributesEncoding/types';
|
|
7
|
+
import type { BatchProcessingLevel } from '../types';
|
|
8
|
+
|
|
9
|
+
import type { LogsNativeConfiguration } from './LogsConfigurationNative';
|
|
10
|
+
import type { RumNativeConfiguration } from './RumConfigurationNative';
|
|
11
|
+
import type { TraceNativeConfiguration } from './TraceConfigurationNative';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A configuration object to initialize Datadog's features.
|
|
15
|
+
*/
|
|
16
|
+
export class DdSdkNativeConfiguration {
|
|
17
|
+
constructor(
|
|
18
|
+
readonly additionalConfiguration: object,
|
|
19
|
+
readonly clientToken: string,
|
|
20
|
+
readonly env: string,
|
|
21
|
+
readonly site: string,
|
|
22
|
+
readonly service: string | undefined,
|
|
23
|
+
readonly verbosity: string | undefined,
|
|
24
|
+
readonly trackingConsent: string,
|
|
25
|
+
readonly uploadFrequency: string,
|
|
26
|
+
readonly batchSize: string,
|
|
27
|
+
readonly batchProcessingLevel: BatchProcessingLevel,
|
|
28
|
+
readonly proxyConfiguration:
|
|
29
|
+
| {
|
|
30
|
+
type: string;
|
|
31
|
+
address: string;
|
|
32
|
+
port: number;
|
|
33
|
+
username?: string;
|
|
34
|
+
password?: string;
|
|
35
|
+
}
|
|
36
|
+
| undefined,
|
|
37
|
+
readonly attributeEncoders: AttributeEncoder<any>[],
|
|
38
|
+
readonly rumConfiguration: RumNativeConfiguration | undefined,
|
|
39
|
+
readonly logsConfiguration: LogsNativeConfiguration | undefined,
|
|
40
|
+
readonly traceConfiguration: TraceNativeConfiguration | undefined,
|
|
41
|
+
readonly configurationForTelemetry: {
|
|
42
|
+
initializationType: string;
|
|
43
|
+
trackErrors: boolean;
|
|
44
|
+
trackInteractions: boolean;
|
|
45
|
+
trackNetworkRequests: boolean;
|
|
46
|
+
reactVersion: string;
|
|
47
|
+
reactNativeVersion: string;
|
|
48
|
+
} // eslint-disable-next-line no-empty-function
|
|
49
|
+
) {}
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { LogEventMapper } from '../../types';
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
LogsConfigurationOptions,
|
|
10
|
+
LogsConfigurationType
|
|
11
|
+
} from './LogsConfiguration.type';
|
|
12
|
+
|
|
13
|
+
const DEFAULTS = {
|
|
14
|
+
bundleLogsWithRum: true,
|
|
15
|
+
bundleLogsWithTraces: true,
|
|
16
|
+
customEndpoint: undefined,
|
|
17
|
+
logEventMapper: null
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export class LogsConfiguration implements LogsConfigurationType {
|
|
21
|
+
// Bundle Logs with RUM
|
|
22
|
+
public bundleLogsWithRum: boolean = DEFAULTS.bundleLogsWithRum;
|
|
23
|
+
|
|
24
|
+
// Bundle Logs with Traces
|
|
25
|
+
public bundleLogsWithTraces: boolean = DEFAULTS.bundleLogsWithTraces;
|
|
26
|
+
|
|
27
|
+
// Custom Endpoint URL
|
|
28
|
+
public customEndpoint?: string = DEFAULTS.customEndpoint;
|
|
29
|
+
|
|
30
|
+
// Custom Log Event Mapper
|
|
31
|
+
public logEventMapper: LogEventMapper | null = DEFAULTS.logEventMapper;
|
|
32
|
+
|
|
33
|
+
constructor(options: LogsConfigurationOptions = {}) {
|
|
34
|
+
Object.assign(this, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { DEFAULTS as LOGS_DEFAULTS };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { LogEventMapper } from '../../types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Logs configuration options.
|
|
10
|
+
*/
|
|
11
|
+
export interface LogsConfigurationType {
|
|
12
|
+
/**
|
|
13
|
+
* Enables correlation between logs and RUM.
|
|
14
|
+
*/
|
|
15
|
+
bundleLogsWithRum?: boolean;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Enables correlation between logs and traces.
|
|
19
|
+
*/
|
|
20
|
+
bundleLogsWithTraces?: boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Sets a target custom server for Logs.
|
|
24
|
+
*/
|
|
25
|
+
customEndpoint?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Custom mapper to transform log events.
|
|
29
|
+
*/
|
|
30
|
+
logEventMapper?: LogEventMapper | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type LogsConfigurationOptions = LogsConfigurationType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
export type LogsNativeConfiguration = {
|
|
7
|
+
readonly bundleLogsWithRum: boolean;
|
|
8
|
+
readonly bundleLogsWithTraces: boolean;
|
|
9
|
+
readonly customEndpoint: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { ActionEventMapper } from '../../rum/eventMappers/actionEventMapper';
|
|
7
|
+
import type { ErrorEventMapper } from '../../rum/eventMappers/errorEventMapper';
|
|
8
|
+
import type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMapper';
|
|
9
|
+
import type { FirstPartyHost } from '../../rum/types';
|
|
10
|
+
import { VitalsUpdateFrequency } from '../types';
|
|
11
|
+
|
|
12
|
+
import type {
|
|
13
|
+
RumConfigurationOptions,
|
|
14
|
+
RumConfigurationType
|
|
15
|
+
} from './RumConfiguration.type';
|
|
16
|
+
|
|
17
|
+
const DEFAULTS = {
|
|
18
|
+
actionEventMapper: null,
|
|
19
|
+
actionNameAttribute: undefined,
|
|
20
|
+
appHangThreshold: undefined,
|
|
21
|
+
customEndpoint: undefined,
|
|
22
|
+
errorEventMapper: null,
|
|
23
|
+
getFirstPartyHosts: () => [],
|
|
24
|
+
initialResourceThreshold: undefined,
|
|
25
|
+
longTaskThresholdMs: 0,
|
|
26
|
+
nativeCrashReportEnabled: false,
|
|
27
|
+
nativeInteractionTracking: false,
|
|
28
|
+
nativeLongTaskThresholdMs: 200,
|
|
29
|
+
nativeViewTracking: false,
|
|
30
|
+
resourceEventMapper: null,
|
|
31
|
+
resourceTraceSampleRate: 100.0,
|
|
32
|
+
sessionSampleRate: 100.0,
|
|
33
|
+
telemetrySampleRate: 20.0,
|
|
34
|
+
trackBackgroundEvents: false,
|
|
35
|
+
trackErrors: false,
|
|
36
|
+
trackFrustrations: true,
|
|
37
|
+
trackInteractions: false,
|
|
38
|
+
trackMemoryWarnings: true,
|
|
39
|
+
trackNonFatalAnrs: undefined,
|
|
40
|
+
trackResources: false,
|
|
41
|
+
trackWatchdogTerminations: false,
|
|
42
|
+
useAccessibilityLabel: true,
|
|
43
|
+
vitalsUpdateFrequency: VitalsUpdateFrequency.AVERAGE
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export class RumConfiguration implements RumConfigurationType {
|
|
47
|
+
// Custom Action Event Mapper
|
|
48
|
+
public actionEventMapper: ActionEventMapper | null =
|
|
49
|
+
DEFAULTS.actionEventMapper;
|
|
50
|
+
|
|
51
|
+
// Custom Action Name Attribute for interaction tracking
|
|
52
|
+
public actionNameAttribute?: string = DEFAULTS.actionNameAttribute;
|
|
53
|
+
|
|
54
|
+
// Custom App Hang Threshold
|
|
55
|
+
public appHangThreshold?: number = DEFAULTS.appHangThreshold;
|
|
56
|
+
|
|
57
|
+
// Custom Endpoint URL
|
|
58
|
+
public customEndpoint?: string = DEFAULTS.customEndpoint;
|
|
59
|
+
|
|
60
|
+
// Custom Error Event Mapper
|
|
61
|
+
public errorEventMapper: ErrorEventMapper | null =
|
|
62
|
+
DEFAULTS.errorEventMapper;
|
|
63
|
+
|
|
64
|
+
// List of First Party Hosts
|
|
65
|
+
public firstPartyHosts: FirstPartyHost[] = DEFAULTS.getFirstPartyHosts();
|
|
66
|
+
|
|
67
|
+
// Initial Resource Threshold
|
|
68
|
+
public initialResourceThreshold?: number =
|
|
69
|
+
DEFAULTS.initialResourceThreshold;
|
|
70
|
+
|
|
71
|
+
// Long Task Threshold in milliseconds
|
|
72
|
+
public longTaskThresholdMs: number | 0 | false =
|
|
73
|
+
DEFAULTS.longTaskThresholdMs;
|
|
74
|
+
|
|
75
|
+
// Native Crash Report enabled
|
|
76
|
+
public nativeCrashReportEnabled: boolean =
|
|
77
|
+
DEFAULTS.nativeCrashReportEnabled;
|
|
78
|
+
|
|
79
|
+
// Native Interaction Tracking enabled
|
|
80
|
+
public nativeInteractionTracking: boolean =
|
|
81
|
+
DEFAULTS.nativeInteractionTracking;
|
|
82
|
+
|
|
83
|
+
// Native Long Task Threshold in milliseconds
|
|
84
|
+
public nativeLongTaskThresholdMs: number =
|
|
85
|
+
DEFAULTS.nativeLongTaskThresholdMs;
|
|
86
|
+
|
|
87
|
+
// Native View Tracking enabled
|
|
88
|
+
public nativeViewTracking: boolean = DEFAULTS.nativeViewTracking;
|
|
89
|
+
|
|
90
|
+
// Custom Resource Event Mapper
|
|
91
|
+
public resourceEventMapper: ResourceEventMapper | null =
|
|
92
|
+
DEFAULTS.resourceEventMapper;
|
|
93
|
+
|
|
94
|
+
// Resource Trace Sample Rate for trackResources
|
|
95
|
+
public resourceTraceSampleRate: number = DEFAULTS.resourceTraceSampleRate;
|
|
96
|
+
|
|
97
|
+
// Session Sample Rate for RUM
|
|
98
|
+
public sessionSampleRate: number = DEFAULTS.sessionSampleRate;
|
|
99
|
+
|
|
100
|
+
// Telemetry Sample Rate
|
|
101
|
+
public telemetrySampleRate: number = DEFAULTS.telemetrySampleRate;
|
|
102
|
+
|
|
103
|
+
// Track Background Events Enabled
|
|
104
|
+
public trackBackgroundEvents: boolean = DEFAULTS.trackBackgroundEvents;
|
|
105
|
+
|
|
106
|
+
// Track Frustrations Enabled
|
|
107
|
+
public trackFrustrations: boolean = DEFAULTS.trackFrustrations;
|
|
108
|
+
|
|
109
|
+
// Track Memory Warnings Enabled
|
|
110
|
+
public trackMemoryWarnings: boolean = DEFAULTS.trackMemoryWarnings;
|
|
111
|
+
|
|
112
|
+
// Track non-fatal ANRs enabled
|
|
113
|
+
public trackNonFatalAnrs?: boolean = DEFAULTS.trackNonFatalAnrs;
|
|
114
|
+
|
|
115
|
+
// Track Watchdog Terminations enabled
|
|
116
|
+
public trackWatchdogTerminations: boolean =
|
|
117
|
+
DEFAULTS.trackWatchdogTerminations;
|
|
118
|
+
|
|
119
|
+
// Use Accessibility Label enabled for interaction tracking
|
|
120
|
+
public useAccessibilityLabel: boolean = DEFAULTS.useAccessibilityLabel;
|
|
121
|
+
|
|
122
|
+
// Custom Vitals Update Frequency
|
|
123
|
+
public vitalsUpdateFrequency: VitalsUpdateFrequency =
|
|
124
|
+
DEFAULTS.vitalsUpdateFrequency;
|
|
125
|
+
|
|
126
|
+
constructor(
|
|
127
|
+
readonly applicationId: string,
|
|
128
|
+
readonly trackInteractions: boolean = DEFAULTS.trackInteractions,
|
|
129
|
+
readonly trackResources: boolean = DEFAULTS.trackResources,
|
|
130
|
+
readonly trackErrors: boolean = DEFAULTS.trackErrors,
|
|
131
|
+
options: RumConfigurationOptions = {}
|
|
132
|
+
) {
|
|
133
|
+
Object.assign(this, options);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { DEFAULTS as RUM_DEFAULTS };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import type { ActionEventMapper } from '../../rum/eventMappers/actionEventMapper';
|
|
7
|
+
import type { ErrorEventMapper } from '../../rum/eventMappers/errorEventMapper';
|
|
8
|
+
import type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMapper';
|
|
9
|
+
import type { FirstPartyHost } from '../../rum/types';
|
|
10
|
+
import type { VitalsUpdateFrequency } from '../types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Required RUM configuration values.
|
|
14
|
+
*/
|
|
15
|
+
export interface RumConfigurationRequired {
|
|
16
|
+
/**
|
|
17
|
+
* The Datadog RUM application ID.
|
|
18
|
+
*/
|
|
19
|
+
applicationId: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Enables tracking of user interactions.
|
|
23
|
+
* Defaults to the SDK-defined value.
|
|
24
|
+
*/
|
|
25
|
+
trackInteractions?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Enables tracking of network resources.
|
|
29
|
+
* Defaults to the SDK-defined value.
|
|
30
|
+
*/
|
|
31
|
+
trackResources?: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Enables tracking of errors.
|
|
35
|
+
* Defaults to the SDK-defined value.
|
|
36
|
+
*/
|
|
37
|
+
trackErrors?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional RUM configuration values.
|
|
42
|
+
*/
|
|
43
|
+
export interface RumConfigurationOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Custom mapper to transform RUM action events.
|
|
46
|
+
*/
|
|
47
|
+
actionEventMapper?: ActionEventMapper | null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Custom attribute used to name RUM actions.
|
|
51
|
+
*/
|
|
52
|
+
actionNameAttribute?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* App hang threshold in seconds for non-fatal app hangs on iOS.
|
|
56
|
+
*/
|
|
57
|
+
appHangThreshold?: number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Sets a target custom server for RUM.
|
|
61
|
+
*/
|
|
62
|
+
customEndpoint?: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Custom mapper to transform RUM error events.
|
|
66
|
+
*/
|
|
67
|
+
errorEventMapper?: ErrorEventMapper | null;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* List of backend hosts used to enable tracing.
|
|
71
|
+
*/
|
|
72
|
+
firstPartyHosts?: FirstPartyHost[];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Initial resource collection threshold in seconds.
|
|
76
|
+
*/
|
|
77
|
+
initialResourceThreshold?: number;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Threshold for JavaScript long task reporting in milliseconds.
|
|
81
|
+
*/
|
|
82
|
+
longTaskThresholdMs?: number | false;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Enables native crash reporting.
|
|
86
|
+
*/
|
|
87
|
+
nativeCrashReportEnabled?: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Threshold for native long task reporting in milliseconds.
|
|
91
|
+
*/
|
|
92
|
+
nativeLongTaskThresholdMs?: number;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Enables native interaction tracking.
|
|
96
|
+
*/
|
|
97
|
+
nativeInteractionTracking?: boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Enables native view tracking.
|
|
101
|
+
*/
|
|
102
|
+
nativeViewTracking?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Custom mapper to transform RUM resource events.
|
|
106
|
+
*/
|
|
107
|
+
resourceEventMapper?: ResourceEventMapper | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Percentage of traced network requests.
|
|
111
|
+
*/
|
|
112
|
+
resourceTraceSampleRate?: number;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Percentage of sampled RUM sessions.
|
|
116
|
+
*/
|
|
117
|
+
sessionSampleRate?: number;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Enables tracking of background RUM events.
|
|
121
|
+
*/
|
|
122
|
+
trackBackgroundEvents?: boolean;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Enables tracking of frustration signals.
|
|
126
|
+
*/
|
|
127
|
+
trackFrustrations?: boolean;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Enables tracking of non-fatal ANRs on Android.
|
|
131
|
+
*/
|
|
132
|
+
trackNonFatalAnrs?: boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Enables tracking of app termination by the iOS watchdog.
|
|
136
|
+
*/
|
|
137
|
+
trackWatchdogTerminations?: boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Sampling rate for internal SDK telemetry.
|
|
141
|
+
*/
|
|
142
|
+
telemetrySampleRate?: number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Enables tracking of memory warnings (iOS only).
|
|
146
|
+
*/
|
|
147
|
+
trackMemoryWarnings?: boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Enables accessibility label usage for action names.
|
|
151
|
+
*/
|
|
152
|
+
useAccessibilityLabel?: boolean;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Preferred frequency for collecting mobile vitals.
|
|
156
|
+
*/
|
|
157
|
+
vitalsUpdateFrequency?: VitalsUpdateFrequency;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Complete RUM configuration type.
|
|
162
|
+
*/
|
|
163
|
+
export type RumConfigurationType = RumConfigurationRequired &
|
|
164
|
+
RumConfigurationOptions;
|