@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
|
@@ -2,6 +2,310 @@ require "json"
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
4
|
|
|
5
|
+
# /!\ Remember to keep this version in sync with the other Datadog podspecs:
|
|
6
|
+
# - DatadogSDKReactNativeSessionReplay.podspec
|
|
7
|
+
# - DatadogSDKReactNativeWebView.podspec
|
|
8
|
+
# - DatadogInternalTesting.podspec
|
|
9
|
+
datadog_ios_version = '3.21.0'
|
|
10
|
+
datadog_ios_spm_url = 'https://github.com/DataDog/dd-sdk-ios.git'
|
|
11
|
+
datadog_ios_requirement = { kind: 'exactVersion', version: datadog_ios_version }
|
|
12
|
+
|
|
13
|
+
# The native iOS SDK is resolved through Swift Package Manager, using React Native's
|
|
14
|
+
# `spm_dependency` podspec helper. This requires React Native >= 0.75. Pods can be linked statically
|
|
15
|
+
# or as frameworks: see the post-install step below for what each linkage needs.
|
|
16
|
+
if !respond_to?(:spm_dependency, true)
|
|
17
|
+
raise "Datadog: the native iOS SDK is resolved through Swift Package Manager, which requires " \
|
|
18
|
+
"React Native >= 0.75 -- the first version to ship the `spm_dependency` podspec helper."
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Xcode builds some of the package's frameworks as dynamic frameworks: DatadogInternal, a target
|
|
22
|
+
# shared by every product, and a `<Product>_<hash>_PackageProduct` framework for any product that
|
|
23
|
+
# more than one pod requests (e.g. DatadogWebViewTracking). The pods link them, but CocoaPods'
|
|
24
|
+
# "[CP] Embed Pods Frameworks" phase only embeds pod frameworks, and `spm_dependency` does not
|
|
25
|
+
# embed them either, so a Release or archived app crashes at launch with dyld "Library not
|
|
26
|
+
# loaded". Debug builds hide it because Xcode adds an rpath to the build folder.
|
|
27
|
+
# This extends React Native's SPM post-install step, which every React Native Podfile already
|
|
28
|
+
# runs through `react_native_post_install`, so the app embeds them without any Podfile change.
|
|
29
|
+
unless defined?(SPM) && SPM.respond_to?(:apply_on_post_install)
|
|
30
|
+
raise "Datadog: could not find React Native's Swift Package Manager integration " \
|
|
31
|
+
"(SPM.apply_on_post_install), which is needed to embed the native iOS SDK frameworks."
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
unless SPM.singleton_class.method_defined?(:datadog_embeds_spm_frameworks?)
|
|
35
|
+
SPM.singleton_class.prepend(Module.new do
|
|
36
|
+
def datadog_embeds_spm_frameworks?
|
|
37
|
+
true
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# When pods are linked statically, Xcode merges the object files of every package product a pod
|
|
41
|
+
# requests, DatadogInternal included, into that pod's static archive. With more than one Datadog
|
|
42
|
+
# pod each archive carries its own copy, and the app fails to link with duplicate symbols. So
|
|
43
|
+
# the core pod, which every other Datadog pod depends on and which is therefore built first,
|
|
44
|
+
# links all of their products, and the others keep only the package reference and the include
|
|
45
|
+
# path they compile against. This runs on the Pods project once React Native has added the
|
|
46
|
+
# package products to it, so it does not depend on how React Native records them.
|
|
47
|
+
def datadog_link_static_products_from_core(installer, core)
|
|
48
|
+
return if core.build_as_dynamic?
|
|
49
|
+
|
|
50
|
+
core_target = installer.pods_project.targets.find { |t| t.name == core.label }
|
|
51
|
+
return if core_target.nil?
|
|
52
|
+
|
|
53
|
+
packages = core_target.package_product_dependencies.map(&:package).uniq
|
|
54
|
+
installer.pods_project.native_targets.each do |target|
|
|
55
|
+
next if target == core_target
|
|
56
|
+
target.package_product_dependencies.select { |ref| packages.include?(ref.package) }.each do |ref|
|
|
57
|
+
target.package_product_dependencies.delete(ref)
|
|
58
|
+
if core_target.package_product_dependencies.any? { |other| other.package == ref.package && other.product_name == ref.product_name }
|
|
59
|
+
ref.remove_from_project
|
|
60
|
+
else
|
|
61
|
+
core_target.package_product_dependencies << ref
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Xcode versions before 26 hand each package object to libtool twice when they archive a pod that
|
|
68
|
+
# requests package products, so the core pod's static archive holds two copies of every Datadog
|
|
69
|
+
# object, and the -ObjC flag CocoaPods links apps and tests with loads both: duplicate symbols.
|
|
70
|
+
# This drops the extra byte-identical copies once the archive is built, slice by slice when it is
|
|
71
|
+
# a universal archive, which ar cannot read. Xcode 26 archives each object once, so it finds
|
|
72
|
+
# nothing to remove there and leaves the archive untouched.
|
|
73
|
+
def datadog_dedupe_static_archive(installer, core)
|
|
74
|
+
return if core.build_as_dynamic?
|
|
75
|
+
|
|
76
|
+
phase_name = '[Datadog] Remove duplicate Swift package objects'
|
|
77
|
+
target = installer.pods_project.targets.find { |t| t.name == core.label }
|
|
78
|
+
return if target.nil? || target.shell_script_build_phases.any? { |phase| phase.name == phase_name }
|
|
79
|
+
|
|
80
|
+
phase = installer.pods_project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
|
|
81
|
+
phase.name = phase_name
|
|
82
|
+
phase.shell_script = <<~'SH'
|
|
83
|
+
set -e
|
|
84
|
+
archive="${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}"
|
|
85
|
+
has_duplicates() {
|
|
86
|
+
[ -n "$(ar -t "$1" | sort | uniq -d)" ]
|
|
87
|
+
}
|
|
88
|
+
# Pulls every copy of each repeated member out of the archive and puts back one copy of each
|
|
89
|
+
# distinct object, so only byte-identical duplicates go: a same-named object with other code
|
|
90
|
+
# stays.
|
|
91
|
+
dedupe() {
|
|
92
|
+
work="$(mktemp -d "${DERIVED_FILE_DIR}/datadog-dedupe.XXXXXX")"
|
|
93
|
+
ar -t "$1" | sort | uniq -d | while read -r member; do
|
|
94
|
+
count=0
|
|
95
|
+
while ar -t "$1" | grep -qxF "${member}"; do
|
|
96
|
+
count=$((count + 1))
|
|
97
|
+
mkdir "${work}/${count}"
|
|
98
|
+
ar -p "$1" "${member}" > "${work}/${count}/${member}"
|
|
99
|
+
ar -d "$1" "${member}"
|
|
100
|
+
done
|
|
101
|
+
kept=""
|
|
102
|
+
copy=1
|
|
103
|
+
while [ "${copy}" -le "${count}" ]; do
|
|
104
|
+
distinct=true
|
|
105
|
+
for other in ${kept}; do
|
|
106
|
+
if cmp -s "${work}/${copy}/${member}" "${work}/${other}/${member}"; then
|
|
107
|
+
distinct=false
|
|
108
|
+
break
|
|
109
|
+
fi
|
|
110
|
+
done
|
|
111
|
+
if [ "${distinct}" = true ]; then
|
|
112
|
+
ar -q "$1" "${work}/${copy}/${member}"
|
|
113
|
+
kept="${kept} ${copy}"
|
|
114
|
+
fi
|
|
115
|
+
copy=$((copy + 1))
|
|
116
|
+
done
|
|
117
|
+
rm -rf "${work:?}"/*
|
|
118
|
+
done
|
|
119
|
+
rm -rf "${work}"
|
|
120
|
+
ranlib "$1"
|
|
121
|
+
}
|
|
122
|
+
archs="$(lipo -archs "${archive}")"
|
|
123
|
+
mkdir -p "${DERIVED_FILE_DIR}"
|
|
124
|
+
if [ "$(echo ${archs} | wc -w)" -eq 1 ]; then
|
|
125
|
+
ar -t "${archive}" > /dev/null
|
|
126
|
+
has_duplicates "${archive}" || exit 0
|
|
127
|
+
dedupe "${archive}"
|
|
128
|
+
exit 0
|
|
129
|
+
fi
|
|
130
|
+
# Universal archive: ar only reads thin archives, so work on each architecture's slice.
|
|
131
|
+
found=false
|
|
132
|
+
set --
|
|
133
|
+
for arch in ${archs}; do
|
|
134
|
+
slice="${DERIVED_FILE_DIR}/datadog-dedupe-${arch}.a"
|
|
135
|
+
lipo -thin "${arch}" "${archive}" -output "${slice}"
|
|
136
|
+
ar -t "${slice}" > /dev/null
|
|
137
|
+
if has_duplicates "${slice}"; then
|
|
138
|
+
found=true
|
|
139
|
+
dedupe "${slice}"
|
|
140
|
+
fi
|
|
141
|
+
set -- "$@" "${slice}"
|
|
142
|
+
done
|
|
143
|
+
[ "${found}" = true ] || exit 0
|
|
144
|
+
lipo -create "$@" -output "${archive}"
|
|
145
|
+
SH
|
|
146
|
+
phase.always_out_of_date = '1'
|
|
147
|
+
target.build_phases << phase
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# CocoaPods numbers the Pods project's UUIDs from a counter without checking for collisions,
|
|
151
|
+
# which only holds while it creates every object itself. By the time post-install hooks run it
|
|
152
|
+
# has made the UUIDs deterministic, and once the batch it had left runs out the counter
|
|
153
|
+
# restarts, so the package objects added below can reuse a taken UUID -- the project root's
|
|
154
|
+
# first -- and Xcode then reports the Pods project as damaged. Whether that happens depends on
|
|
155
|
+
# how many objects the project has. Queue collision-checked UUIDs, generated by Xcodeproj's own
|
|
156
|
+
# implementation, so the objects created from here on never take one that is already in use.
|
|
157
|
+
# React Native 0.87 and later check for collisions themselves (`new_object`), so this only runs on
|
|
158
|
+
# the versions before it.
|
|
159
|
+
def datadog_reserve_unique_uuids(project)
|
|
160
|
+
return if self.class.private_method_defined?(:new_object)
|
|
161
|
+
|
|
162
|
+
Xcodeproj::Project.instance_method(:generate_available_uuid_list).bind(project).call(100)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# React Native 0.87 and later build every statically linked pod that requests package products straight
|
|
166
|
+
# into the shared products directory (see datadog_update_moved_module_map_references), and CocoaPods
|
|
167
|
+
# copies each Swift pod's module map and umbrella header into its build directory. With all the
|
|
168
|
+
# Datadog pods in one directory, clang lets only one umbrella module cover it: "Umbrella for module
|
|
169
|
+
# ... already covers this directory". Once datadog_link_static_products_from_core has moved every
|
|
170
|
+
# package product onto the core pod, the other pods request none, so React Native's reason to move
|
|
171
|
+
# them is gone: put them back into their own build directories, with the include path React Native
|
|
172
|
+
# gives the pods it does not move, and point the app's references back at their module maps. Finds
|
|
173
|
+
# nothing to do on earlier versions or with frameworks.
|
|
174
|
+
def datadog_restore_static_pod_build_dirs(installer, core)
|
|
175
|
+
return if core.build_as_dynamic?
|
|
176
|
+
|
|
177
|
+
products_dir = '${PODS_CONFIGURATION_BUILD_DIR}'
|
|
178
|
+
search_path = '${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/'
|
|
179
|
+
restored = installer.pod_targets.select do |pod|
|
|
180
|
+
next false if pod == core || !pod.pod_name.start_with?('Datadog')
|
|
181
|
+
target = installer.pods_project.native_targets.find { |t| t.name == pod.label }
|
|
182
|
+
next false if target.nil? || !target.package_product_dependencies.empty?
|
|
183
|
+
moved = target.build_configurations.select { |config| config.build_settings['CONFIGURATION_BUILD_DIR'] == products_dir }
|
|
184
|
+
moved.each do |config|
|
|
185
|
+
config.build_settings.delete('CONFIGURATION_BUILD_DIR')
|
|
186
|
+
include_paths = Array(config.build_settings['SWIFT_INCLUDE_PATHS'] || '$(inherited)')
|
|
187
|
+
include_paths << search_path unless include_paths.include?(search_path)
|
|
188
|
+
config.build_settings['SWIFT_INCLUDE_PATHS'] = include_paths
|
|
189
|
+
end
|
|
190
|
+
!moved.empty?
|
|
191
|
+
end
|
|
192
|
+
return if restored.empty?
|
|
193
|
+
|
|
194
|
+
# React Native rewrote these in the aggregate targets' in-memory xcconfigs, which later post-install
|
|
195
|
+
# steps save again, so edit the same objects rather than the files.
|
|
196
|
+
installer.aggregate_targets.each do |aggregate|
|
|
197
|
+
aggregate.xcconfigs.each do |config_name, xcconfig|
|
|
198
|
+
changed = false
|
|
199
|
+
%w[OTHER_CFLAGS OTHER_SWIFT_FLAGS].each do |key|
|
|
200
|
+
value = xcconfig.attributes[key]
|
|
201
|
+
next unless value
|
|
202
|
+
updated = restored.reduce(value) do |acc, pod|
|
|
203
|
+
module_name = pod.product_module_name
|
|
204
|
+
acc.gsub("#{products_dir}/#{module_name}.modulemap", "#{products_dir}/#{pod.label}/#{module_name}.modulemap")
|
|
205
|
+
end
|
|
206
|
+
next if updated == value
|
|
207
|
+
xcconfig.attributes[key] = updated
|
|
208
|
+
changed = true
|
|
209
|
+
end
|
|
210
|
+
xcconfig.save_as(aggregate.xcconfig_path(config_name)) if changed
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# React Native 0.87 and later build a statically linked pod that requests package products straight
|
|
216
|
+
# into the shared products directory, which moves its module map from <Pod>/<Module>.modulemap to
|
|
217
|
+
# <Module>.modulemap. React Native updates the app's references to it but not those of other pods,
|
|
218
|
+
# so the Datadog pods that import the core pod fail with "module map file ... not found". This
|
|
219
|
+
# updates their references too, and finds nothing to do on earlier versions or with frameworks.
|
|
220
|
+
def datadog_update_moved_module_map_references(installer)
|
|
221
|
+
datadog_pods = installer.pod_targets.select { |pod| pod.pod_name.start_with?('Datadog') }
|
|
222
|
+
moved = datadog_pods.select do |pod|
|
|
223
|
+
target = installer.pods_project.native_targets.find { |t| t.name == pod.label }
|
|
224
|
+
target && target.build_configurations.any? { |config| config.build_settings['CONFIGURATION_BUILD_DIR'] == '${PODS_CONFIGURATION_BUILD_DIR}' }
|
|
225
|
+
end
|
|
226
|
+
return if moved.empty?
|
|
227
|
+
|
|
228
|
+
datadog_pods.each do |pod|
|
|
229
|
+
Dir.glob(File.join(pod.support_files_dir, '*.xcconfig')).each do |path|
|
|
230
|
+
xcconfig = File.read(path)
|
|
231
|
+
updated = moved.reduce(xcconfig) do |acc, moved_pod|
|
|
232
|
+
module_name = moved_pod.product_module_name
|
|
233
|
+
acc.gsub("${PODS_CONFIGURATION_BUILD_DIR}/#{moved_pod.label}/#{module_name}.modulemap",
|
|
234
|
+
"${PODS_CONFIGURATION_BUILD_DIR}/#{module_name}.modulemap")
|
|
235
|
+
end
|
|
236
|
+
File.write(path, updated) if updated != xcconfig
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# The package requirement written into the embed script, taken from this podspec rather than from
|
|
242
|
+
# React Native's records of it.
|
|
243
|
+
define_method(:datadog_package_requirement) do
|
|
244
|
+
"# #{datadog_ios_spm_url} #{datadog_ios_requirement}\n"
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
def apply_on_post_install(installer)
|
|
248
|
+
# When one Podfile builds a pod for more than one platform, e.g. for an iOS and a tvOS app target,
|
|
249
|
+
# CocoaPods adds a suffix to each of its targets' names (DatadogSDKReactNative-iOS), and React
|
|
250
|
+
# Native, which finds a pod's target by the pod's name, fails with "undefined method
|
|
251
|
+
# `package_product_dependencies' for nil".
|
|
252
|
+
if installer.pod_targets.any? { |pod| pod.pod_name == 'DatadogSDKReactNative' && pod.label != pod.pod_name }
|
|
253
|
+
raise "Datadog: the native iOS SDK cannot be resolved through Swift Package Manager when one " \
|
|
254
|
+
"Podfile builds the Datadog pods for more than one platform."
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
datadog_reserve_unique_uuids(installer.pods_project)
|
|
258
|
+
core = installer.pod_targets.find { |pod| pod.pod_name == 'DatadogSDKReactNative' }
|
|
259
|
+
datadog_dedupe_static_archive(installer, core) unless core.nil?
|
|
260
|
+
super(installer)
|
|
261
|
+
datadog_link_static_products_from_core(installer, core) unless core.nil?
|
|
262
|
+
datadog_restore_static_pod_build_dirs(installer, core) unless core.nil?
|
|
263
|
+
datadog_update_moved_module_map_references(installer)
|
|
264
|
+
embed = <<~'SH'
|
|
265
|
+
# Embeds the Datadog Swift package frameworks that Xcode builds dynamically. Looks where Xcode
|
|
266
|
+
# writes them: the products dir, PackageFrameworks, or UninstalledProducts when archiving.
|
|
267
|
+
embed_datadog_spm_frameworks()
|
|
268
|
+
{
|
|
269
|
+
local dir framework found
|
|
270
|
+
for dir in "${PODS_CONFIGURATION_BUILD_DIR}" "${PODS_CONFIGURATION_BUILD_DIR}/PackageFrameworks" "${OBJROOT}/UninstalledProducts/${PLATFORM_NAME}"; do
|
|
271
|
+
found=false
|
|
272
|
+
for framework in "${dir}"/$1.framework; do
|
|
273
|
+
[ -d "${framework}" ] || continue
|
|
274
|
+
found=true
|
|
275
|
+
if file -b "${framework}/$(basename "${framework}" .framework)" | grep -q "dynamically linked"; then
|
|
276
|
+
install_framework "${framework}"
|
|
277
|
+
fi
|
|
278
|
+
done
|
|
279
|
+
[ "${found}" = true ] && return 0
|
|
280
|
+
done
|
|
281
|
+
# Nothing to embed (e.g. every Datadog product is linked statically) is fine; returning the
|
|
282
|
+
# last test's status instead would abort the script, which runs with `set -e`.
|
|
283
|
+
return 0
|
|
284
|
+
}
|
|
285
|
+
embed_datadog_spm_frameworks "DatadogInternal"
|
|
286
|
+
embed_datadog_spm_frameworks "Datadog*_PackageProduct"
|
|
287
|
+
SH
|
|
288
|
+
# The embed phase's file lists only name the pod frameworks. Listing the package requirement makes
|
|
289
|
+
# an SDK version change rewrite this script, an input of the phase, so Xcode runs it again and
|
|
290
|
+
# copies the new frameworks, as React Native does for the frameworks it embeds itself.
|
|
291
|
+
requirements = datadog_package_requirement
|
|
292
|
+
anchor =/^if \[ "\$\{COCOAPODS_PARALLEL_CODE_SIGN\}" == "true" \]; then$/
|
|
293
|
+
installer.aggregate_targets.each do |target|
|
|
294
|
+
next unless target.pod_targets.any? { |pod| pod.pod_name == 'DatadogSDKReactNative' }
|
|
295
|
+
script_path = target.embed_frameworks_script_path
|
|
296
|
+
next unless File.exist?(script_path)
|
|
297
|
+
script = File.read(script_path)
|
|
298
|
+
next if script.include?('embed_datadog_spm_frameworks()')
|
|
299
|
+
unless script.match?(anchor)
|
|
300
|
+
raise "Datadog: could not add the native iOS SDK frameworks to #{script_path}, " \
|
|
301
|
+
"so the app would crash at launch in Release builds."
|
|
302
|
+
end
|
|
303
|
+
File.write(script_path, script.sub(anchor) { "#{embed}#{requirements}#{$&}" })
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
end)
|
|
307
|
+
end
|
|
308
|
+
|
|
5
309
|
Pod::Spec.new do |s|
|
|
6
310
|
s.name = "DatadogSDKReactNative"
|
|
7
311
|
s.version = package["version"]
|
|
@@ -10,7 +314,7 @@ Pod::Spec.new do |s|
|
|
|
10
314
|
s.license = package["license"]
|
|
11
315
|
s.authors = package["author"]
|
|
12
316
|
|
|
13
|
-
s.platforms = { :ios => "
|
|
317
|
+
s.platforms = { :ios => "15.0", :tvos => "15.0" }
|
|
14
318
|
s.source = { :git => "https://github.com/DataDog/dd-sdk-reactnative.git", :tag => "#{s.version}" }
|
|
15
319
|
|
|
16
320
|
|
|
@@ -18,28 +322,65 @@ Pod::Spec.new do |s|
|
|
|
18
322
|
|
|
19
323
|
s.dependency "React-Core"
|
|
20
324
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
325
|
+
# `spm_dependency` cannot be scoped per-platform the way `s.ios.dependency` can, so
|
|
326
|
+
# DatadogWebViewTracking is requested for every platform here. Our Swift sources already
|
|
327
|
+
# guard the import with `#if os(iOS)`, but dd-sdk-ios declares the product for all of its
|
|
328
|
+
# package platforms — building this pod for tvOS through SPM is therefore untested.
|
|
329
|
+
#
|
|
330
|
+
# Note that DatadogInternal is deliberately absent: it is an internal target of
|
|
331
|
+
# dd-sdk-ios, not an exported SPM product, so it cannot be requested here. Making it
|
|
332
|
+
# importable takes an extra search path -- see the FRAMEWORK_SEARCH_PATHS note below.
|
|
333
|
+
spm_dependency(s,
|
|
334
|
+
url: datadog_ios_spm_url,
|
|
335
|
+
requirement: datadog_ios_requirement,
|
|
336
|
+
products: [
|
|
337
|
+
'DatadogCore',
|
|
338
|
+
'DatadogLogs',
|
|
339
|
+
'DatadogTrace',
|
|
340
|
+
'DatadogRUM',
|
|
341
|
+
'DatadogCrashReporting',
|
|
342
|
+
'DatadogFlags',
|
|
343
|
+
'DatadogWebViewTracking'
|
|
344
|
+
]
|
|
345
|
+
)
|
|
31
346
|
|
|
32
347
|
s.test_spec 'Tests' do |test_spec|
|
|
33
348
|
test_spec.source_files = 'ios/Tests/**/*.{swift,json}'
|
|
34
349
|
test_spec.resources = 'ios/Tests/Fixtures'
|
|
35
|
-
test_spec.platforms = { :ios => "
|
|
350
|
+
test_spec.platforms = { :ios => "15.0", :tvos => "15.0" }
|
|
36
351
|
end
|
|
37
352
|
|
|
353
|
+
# DatadogInternal is an internal target of dd-sdk-ios rather than an exported product, so
|
|
354
|
+
# SwiftPM builds it into PackageFrameworks/ instead of emitting a bare .swiftmodule alongside
|
|
355
|
+
# the products. React Native's `spm_dependency` helper only appends the products directory to
|
|
356
|
+
# SWIFT_INCLUDE_PATHS, which leaves the module invisible to the compiler. Our sources import it
|
|
357
|
+
# for AnyEncodable, CoreRegistry, DatadogCoreProtocol and FeatureScope, so add the directory
|
|
358
|
+
# holding the package frameworks explicitly.
|
|
359
|
+
#
|
|
360
|
+
# Note this cannot be written against BUILT_PRODUCTS_DIR: CocoaPods gives every pod target its
|
|
361
|
+
# own CONFIGURATION_BUILD_DIR, so for this target BUILT_PRODUCTS_DIR is
|
|
362
|
+
# <symroot>/<config><platform>/DatadogSDKReactNative, one level below where SwiftPM actually
|
|
363
|
+
# writes PackageFrameworks/. Spelling it as SYMROOT/CONFIGURATION+EFFECTIVE_PLATFORM_NAME
|
|
364
|
+
# matches what `spm_dependency` itself uses for SWIFT_INCLUDE_PATHS.
|
|
365
|
+
#
|
|
366
|
+
# Archive builds lay this out differently: PackageFrameworks/ stays empty and the package
|
|
367
|
+
# frameworks are linked straight into the products directory itself, so search that too.
|
|
368
|
+
datadog_spm_xcconfig = {
|
|
369
|
+
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks" "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"'
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
xcconfig = datadog_spm_xcconfig.dup
|
|
373
|
+
|
|
38
374
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
39
|
-
|
|
375
|
+
xcconfig.merge!({
|
|
40
376
|
"DEFINES_MODULE" => "YES",
|
|
41
377
|
"OTHER_CPLUSPLUSFLAGS" => "-DRCT_NEW_ARCH_ENABLED=1"
|
|
42
|
-
}
|
|
378
|
+
})
|
|
379
|
+
|
|
380
|
+
# Assign before install_modules_dependencies: the helper reads the spec's current
|
|
381
|
+
# pod_target_xcconfig, merges React Native's own header search paths and C++ settings into it
|
|
382
|
+
# and assigns the result back, so assigning afterwards would drop everything it added.
|
|
383
|
+
s.pod_target_xcconfig = xcconfig
|
|
43
384
|
|
|
44
385
|
# install_modules_dependencies is only available on RN >= 0.71
|
|
45
386
|
if respond_to?(:install_modules_dependencies, true)
|
|
@@ -47,5 +388,7 @@ Pod::Spec.new do |s|
|
|
|
47
388
|
else
|
|
48
389
|
Pod::UI.warn "Using Datadog React Native SDK with new architecture on RN < 0.71 is discouraged and not officially supported."
|
|
49
390
|
end
|
|
391
|
+
else
|
|
392
|
+
s.pod_target_xcconfig = xcconfig
|
|
50
393
|
end
|
|
51
394
|
end
|
package/README.md
CHANGED
|
@@ -16,9 +16,9 @@ To install with Yarn, run:
|
|
|
16
16
|
yarn add @datadog/mobile-react-native
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
**Minimum React Native version**: SDK
|
|
19
|
+
**Minimum React Native version**: React Native 0.75 or higher. The native iOS SDK is resolved through Swift Package Manager, which needs React Native 0.75 or higher. If your app uses an older React Native version, use SDK version `3.12.x`. See the [migration guide][5] for details.
|
|
20
20
|
|
|
21
|
-
Versions `1.0.0-rc5` and higher require you to have `compileSdkVersion = 31` in the Android application setup, which implies that you should use Build Tools version 31, Android Gradle Plugin version 7, and Gradle version 7 or higher. To modify the versions, change the values in the `buildscript.ext` block of your application's top-level `build.gradle` file.
|
|
21
|
+
Versions `1.0.0-rc5` and higher require you to have `compileSdkVersion = 31` in the Android application setup, which implies that you should use Build Tools version 31, Android Gradle Plugin version 7, and Gradle version 7 or higher. To modify the versions, change the values in the `buildscript.ext` block of your application's top-level `build.gradle` file.
|
|
22
22
|
|
|
23
23
|
### Specify application details in UI
|
|
24
24
|
|
|
@@ -83,7 +83,8 @@ export default function App() {
|
|
|
83
83
|
|
|
84
84
|
`trackFetchResources` tracks calls made through the Expo-installed global
|
|
85
85
|
`fetch`. Direct imports retained from `expo/fetch` are not intercepted. XHR
|
|
86
|
-
tracking remains enabled for clients such as axios.
|
|
86
|
+
tracking remains enabled for clients such as axios. Resource header capture
|
|
87
|
+
(`headerCaptureRules`) applies to both XHR and Fetch resources.
|
|
87
88
|
|
|
88
89
|
GraphQL error extraction (via `DatadogLink({ trackErrors: true })`) for
|
|
89
90
|
requests made through `expo/fetch` requires Expo SDK 56 or later, as older
|
|
@@ -128,3 +129,4 @@ of your [application sandbox][4], which can't be read by any other app installed
|
|
|
128
129
|
[2]: https://raw.githubusercontent.com/DataDog/dd-sdk-reactnative/main/docs/image_reactnative.png
|
|
129
130
|
[3]: https://source.android.com/security/app-sandbox
|
|
130
131
|
[4]: https://support.apple.com/guide/security/security-of-runtime-process-sec15bfe098e/web
|
|
132
|
+
[5]: https://github.com/DataDog/dd-sdk-reactnative/blob/develop/MIGRATION.md
|
package/android/build.gradle
CHANGED
|
@@ -36,7 +36,16 @@ apply plugin: 'com.android.library'
|
|
|
36
36
|
if (isNewArchitectureEnabled()) {
|
|
37
37
|
apply plugin: 'com.facebook.react'
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
// AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
|
|
40
|
+
// itself. Applying the Kotlin plugin on top of it fails configuration with
|
|
41
|
+
// "Cannot add extension with name 'kotlin'". Asking for the extension covers
|
|
42
|
+
// every way built-in Kotlin can be turned on -- the global default, the
|
|
43
|
+
// android.builtInKotlin property, and the per-module com.android.built-in-kotlin
|
|
44
|
+
// plugin -- without reading an AGP version number.
|
|
45
|
+
if (project.extensions.findByName('kotlin') == null) {
|
|
46
|
+
apply plugin: 'kotlin-android'
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
apply plugin: 'org.jlleitschuh.gradle.ktlint'
|
|
41
50
|
|
|
42
51
|
|
|
@@ -136,7 +145,7 @@ android {
|
|
|
136
145
|
sourceSets {
|
|
137
146
|
main {
|
|
138
147
|
if (isNewArchitectureEnabled()) {
|
|
139
|
-
|
|
148
|
+
kotlin.srcDirs += ['src/newarch/kotlin']
|
|
140
149
|
} else {
|
|
141
150
|
// `oldarchCommon` holds everything shared by all old-architecture RN versions.
|
|
142
151
|
// Version-specific pieces (currently just heatmap tap-to-view resolution, whose
|
|
@@ -146,11 +155,11 @@ android {
|
|
|
146
155
|
// always means "newer than the highest split defined" (today: RN > 65); if a future RN
|
|
147
156
|
// release breaks another old-arch API, split off the next `oldarch<N>` the same way and
|
|
148
157
|
// `oldarch` keeps that same "later than the highest split" meaning.
|
|
149
|
-
|
|
158
|
+
kotlin.srcDirs += ['src/oldarchCommon/kotlin']
|
|
150
159
|
if (reactNativeMajorVersion == 0 && reactNativeMinorVersion <= 65) {
|
|
151
|
-
|
|
160
|
+
kotlin.srcDirs += ['src/oldarch65/kotlin']
|
|
152
161
|
} else {
|
|
153
|
-
|
|
162
|
+
kotlin.srcDirs += ['src/oldarch/kotlin']
|
|
154
163
|
}
|
|
155
164
|
}
|
|
156
165
|
}
|
|
@@ -213,7 +222,7 @@ dependencies {
|
|
|
213
222
|
// This breaks builds if the React Native target is below 0.76.0. as it relies on Gradle 8.5.0.
|
|
214
223
|
// To avoid this, we enforce 1.0.0-beta01 on RN < 0.76.0
|
|
215
224
|
if (reactNativeMinorVersion < 76) {
|
|
216
|
-
implementation("com.datadoghq:dd-sdk-android-rum:3.
|
|
225
|
+
implementation("com.datadoghq:dd-sdk-android-rum:3.16.0") {
|
|
217
226
|
exclude group: "androidx.metrics", module: "metrics-performance"
|
|
218
227
|
}
|
|
219
228
|
implementation "androidx.metrics:metrics-performance:1.0.0-beta01"
|
|
@@ -233,15 +242,15 @@ dependencies {
|
|
|
233
242
|
}
|
|
234
243
|
}
|
|
235
244
|
} else {
|
|
236
|
-
implementation "com.datadoghq:dd-sdk-android-rum:3.
|
|
245
|
+
implementation "com.datadoghq:dd-sdk-android-rum:3.16.0"
|
|
237
246
|
}
|
|
238
|
-
implementation "com.datadoghq:dd-sdk-android-logs:3.
|
|
239
|
-
implementation "com.datadoghq:dd-sdk-android-trace:3.
|
|
240
|
-
implementation "com.datadoghq:dd-sdk-android-webview:3.
|
|
241
|
-
implementation "com.datadoghq:dd-sdk-android-ndk:3.
|
|
242
|
-
implementation "com.datadoghq:dd-sdk-android-flags:3.
|
|
243
|
-
implementation "com.datadoghq:dd-sdk-android-internal:3.
|
|
244
|
-
implementation "com.datadoghq:dd-sdk-android-rum-prelaunch:3.
|
|
247
|
+
implementation "com.datadoghq:dd-sdk-android-logs:3.16.0"
|
|
248
|
+
implementation "com.datadoghq:dd-sdk-android-trace:3.16.0"
|
|
249
|
+
implementation "com.datadoghq:dd-sdk-android-webview:3.16.0"
|
|
250
|
+
implementation "com.datadoghq:dd-sdk-android-ndk:3.16.0"
|
|
251
|
+
implementation "com.datadoghq:dd-sdk-android-flags:3.16.0"
|
|
252
|
+
implementation "com.datadoghq:dd-sdk-android-internal:3.16.0"
|
|
253
|
+
implementation "com.datadoghq:dd-sdk-android-rum-prelaunch:3.16.0"
|
|
245
254
|
implementation "com.google.code.gson:gson:2.11.0"
|
|
246
255
|
testImplementation "org.junit.platform:junit-platform-launcher:1.6.2"
|
|
247
256
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.2"
|
|
@@ -65,6 +65,8 @@ data class DdSdkConfiguration(
|
|
|
65
65
|
* @param initialResourceThreshold The amount of time after a view starts where a Resource should be considered when calculating Time to Network-Settled (TNS).
|
|
66
66
|
* @param telemetrySampleRate The sample rate (between 0 and 100) of telemetry events.
|
|
67
67
|
* @param customEndpoint Custom RUM intake endpoint used to override the default Datadog intake.
|
|
68
|
+
* @param timeseries Experimental: configuration for memory and CPU timeseries collection.
|
|
69
|
+
* A non-null value enables timeseries collection.
|
|
68
70
|
*/
|
|
69
71
|
data class RumConfiguration(
|
|
70
72
|
val applicationId: String,
|
|
@@ -82,7 +84,23 @@ data class RumConfiguration(
|
|
|
82
84
|
val trackNonFatalAnrs: Boolean? = null,
|
|
83
85
|
val initialResourceThreshold: Double? = null,
|
|
84
86
|
val telemetrySampleRate: Double? = null,
|
|
85
|
-
val customEndpoint: String? = null
|
|
87
|
+
val customEndpoint: String? = null,
|
|
88
|
+
val timeseries: TimeseriesConfiguration? = null
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Experimental: the default set of timeseries types to collect (cpu and memory).
|
|
93
|
+
*/
|
|
94
|
+
internal val DEFAULT_TIMESERIES_COLLECT_TYPES = listOf("cpu", "memory")
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Experimental: configuration for memory and CPU timeseries collection.
|
|
98
|
+
*
|
|
99
|
+
* @param collectTypes The types of timeseries data to collect ("cpu", "memory"). Required.
|
|
100
|
+
* Use [DEFAULT_TIMESERIES_COLLECT_TYPES] to collect the default set.
|
|
101
|
+
*/
|
|
102
|
+
data class TimeseriesConfiguration(
|
|
103
|
+
val collectTypes: List<String>
|
|
86
104
|
)
|
|
87
105
|
|
|
88
106
|
/**
|
|
@@ -157,7 +175,14 @@ internal data class JSONRumConfiguration(
|
|
|
157
175
|
val vitalsUpdateFrequency: String? = null,
|
|
158
176
|
val trackMemoryWarnings: Boolean? = null,
|
|
159
177
|
val telemetrySampleRate: Double? = null,
|
|
160
|
-
val customEndpoint: String? = null
|
|
178
|
+
val customEndpoint: String? = null,
|
|
179
|
+
// Gson maps this property name to the `unstable_timeseries` JSON key.
|
|
180
|
+
@Suppress("ConstructorParameterNaming")
|
|
181
|
+
val unstable_timeseries: JSONTimeseriesConfiguration? = null
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
internal data class JSONTimeseriesConfiguration(
|
|
185
|
+
val collectTypes: List<String>? = null
|
|
161
186
|
)
|
|
162
187
|
|
|
163
188
|
internal data class JSONLogsConfiguration(
|
|
@@ -18,6 +18,7 @@ import java.net.InetSocketAddress
|
|
|
18
18
|
import java.net.Proxy
|
|
19
19
|
import java.util.Locale
|
|
20
20
|
|
|
21
|
+
@Suppress("LongMethod")
|
|
21
22
|
internal fun ReadableMap.asDdSdkConfiguration(): DdSdkConfiguration {
|
|
22
23
|
val additionalConfiguration = getMap("additionalConfiguration")?.toHashMap()
|
|
23
24
|
|
|
@@ -45,7 +46,8 @@ internal fun ReadableMap.asDdSdkConfiguration(): DdSdkConfiguration {
|
|
|
45
46
|
trackNonFatalAnrs = rm.getBooleanOrNull("trackNonFatalAnrs"),
|
|
46
47
|
initialResourceThreshold = rm.getDoubleOrNull("initialResourceThreshold"),
|
|
47
48
|
telemetrySampleRate = rm.getDoubleOrNull("telemetrySampleRate"),
|
|
48
|
-
customEndpoint = rm.getString("customEndpoint")
|
|
49
|
+
customEndpoint = rm.getString("customEndpoint"),
|
|
50
|
+
timeseries = rm.getMap("unstable_timeseries")?.asTimeseriesConfiguration()
|
|
49
51
|
)
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -86,6 +88,13 @@ internal fun ReadableMap.asDdSdkConfiguration(): DdSdkConfiguration {
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
|
|
91
|
+
internal fun ReadableMap.asTimeseriesConfiguration(): TimeseriesConfiguration {
|
|
92
|
+
return TimeseriesConfiguration(
|
|
93
|
+
collectTypes = getArray("collectTypes")?.toArrayList()?.filterIsInstance<String>()
|
|
94
|
+
?: DEFAULT_TIMESERIES_COLLECT_TYPES
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
89
98
|
internal fun ReadableMap.asConfigurationForTelemetry(): ConfigurationForTelemetry {
|
|
90
99
|
return ConfigurationForTelemetry(
|
|
91
100
|
initializationType = getString("initializationType"),
|
|
@@ -187,7 +196,8 @@ internal fun JSONDdSdkConfiguration.asDdSdkConfiguration(): DdSdkConfiguration {
|
|
|
187
196
|
initialResourceThreshold = rum.initialResourceThreshold ?: DefaultConfiguration.initialResourceThreshold,
|
|
188
197
|
telemetrySampleRate = rum.telemetrySampleRate?.toDouble()
|
|
189
198
|
?: DefaultConfiguration.telemetrySampleRate,
|
|
190
|
-
customEndpoint = rum.customEndpoint
|
|
199
|
+
customEndpoint = rum.customEndpoint,
|
|
200
|
+
timeseries = rum.unstable_timeseries?.asTimeseriesConfiguration()
|
|
191
201
|
)
|
|
192
202
|
}
|
|
193
203
|
|
|
@@ -229,6 +239,12 @@ internal fun JSONDdSdkConfiguration.asDdSdkConfiguration(): DdSdkConfiguration {
|
|
|
229
239
|
}
|
|
230
240
|
|
|
231
241
|
|
|
242
|
+
internal fun JSONTimeseriesConfiguration.asTimeseriesConfiguration(): TimeseriesConfiguration {
|
|
243
|
+
return TimeseriesConfiguration(
|
|
244
|
+
collectTypes = this.collectTypes ?: DEFAULT_TIMESERIES_COLLECT_TYPES
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
232
248
|
internal fun JSONProxyConfiguration.asProxyConfig(): Pair<Proxy, ProxyAuthenticator?>? {
|
|
233
249
|
return buildProxyConfig(type, address, port, username, password)
|
|
234
250
|
}
|
|
@@ -331,6 +347,15 @@ internal fun DdSdkConfiguration.toReadableMap(): ReadableMap {
|
|
|
331
347
|
rum.initialResourceThreshold?.let { rumMap.putDouble("initialResourceThreshold", it) }
|
|
332
348
|
rum.telemetrySampleRate?.let { rumMap.putDouble("telemetrySampleRate", it) }
|
|
333
349
|
rum.customEndpoint?.let { rumMap.putString("customEndpoint", it) }
|
|
350
|
+
rum.timeseries?.let { timeseries ->
|
|
351
|
+
val timeseriesMap = WritableNativeMap()
|
|
352
|
+
timeseries.collectTypes?.let { types ->
|
|
353
|
+
val typesArray = WritableNativeArray()
|
|
354
|
+
types.forEach { typesArray.pushString(it) }
|
|
355
|
+
timeseriesMap.putArray("collectTypes", typesArray)
|
|
356
|
+
}
|
|
357
|
+
rumMap.putMap("unstable_timeseries", timeseriesMap)
|
|
358
|
+
}
|
|
334
359
|
|
|
335
360
|
map.putMap("rumConfiguration", rumMap)
|
|
336
361
|
}
|