@datadog/mobile-react-native 3.11.0 → 3.13.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 +357 -14
- package/README.md +5 -3
- package/android/build.gradle +23 -14
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +27 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +27 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +25 -0
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +4 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +104 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +8 -0
- package/android/src/test/resources/input/complete-configuration.json +5 -0
- package/datadog-configuration.gradle +59 -18
- package/datadog-configuration.schema.json +140 -0
- package/ios/Sources/DdFlagsImplementation.swift +3 -0
- package/ios/Sources/DdSdkConfiguration.swift +11 -1
- package/ios/Sources/DdSdkNativeInitialization.swift +24 -2
- package/ios/Sources/RNDdSdkConfiguration.swift +14 -2
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/DdSdkReactNative.js +6 -1
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/config/FileBasedConfiguration.js +4 -1
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -1
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +3 -1
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -1
- package/lib/commonjs/config/features/RumConfiguration.js +8 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -1
- package/lib/commonjs/config/features/RumConfigurationNative.js +4 -0
- package/lib/commonjs/config/types/TimeseriesConfiguration.js +25 -0
- package/lib/commonjs/config/types/TimeseriesConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/index.js +7 -0
- package/lib/commonjs/config/types/index.js.map +1 -1
- package/lib/commonjs/flags/DdFlags.js +4 -2
- package/lib/commonjs/flags/DdFlags.js.map +1 -1
- package/lib/commonjs/flags/FlagsClient.js +4 -2
- package/lib/commonjs/flags/FlagsClient.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +97 -0
- package/lib/commonjs/internal.js.map +1 -0
- package/lib/commonjs/logs/DdLogs.js +4 -2
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +4 -2
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +20 -15
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +5 -2
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +2 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/README.md +142 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js +308 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js +275 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js +167 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js +158 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js +58 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js +39 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js +38 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/types.js +2 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/types.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js +17 -2
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +25 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +2 -35
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js +3 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js +8 -2
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js +88 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
- package/lib/commonjs/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js +2 -3
- package/lib/commonjs/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +27 -22
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -1
- package/lib/commonjs/specs/NativeDdFlags.js +19 -3
- package/lib/commonjs/specs/NativeDdFlags.js.map +1 -1
- package/lib/commonjs/specs/NativeDdLogs.js +19 -3
- package/lib/commonjs/specs/NativeDdLogs.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js +19 -3
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js +19 -3
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/specs/NativeDdTrace.js +19 -3
- package/lib/commonjs/specs/NativeDdTrace.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +4 -2
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/utils/stringUtils.js +48 -0
- package/lib/commonjs/utils/stringUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/DdSdkReactNative.js +6 -1
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/config/FileBasedConfiguration.js +4 -1
- package/lib/module/config/FileBasedConfiguration.js.map +1 -1
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +3 -1
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -1
- package/lib/module/config/features/RumConfiguration.js +8 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -1
- package/lib/module/config/features/RumConfigurationNative.js +1 -1
- package/lib/module/config/types/TimeseriesConfiguration.js +19 -0
- package/lib/module/config/types/TimeseriesConfiguration.js.map +1 -0
- package/lib/module/config/types/index.js +1 -0
- package/lib/module/config/types/index.js.map +1 -1
- package/lib/module/flags/DdFlags.js +4 -2
- package/lib/module/flags/DdFlags.js.map +1 -1
- package/lib/module/flags/FlagsClient.js +5 -2
- package/lib/module/flags/FlagsClient.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +27 -0
- package/lib/module/internal.js.map +1 -0
- package/lib/module/logs/DdLogs.js +4 -2
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/rum/DdRum.js +4 -2
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +20 -14
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +5 -2
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- 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/headerCapture/README.md +142 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js +298 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js +268 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js +160 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js +150 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js +51 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js +32 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js +32 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/types.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/types.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js +17 -2
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +25 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +1 -34
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js +3 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js +8 -2
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js +79 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
- package/lib/module/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js +2 -3
- package/lib/module/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +27 -22
- package/lib/module/sdk/DdSdkInternal.js.map +1 -1
- package/lib/module/specs/NativeDdFlags.js +14 -2
- package/lib/module/specs/NativeDdFlags.js.map +1 -1
- package/lib/module/specs/NativeDdLogs.js +14 -2
- package/lib/module/specs/NativeDdLogs.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js +14 -2
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js +14 -2
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/specs/NativeDdTrace.js +14 -2
- package/lib/module/specs/NativeDdTrace.js.map +1 -1
- package/lib/module/trace/DdTrace.js +4 -2
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/utils/stringUtils.js +42 -0
- package/lib/module/utils/stringUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +4 -1
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +6 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +2 -1
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/features/RumConfiguration.d.ts +6 -1
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +116 -1
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +2 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -1
- package/lib/typescript/config/types/TimeseriesConfiguration.d.ts +19 -0
- package/lib/typescript/config/types/TimeseriesConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +2 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -1
- package/lib/typescript/flags/DdFlags.d.ts.map +1 -1
- package/lib/typescript/flags/FlagsClient.d.ts +1 -1
- package/lib/typescript/flags/FlagsClient.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +5 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/internal.d.ts +26 -0
- package/lib/typescript/internal.d.ts.map +1 -0
- package/lib/typescript/logs/DdLogs.d.ts +1 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +1 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +3 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts +85 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts +18 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts +28 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts +16 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts +13 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts +13 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/types.d.ts +27 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/types.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts.map +1 -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/common/RequestContext.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts +43 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +1 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdFlags.d.ts +7 -2
- package/lib/typescript/specs/NativeDdFlags.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdLogs.d.ts +7 -2
- package/lib/typescript/specs/NativeDdLogs.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +7 -2
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +7 -2
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdTrace.d.ts +7 -2
- package/lib/typescript/specs/NativeDdTrace.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/utils/stringUtils.d.ts +12 -0
- package/lib/typescript/utils/stringUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +8 -3
- package/src/DdSdkReactNative.tsx +11 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +145 -20
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +6 -0
- package/src/__tests__/internalEntry.test.ts +26 -0
- package/src/__tests__/mock.test.ts +1 -3
- package/src/__tests__/nativeSpecGetters.test.ts +102 -0
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +3 -3
- package/src/__tests__/wrapperImportSafety.test.ts +129 -0
- package/src/config/FileBasedConfiguration.ts +6 -1
- package/src/config/FileBasedConfiguration.type.ts +4 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +73 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +14 -1
- package/src/config/async/AutoInstrumentationConfiguration.ts +9 -1
- package/src/config/async/PartialInitializationConfiguration.ts +2 -0
- package/src/config/features/RumConfiguration.ts +15 -0
- package/src/config/features/RumConfiguration.type.ts +128 -1
- package/src/config/features/RumConfigurationNative.ts +3 -0
- package/src/config/types/TimeseriesConfiguration.ts +26 -0
- package/src/config/types/index.ts +5 -0
- package/src/flags/DdFlags.ts +4 -3
- package/src/flags/FlagsClient.ts +4 -3
- package/src/index.tsx +15 -0
- package/src/internal.ts +32 -0
- package/src/logs/DdLogs.ts +4 -3
- package/src/rum/DdRum.ts +4 -3
- package/src/rum/__tests__/DdRum.test.ts +4 -4
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +33 -26
- package/src/rum/instrumentation/interactionTracking/__tests__/BabelOptionalHandlers.test.ts +120 -0
- package/src/rum/instrumentation/interactionTracking/__tests__/DdBabelInteractionTracking.test.ts +82 -2
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +7 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +46 -0
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/headerCapture/README.md +142 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/captureHeaders.test.ts +853 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/compileHeaderConfig.test.ts +697 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/enforceSizeLimits.integration.test.ts +183 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/enforceSizeLimits.test.ts +337 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/isHeaderAllowed.test.ts +35 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/normalizeUrlForMatching.test.ts +176 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/parseResponseHeaders.test.ts +114 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/sensitiveHeaderBlocklist.test.ts +112 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/tracingHeaderExclusion.test.ts +59 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.ts +437 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.ts +339 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.ts +208 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.ts +181 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.ts +59 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.ts +31 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.ts +61 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/types.ts +33 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.ts +21 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/__tests__/FetchProxy.test.ts +274 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/__tests__/ResourceReporter.test.ts +120 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +34 -3
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +624 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +1 -34
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.ts +6 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.ts +16 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/__tests__/headerCapture.test.ts +164 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.ts +119 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.ts +2 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +2 -0
- package/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.tsx +3 -4
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +35 -2
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +54 -1
- package/src/sdk/DdSdkInternal.ts +27 -24
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +2 -2
- package/src/specs/NativeDdFlags.ts +14 -2
- package/src/specs/NativeDdLogs.ts +14 -2
- package/src/specs/NativeDdRum.ts +14 -2
- package/src/specs/NativeDdSdk.ts +14 -2
- package/src/specs/NativeDdTrace.ts +14 -2
- package/src/trace/DdTrace.ts +4 -3
- package/src/utils/__tests__/stringUtils.test.ts +90 -0
- package/src/utils/stringUtils.ts +41 -0
- package/src/version.ts +1 -1
|
@@ -55,6 +55,20 @@ describe('FileBasedConfiguration', () => {
|
|
|
55
55
|
],
|
|
56
56
|
},
|
|
57
57
|
],
|
|
58
|
+
"headerCaptureRules": [
|
|
59
|
+
{
|
|
60
|
+
"type": "defaults",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"forURLs": [
|
|
64
|
+
"api.example.com",
|
|
65
|
+
],
|
|
66
|
+
"headers": [
|
|
67
|
+
"x-request-id",
|
|
68
|
+
],
|
|
69
|
+
"type": "matchResponseHeaders",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
58
72
|
"initialResourceThreshold": 456,
|
|
59
73
|
"longTaskThresholdMs": 44,
|
|
60
74
|
"nativeCrashReportEnabled": true,
|
|
@@ -78,6 +92,11 @@ describe('FileBasedConfiguration', () => {
|
|
|
78
92
|
"trackNonFatalAnrs": true,
|
|
79
93
|
"trackResources": true,
|
|
80
94
|
"trackWatchdogTerminations": true,
|
|
95
|
+
"unstable_timeseries": {
|
|
96
|
+
"collectTypes": [
|
|
97
|
+
"cpu",
|
|
98
|
+
],
|
|
99
|
+
},
|
|
81
100
|
"useAccessibilityLabel": false,
|
|
82
101
|
"vitalsUpdateFrequency": "NEVER",
|
|
83
102
|
},
|
|
@@ -172,6 +191,7 @@ describe('FileBasedConfiguration', () => {
|
|
|
172
191
|
],
|
|
173
192
|
},
|
|
174
193
|
],
|
|
194
|
+
"headerCaptureRules": undefined,
|
|
175
195
|
"initialResourceThreshold": undefined,
|
|
176
196
|
"longTaskThresholdMs": 44,
|
|
177
197
|
"nativeCrashReportEnabled": false,
|
|
@@ -193,6 +213,7 @@ describe('FileBasedConfiguration', () => {
|
|
|
193
213
|
"trackNonFatalAnrs": undefined,
|
|
194
214
|
"trackResources": true,
|
|
195
215
|
"trackWatchdogTerminations": false,
|
|
216
|
+
"unstable_timeseries": undefined,
|
|
196
217
|
"useAccessibilityLabel": false,
|
|
197
218
|
"vitalsUpdateFrequency": "AVERAGE",
|
|
198
219
|
},
|
|
@@ -239,6 +260,7 @@ describe('FileBasedConfiguration', () => {
|
|
|
239
260
|
"customEndpoint": undefined,
|
|
240
261
|
"errorEventMapper": null,
|
|
241
262
|
"firstPartyHosts": [],
|
|
263
|
+
"headerCaptureRules": undefined,
|
|
242
264
|
"initialResourceThreshold": undefined,
|
|
243
265
|
"longTaskThresholdMs": 0,
|
|
244
266
|
"nativeCrashReportEnabled": false,
|
|
@@ -260,6 +282,7 @@ describe('FileBasedConfiguration', () => {
|
|
|
260
282
|
"trackNonFatalAnrs": undefined,
|
|
261
283
|
"trackResources": false,
|
|
262
284
|
"trackWatchdogTerminations": false,
|
|
285
|
+
"unstable_timeseries": undefined,
|
|
263
286
|
"useAccessibilityLabel": true,
|
|
264
287
|
"vitalsUpdateFrequency": "AVERAGE",
|
|
265
288
|
},
|
|
@@ -346,6 +369,56 @@ describe('FileBasedConfiguration', () => {
|
|
|
346
369
|
).toEqual(disallowList);
|
|
347
370
|
});
|
|
348
371
|
|
|
372
|
+
it('leaves headerCaptureRules undefined when not set', () => {
|
|
373
|
+
const config = new FileBasedConfiguration({
|
|
374
|
+
configuration: {
|
|
375
|
+
env: 'fake-env',
|
|
376
|
+
clientToken: 'fake-client-token',
|
|
377
|
+
rumConfiguration: {
|
|
378
|
+
applicationId: 'fake-app-id'
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
expect(config.rumConfiguration?.headerCaptureRules).toBeUndefined();
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
it('passes the headerCaptureRules defaults preset through', () => {
|
|
386
|
+
const config = new FileBasedConfiguration({
|
|
387
|
+
configuration: {
|
|
388
|
+
env: 'fake-env',
|
|
389
|
+
clientToken: 'fake-client-token',
|
|
390
|
+
rumConfiguration: {
|
|
391
|
+
applicationId: 'fake-app-id',
|
|
392
|
+
headerCaptureRules: 'defaults'
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
expect(config.rumConfiguration?.headerCaptureRules).toBe(
|
|
397
|
+
'defaults'
|
|
398
|
+
);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it('passes headerCaptureRules rules through', () => {
|
|
402
|
+
const rules = [
|
|
403
|
+
{
|
|
404
|
+
type: 'matchRequestHeaders',
|
|
405
|
+
headers: ['x-device-id'],
|
|
406
|
+
forURLs: ['api.example.com/v2']
|
|
407
|
+
}
|
|
408
|
+
];
|
|
409
|
+
const config = new FileBasedConfiguration({
|
|
410
|
+
configuration: {
|
|
411
|
+
env: 'fake-env',
|
|
412
|
+
clientToken: 'fake-client-token',
|
|
413
|
+
rumConfiguration: {
|
|
414
|
+
applicationId: 'fake-app-id',
|
|
415
|
+
headerCaptureRules: rules
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
expect(config.rumConfiguration?.headerCaptureRules).toEqual(rules);
|
|
420
|
+
});
|
|
421
|
+
|
|
349
422
|
it('applies event mappers to configuration when provided', () => {
|
|
350
423
|
const actionEventMapper = () => null;
|
|
351
424
|
const errorEventMapper = () => null;
|
|
@@ -25,6 +25,14 @@
|
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
|
+
"headerCaptureRules": [
|
|
29
|
+
{ "type": "defaults" },
|
|
30
|
+
{
|
|
31
|
+
"type": "matchResponseHeaders",
|
|
32
|
+
"headers": ["x-request-id"],
|
|
33
|
+
"forURLs": ["api.example.com"]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
28
36
|
"initialResourceThreshold": 456,
|
|
29
37
|
"nativeViewTracking": true,
|
|
30
38
|
"nativeInteractionTracking": true,
|
|
@@ -35,7 +43,12 @@
|
|
|
35
43
|
"trackBackgroundEvents": true,
|
|
36
44
|
"trackMemoryWarnings": false,
|
|
37
45
|
"trackWatchdogTerminations": true,
|
|
38
|
-
"vitalsUpdateFrequency": "NEVER"
|
|
46
|
+
"vitalsUpdateFrequency": "NEVER",
|
|
47
|
+
"unstable_timeseries": {
|
|
48
|
+
"collectTypes": [
|
|
49
|
+
"cpu"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
39
52
|
},
|
|
40
53
|
"traceConfiguration": {
|
|
41
54
|
"customEndpoint": "https://example.com/trace"
|
|
@@ -9,8 +9,10 @@ import type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMa
|
|
|
9
9
|
import type { FirstPartyHost } from '../../rum/types';
|
|
10
10
|
import type { LogEventMapper } from '../../types';
|
|
11
11
|
import { LOGS_DEFAULTS } from '../features/LogsConfiguration';
|
|
12
|
+
import type { HeaderCaptureRule } from '../features/RumConfiguration.type';
|
|
12
13
|
import { RUM_DEFAULTS } from '../features/RumConfiguration';
|
|
13
14
|
import type { TraceConfiguration } from '../features/TraceConfiguration';
|
|
15
|
+
import type { TimeseriesConfiguration } from '../types';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Auto Instrumentation configuration passed to DatadogProvider.
|
|
@@ -25,11 +27,13 @@ export type AutoInstrumentationConfiguration = {
|
|
|
25
27
|
readonly useAccessibilityLabel?: boolean;
|
|
26
28
|
readonly actionNameAttribute?: string;
|
|
27
29
|
readonly resourceTraceSampleRate?: number;
|
|
30
|
+
readonly headerCaptureRules?: 'defaults' | HeaderCaptureRule[];
|
|
28
31
|
readonly nativeCrashReportEnabled?: boolean;
|
|
29
32
|
readonly nativeLongTaskThresholdMs?: number;
|
|
30
33
|
readonly nativeViewTracking?: boolean;
|
|
31
34
|
readonly nativeIosResourceTracking?: boolean;
|
|
32
35
|
readonly nativeIosResourceTrackingDisallowList?: string[];
|
|
36
|
+
readonly unstable_timeseries?: TimeseriesConfiguration;
|
|
33
37
|
readonly actionEventMapper?: ActionEventMapper | null;
|
|
34
38
|
readonly errorEventMapper?: ErrorEventMapper | null;
|
|
35
39
|
readonly resourceEventMapper?: ResourceEventMapper | null;
|
|
@@ -57,10 +61,12 @@ export type AutoInstrumentationParameters = {
|
|
|
57
61
|
readonly nativeViewTracking?: boolean;
|
|
58
62
|
readonly nativeIosResourceTracking?: boolean;
|
|
59
63
|
readonly nativeIosResourceTrackingDisallowList?: string[];
|
|
64
|
+
readonly unstable_timeseries?: TimeseriesConfiguration;
|
|
60
65
|
readonly actionEventMapper: ActionEventMapper | null;
|
|
61
66
|
readonly errorEventMapper: ErrorEventMapper | null;
|
|
62
67
|
readonly resourceEventMapper: ResourceEventMapper | null;
|
|
63
68
|
readonly firstPartyHosts: FirstPartyHost[];
|
|
69
|
+
readonly headerCaptureRules?: 'defaults' | HeaderCaptureRule[];
|
|
64
70
|
};
|
|
65
71
|
readonly logsConfiguration?: {
|
|
66
72
|
readonly logEventMapper: LogEventMapper | null;
|
|
@@ -126,9 +132,11 @@ export const addDefaultValuesToAutoInstrumentationConfiguration = (
|
|
|
126
132
|
features.rumConfiguration.nativeIosResourceTracking,
|
|
127
133
|
nativeIosResourceTrackingDisallowList:
|
|
128
134
|
features.rumConfiguration.nativeIosResourceTrackingDisallowList,
|
|
135
|
+
unstable_timeseries: features.rumConfiguration.unstable_timeseries,
|
|
129
136
|
firstPartyHosts:
|
|
130
137
|
features.rumConfiguration.firstPartyHosts ||
|
|
131
|
-
RUM_DEFAULTS.getFirstPartyHosts()
|
|
138
|
+
RUM_DEFAULTS.getFirstPartyHosts(),
|
|
139
|
+
headerCaptureRules: features.rumConfiguration.headerCaptureRules
|
|
132
140
|
},
|
|
133
141
|
logsConfiguration: {
|
|
134
142
|
logEventMapper:
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
BatchSize,
|
|
10
10
|
ProxyConfiguration,
|
|
11
11
|
SdkVerbosity,
|
|
12
|
+
TimeseriesConfiguration,
|
|
12
13
|
TrackingConsent,
|
|
13
14
|
UploadFrequency,
|
|
14
15
|
VitalsUpdateFrequency
|
|
@@ -49,6 +50,7 @@ export type PartialInitializationConfiguration = {
|
|
|
49
50
|
readonly trackNonFatalAnrs?: boolean;
|
|
50
51
|
readonly appHangThreshold?: number;
|
|
51
52
|
readonly resourceTraceSampleRate?: number;
|
|
53
|
+
readonly unstable_timeseries?: TimeseriesConfiguration;
|
|
52
54
|
};
|
|
53
55
|
readonly logsConfiguration?: {
|
|
54
56
|
readonly bundleLogsWithRum?: boolean;
|
|
@@ -7,9 +7,11 @@ import type { ActionEventMapper } from '../../rum/eventMappers/actionEventMapper
|
|
|
7
7
|
import type { ErrorEventMapper } from '../../rum/eventMappers/errorEventMapper';
|
|
8
8
|
import type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMapper';
|
|
9
9
|
import type { FirstPartyHost } from '../../rum/types';
|
|
10
|
+
import type { TimeseriesConfiguration } from '../types';
|
|
10
11
|
import { VitalsUpdateFrequency } from '../types';
|
|
11
12
|
|
|
12
13
|
import type {
|
|
14
|
+
HeaderCaptureRule,
|
|
13
15
|
RumConfigurationOptions,
|
|
14
16
|
RumConfigurationType
|
|
15
17
|
} from './RumConfiguration.type';
|
|
@@ -40,8 +42,13 @@ const DEFAULTS = {
|
|
|
40
42
|
trackInteractions: false,
|
|
41
43
|
trackMemoryWarnings: true,
|
|
42
44
|
trackNonFatalAnrs: undefined,
|
|
45
|
+
headerCaptureRules: undefined as
|
|
46
|
+
| 'defaults'
|
|
47
|
+
| HeaderCaptureRule[]
|
|
48
|
+
| undefined,
|
|
43
49
|
trackResources: false,
|
|
44
50
|
trackWatchdogTerminations: false,
|
|
51
|
+
unstable_timeseries: undefined,
|
|
45
52
|
useAccessibilityLabel: true,
|
|
46
53
|
vitalsUpdateFrequency: VitalsUpdateFrequency.AVERAGE
|
|
47
54
|
};
|
|
@@ -126,10 +133,18 @@ export class RumConfiguration implements RumConfigurationType {
|
|
|
126
133
|
// Track non-fatal ANRs enabled
|
|
127
134
|
public trackNonFatalAnrs?: boolean = DEFAULTS.trackNonFatalAnrs;
|
|
128
135
|
|
|
136
|
+
// Header Capture Rules
|
|
137
|
+
public headerCaptureRules: 'defaults' | HeaderCaptureRule[] | undefined =
|
|
138
|
+
DEFAULTS.headerCaptureRules;
|
|
139
|
+
|
|
129
140
|
// Track Watchdog Terminations enabled
|
|
130
141
|
public trackWatchdogTerminations: boolean =
|
|
131
142
|
DEFAULTS.trackWatchdogTerminations;
|
|
132
143
|
|
|
144
|
+
// Experimental Timeseries Configuration
|
|
145
|
+
public unstable_timeseries?: TimeseriesConfiguration =
|
|
146
|
+
DEFAULTS.unstable_timeseries;
|
|
147
|
+
|
|
133
148
|
// Use Accessibility Label enabled for interaction tracking
|
|
134
149
|
public useAccessibilityLabel: boolean = DEFAULTS.useAccessibilityLabel;
|
|
135
150
|
|
|
@@ -7,7 +7,7 @@ import type { ActionEventMapper } from '../../rum/eventMappers/actionEventMapper
|
|
|
7
7
|
import type { ErrorEventMapper } from '../../rum/eventMappers/errorEventMapper';
|
|
8
8
|
import type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMapper';
|
|
9
9
|
import type { FirstPartyHost } from '../../rum/types';
|
|
10
|
-
import type { VitalsUpdateFrequency } from '../types';
|
|
10
|
+
import type { TimeseriesConfiguration, VitalsUpdateFrequency } from '../types';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Required RUM configuration values.
|
|
@@ -37,6 +37,108 @@ export interface RumConfigurationRequired {
|
|
|
37
37
|
trackErrors?: boolean;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Captures a predefined set of caching and content headers from both
|
|
42
|
+
* request and response.
|
|
43
|
+
*
|
|
44
|
+
* Default headers captured:
|
|
45
|
+
* - **Response:** cache-control, etag, age, expires, content-type,
|
|
46
|
+
* content-encoding, content-length, vary, server-timing, x-cache
|
|
47
|
+
* - **Request:** cache-control, content-type
|
|
48
|
+
*
|
|
49
|
+
* Optionally scoped to specific URLs via `forURLs`.
|
|
50
|
+
*/
|
|
51
|
+
export type DefaultsRule = {
|
|
52
|
+
type: 'defaults';
|
|
53
|
+
/**
|
|
54
|
+
* URL patterns to scope this rule to. Supports hostname-only
|
|
55
|
+
* ('api.example.com') or hostname+path prefix ('api.example.com/v2').
|
|
56
|
+
* Omit to match all URLs.
|
|
57
|
+
*/
|
|
58
|
+
forURLs?: string[];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Captures the specified headers from both request and response.
|
|
63
|
+
*
|
|
64
|
+
* Use this when the same header names should be captured regardless
|
|
65
|
+
* of direction (e.g. 'content-type', 'x-request-id').
|
|
66
|
+
* Optionally scoped to specific URLs via `forURLs`.
|
|
67
|
+
*/
|
|
68
|
+
export type MatchHeadersRule = {
|
|
69
|
+
type: 'matchHeaders';
|
|
70
|
+
/**
|
|
71
|
+
* Header names to capture from both request and response.
|
|
72
|
+
* Preserved as-is; compared case-insensitively at capture time.
|
|
73
|
+
*/
|
|
74
|
+
headers: string[];
|
|
75
|
+
/**
|
|
76
|
+
* URL patterns to scope this rule to. Supports hostname-only
|
|
77
|
+
* ('api.example.com') or hostname+path prefix ('api.example.com/v2').
|
|
78
|
+
* Omit to match all URLs.
|
|
79
|
+
*/
|
|
80
|
+
forURLs?: string[];
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Captures the specified headers from requests only.
|
|
85
|
+
*
|
|
86
|
+
* Use this when you need to capture request-specific headers
|
|
87
|
+
* (e.g. 'x-request-id', 'if-none-match') without capturing response headers.
|
|
88
|
+
* Optionally scoped to specific URLs via `forURLs`.
|
|
89
|
+
*/
|
|
90
|
+
export type MatchRequestHeadersRule = {
|
|
91
|
+
type: 'matchRequestHeaders';
|
|
92
|
+
/**
|
|
93
|
+
* Request header names to capture.
|
|
94
|
+
* Preserved as-is; compared case-insensitively at capture time.
|
|
95
|
+
*/
|
|
96
|
+
headers: string[];
|
|
97
|
+
/**
|
|
98
|
+
* URL patterns to scope this rule to. Supports hostname-only
|
|
99
|
+
* ('api.example.com') or hostname+path prefix ('api.example.com/v2').
|
|
100
|
+
* Omit to match all URLs.
|
|
101
|
+
*/
|
|
102
|
+
forURLs?: string[];
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Captures the specified headers from responses only.
|
|
107
|
+
*
|
|
108
|
+
* Use this when you need to capture response-specific headers
|
|
109
|
+
* (e.g. 'x-request-id', 'x-ratelimit-remaining') without capturing
|
|
110
|
+
* request headers.
|
|
111
|
+
* Optionally scoped to specific URLs via `forURLs`.
|
|
112
|
+
*/
|
|
113
|
+
export type MatchResponseHeadersRule = {
|
|
114
|
+
type: 'matchResponseHeaders';
|
|
115
|
+
/**
|
|
116
|
+
* Response header names to capture.
|
|
117
|
+
* Preserved as-is; compared case-insensitively at capture time.
|
|
118
|
+
*/
|
|
119
|
+
headers: string[];
|
|
120
|
+
/**
|
|
121
|
+
* URL patterns to scope this rule to. Supports hostname-only
|
|
122
|
+
* ('api.example.com') or hostname+path prefix ('api.example.com/v2').
|
|
123
|
+
* Omit to match all URLs.
|
|
124
|
+
*/
|
|
125
|
+
forURLs?: string[];
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A composable header capture rule.
|
|
130
|
+
*
|
|
131
|
+
* Discriminated union on the `type` field. Multiple rules can be combined
|
|
132
|
+
* in an array. Matching rules are merged additively (union of headers).
|
|
133
|
+
* If at least one scoped rule (explicit `forURLs` patterns) matches a URL,
|
|
134
|
+
* catch-all rules (omitted `forURLs` / `['*']`) are ignored for that URL.
|
|
135
|
+
*/
|
|
136
|
+
export type HeaderCaptureRule =
|
|
137
|
+
| DefaultsRule
|
|
138
|
+
| MatchHeadersRule
|
|
139
|
+
| MatchRequestHeadersRule
|
|
140
|
+
| MatchResponseHeadersRule;
|
|
141
|
+
|
|
40
142
|
/**
|
|
41
143
|
* Optional RUM configuration values.
|
|
42
144
|
*/
|
|
@@ -79,6 +181,21 @@ export interface RumConfigurationOptions {
|
|
|
79
181
|
*/
|
|
80
182
|
firstPartyHosts?: FirstPartyHost[];
|
|
81
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Controls which resource headers the SDK captures on network requests.
|
|
186
|
+
*
|
|
187
|
+
* - **Omitted** (default): No headers are captured.
|
|
188
|
+
* - `'defaults'`: Captures a predefined set of caching and content headers
|
|
189
|
+
* across all URLs.
|
|
190
|
+
* - `HeaderCaptureRule[]`: An array of composable rules. When multiple rules
|
|
191
|
+
* match a URL their header sets are merged. If at least one scoped rule
|
|
192
|
+
* (with explicit `forURLs` patterns) matches, catch-all rules (no `forURLs`
|
|
193
|
+
* or `['*']`) are ignored for that URL.
|
|
194
|
+
*
|
|
195
|
+
* Requires `trackResources: true` to take effect.
|
|
196
|
+
*/
|
|
197
|
+
headerCaptureRules?: 'defaults' | HeaderCaptureRule[];
|
|
198
|
+
|
|
82
199
|
/**
|
|
83
200
|
* Initial resource collection threshold in seconds.
|
|
84
201
|
*/
|
|
@@ -186,6 +303,16 @@ export interface RumConfigurationOptions {
|
|
|
186
303
|
* Preferred frequency for collecting mobile vitals.
|
|
187
304
|
*/
|
|
188
305
|
vitalsUpdateFrequency?: VitalsUpdateFrequency;
|
|
306
|
+
|
|
307
|
+
// TODO: RUM-18601 remove the Android limitation note once the Android SDK supports late initialization
|
|
308
|
+
/**
|
|
309
|
+
* Experimental: configuration for memory and CPU timeseries collection.
|
|
310
|
+
*
|
|
311
|
+
* On Android, timeseries are only collected when the SDK is initialized natively
|
|
312
|
+
* from `MainApplication.onCreate` (`DdSdkNativeInitialization.initFromNative`),
|
|
313
|
+
* because the Android SDK must be initialized before the first Activity starts.
|
|
314
|
+
*/
|
|
315
|
+
unstable_timeseries?: TimeseriesConfiguration;
|
|
189
316
|
}
|
|
190
317
|
|
|
191
318
|
/**
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
|
+
import type { TimeseriesConfiguration } from '../types';
|
|
7
|
+
|
|
6
8
|
export type RumNativeConfiguration = {
|
|
7
9
|
readonly applicationId: string;
|
|
8
10
|
readonly trackFrustrations: boolean;
|
|
@@ -25,4 +27,5 @@ export type RumNativeConfiguration = {
|
|
|
25
27
|
readonly telemetrySampleRate: number;
|
|
26
28
|
readonly customEndpoint: string;
|
|
27
29
|
readonly firstPartyHosts: { match: string; propagatorTypes: string[] }[];
|
|
30
|
+
readonly unstable_timeseries: TimeseriesConfiguration | undefined;
|
|
28
31
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Experimental: the type of timeseries data to collect.
|
|
9
|
+
*/
|
|
10
|
+
export type TimeseriesType = 'cpu' | 'memory';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Experimental: configuration for memory and CPU timeseries collection.
|
|
14
|
+
*/
|
|
15
|
+
export interface TimeseriesConfiguration {
|
|
16
|
+
/**
|
|
17
|
+
* The types of timeseries data to collect. Required.
|
|
18
|
+
* Use `defaultTimeseriesTypes` to collect the default set (cpu and memory).
|
|
19
|
+
*/
|
|
20
|
+
collectTypes: TimeseriesType[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Experimental: the default set of timeseries types to collect (cpu and memory).
|
|
25
|
+
*/
|
|
26
|
+
export const defaultTimeseriesTypes: TimeseriesType[] = ['cpu', 'memory'];
|
|
@@ -8,6 +8,11 @@ export { BatchProcessingLevel } from './BatchProcessingLevel';
|
|
|
8
8
|
export { BatchSize } from './BatchSize';
|
|
9
9
|
export { ProxyConfiguration, ProxyType } from './ProxyConfiguration';
|
|
10
10
|
export { SdkVerbosity } from './SdkVerbosity';
|
|
11
|
+
export type {
|
|
12
|
+
TimeseriesConfiguration,
|
|
13
|
+
TimeseriesType
|
|
14
|
+
} from './TimeseriesConfiguration';
|
|
15
|
+
export { defaultTimeseriesTypes } from './TimeseriesConfiguration';
|
|
11
16
|
export { TrackingConsent } from './TrackingConsent';
|
|
12
17
|
export { UploadFrequency } from './UploadFrequency';
|
|
13
18
|
export { VitalsUpdateFrequency } from './VitalsUpdateFrequency';
|
package/src/flags/DdFlags.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { InternalLog } from '../InternalLog';
|
|
8
8
|
import { SdkVerbosity } from '../config/types/SdkVerbosity';
|
|
9
9
|
import type { DdNativeFlagsType } from '../nativeModulesTypes';
|
|
10
|
+
import { getNativeDdFlags } from '../specs/NativeDdFlags';
|
|
10
11
|
import { getGlobalInstance } from '../utils/singletonUtils';
|
|
11
12
|
|
|
12
13
|
import { FlagsClient } from './FlagsClient';
|
|
@@ -18,9 +19,9 @@ const FLAGS_MODULE = 'com.datadog.reactnative.flags';
|
|
|
18
19
|
* Implementation class for {@link DdFlagsType}. Please see the interface for documentation.
|
|
19
20
|
*/
|
|
20
21
|
class DdFlagsWrapper implements DdFlagsType {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
private get nativeFlags(): DdNativeFlagsType {
|
|
23
|
+
return getNativeDdFlags() as DdNativeFlagsType;
|
|
24
|
+
}
|
|
24
25
|
|
|
25
26
|
private isFeatureEnabled = false;
|
|
26
27
|
|
package/src/flags/FlagsClient.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { InternalLog } from '../InternalLog';
|
|
8
8
|
import { SdkVerbosity } from '../config/types/SdkVerbosity';
|
|
9
9
|
import type { DdNativeFlagsType } from '../nativeModulesTypes';
|
|
10
|
+
import { getNativeDdFlags } from '../specs/NativeDdFlags';
|
|
10
11
|
|
|
11
12
|
// Imported directly (not via the module index): context matching is an internal helper,
|
|
12
13
|
// used here only to detect a runtime context an offline precomputed configuration cannot honor.
|
|
@@ -82,9 +83,9 @@ interface OfflineFlagsEvaluator {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export class FlagsClient {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
private get nativeFlags(): DdNativeFlagsType {
|
|
87
|
+
return getNativeDdFlags() as DdNativeFlagsType;
|
|
88
|
+
}
|
|
88
89
|
|
|
89
90
|
private clientName: string;
|
|
90
91
|
|
package/src/index.tsx
CHANGED
|
@@ -22,6 +22,11 @@ import {
|
|
|
22
22
|
ProxyType
|
|
23
23
|
} from './config/types/ProxyConfiguration';
|
|
24
24
|
import { SdkVerbosity } from './config/types/SdkVerbosity';
|
|
25
|
+
import { defaultTimeseriesTypes } from './config/types/TimeseriesConfiguration';
|
|
26
|
+
import type {
|
|
27
|
+
TimeseriesConfiguration,
|
|
28
|
+
TimeseriesType
|
|
29
|
+
} from './config/types/TimeseriesConfiguration';
|
|
25
30
|
import { TrackingConsent } from './config/types/TrackingConsent';
|
|
26
31
|
import {
|
|
27
32
|
BatchProcessingLevel,
|
|
@@ -97,6 +102,7 @@ export {
|
|
|
97
102
|
TrackingConsent,
|
|
98
103
|
SdkVerbosity,
|
|
99
104
|
VitalsUpdateFrequency,
|
|
105
|
+
defaultTimeseriesTypes,
|
|
100
106
|
PropagatorType,
|
|
101
107
|
UploadFrequency,
|
|
102
108
|
BatchSize,
|
|
@@ -116,6 +122,13 @@ export {
|
|
|
116
122
|
__ddExtractText,
|
|
117
123
|
__ddEnrichEvaluationContextWithRumUser
|
|
118
124
|
};
|
|
125
|
+
export type {
|
|
126
|
+
HeaderCaptureRule,
|
|
127
|
+
DefaultsRule,
|
|
128
|
+
MatchHeadersRule,
|
|
129
|
+
MatchRequestHeadersRule,
|
|
130
|
+
MatchResponseHeadersRule
|
|
131
|
+
} from './config/features/RumConfiguration.type';
|
|
119
132
|
export type {
|
|
120
133
|
Timestamp,
|
|
121
134
|
FirstPartyHost,
|
|
@@ -123,6 +136,8 @@ export type {
|
|
|
123
136
|
PartialInitializationConfiguration,
|
|
124
137
|
CoreConfigurationOptions,
|
|
125
138
|
RumConfigurationOptions,
|
|
139
|
+
TimeseriesConfiguration,
|
|
140
|
+
TimeseriesType,
|
|
126
141
|
LogsConfigurationOptions,
|
|
127
142
|
TraceConfigurationOptions,
|
|
128
143
|
FlagsConfiguration,
|
package/src/internal.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sanctioned entry point for cross-package internals consumed by platform
|
|
9
|
+
* packages (e.g. @datadog/mobile-react-native-vega). NOT part of the public API
|
|
10
|
+
* and may change between minor versions. Everything re-exported here must be
|
|
11
|
+
* native-free at import (must not call TurboModuleRegistry / NativeModules at
|
|
12
|
+
* module load).
|
|
13
|
+
*/
|
|
14
|
+
export { addDefaultValuesToAutoInstrumentationConfiguration } from './config/async/AutoInstrumentationConfiguration';
|
|
15
|
+
export { buildConfigurationFromPartialConfiguration } from './config/async/asyncInitializationHelper';
|
|
16
|
+
export { DdSdkNativeConfiguration } from './config/features/CoreConfigurationNative';
|
|
17
|
+
export { RUM_DEFAULTS } from './config/features/RumConfiguration';
|
|
18
|
+
export { adaptLongTaskThreshold } from './utils/longTasksUtils';
|
|
19
|
+
export { version } from './version';
|
|
20
|
+
export { AccountInfoSingleton } from './sdk/AccountInfoSingleton/AccountInfoSingleton';
|
|
21
|
+
export { AttributesSingleton } from './sdk/AttributesSingleton/AttributesSingleton';
|
|
22
|
+
export { UserInfoSingleton } from './sdk/UserInfoSingleton/UserInfoSingleton';
|
|
23
|
+
export { GlobalState } from './sdk/GlobalState/GlobalState';
|
|
24
|
+
export { BufferSingleton } from './sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
25
|
+
export { DatadogProviderState } from './sdk/DatadogProvider/DatadogProviderState';
|
|
26
|
+
export { DdRumResourceTracking } from './rum/instrumentation/resourceTracking/DdRumResourceTracking';
|
|
27
|
+
|
|
28
|
+
export type { Attributes } from './sdk/AttributesSingleton/types';
|
|
29
|
+
export type { LogsNativeConfiguration } from './config/features/LogsConfigurationNative';
|
|
30
|
+
export type { RumNativeConfiguration } from './config/features/RumConfigurationNative';
|
|
31
|
+
export type { TraceNativeConfiguration } from './config/features/TraceConfigurationNative';
|
|
32
|
+
export type { InitializationModeForTelemetry } from './config/types/InitializationModeForTelemetry';
|
package/src/logs/DdLogs.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { debugId } from '../metro/debugIdResolver';
|
|
|
11
11
|
import type { DdNativeLogsType } from '../nativeModulesTypes';
|
|
12
12
|
import { encodeAttributes } from '../sdk/AttributesEncoding/attributesEncoding';
|
|
13
13
|
import { bufferVoidNativeCall } from '../sdk/DatadogProvider/Buffer/bufferNativeCall';
|
|
14
|
+
import { getNativeDdLogs } from '../specs/NativeDdLogs';
|
|
14
15
|
import type { ErrorSource, LogEventMapper } from '../types';
|
|
15
16
|
import { getGlobalInstance } from '../utils/singletonUtils';
|
|
16
17
|
|
|
@@ -44,9 +45,9 @@ const isLogWithError = (
|
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
class DdLogsWrapper implements DdLogsType {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
private get nativeLogs(): DdNativeLogsType {
|
|
49
|
+
return getNativeDdLogs() as DdNativeLogsType;
|
|
50
|
+
}
|
|
50
51
|
private logEventMapper = generateEventMapper(undefined);
|
|
51
52
|
|
|
52
53
|
debug = (...args: LogArguments | LogWithErrorArguments): Promise<void> => {
|
package/src/rum/DdRum.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { Attributes } from '../sdk/AttributesSingleton/types';
|
|
|
15
15
|
import { bufferVoidNativeCall } from '../sdk/DatadogProvider/Buffer/bufferNativeCall';
|
|
16
16
|
import { DdSdk } from '../sdk/DdSdk';
|
|
17
17
|
import { GlobalState } from '../sdk/GlobalState/GlobalState';
|
|
18
|
+
import { getNativeDdRum } from '../specs/NativeDdRum';
|
|
18
19
|
import type { ErrorSource, FeatureOperationFailure } from '../types';
|
|
19
20
|
import { getGlobalInstance } from '../utils/singletonUtils';
|
|
20
21
|
import { DefaultTimeProvider } from '../utils/time-provider/DefaultTimeProvider';
|
|
@@ -77,9 +78,9 @@ const touchDataFromEvent = (
|
|
|
77
78
|
};
|
|
78
79
|
|
|
79
80
|
class DdRumWrapper implements DdRumType {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
private get nativeRum(): DdNativeRumType {
|
|
82
|
+
return getNativeDdRum() as DdNativeRumType;
|
|
83
|
+
}
|
|
83
84
|
private lastActionData?: { type: RumActionType; name: string };
|
|
84
85
|
private errorEventMapper = generateErrorEventMapper(undefined);
|
|
85
86
|
private resourceEventMapper = generateResourceEventMapper(undefined);
|