@datadog/mobile-react-native 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +2 -2
- package/android/build.gradle +58 -64
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdk.kt +31 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +242 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/GenericAssert.kt +6 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ActionEventForgeryFactory.kt +106 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/BaseConfigurator.kt +2 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ResourceEventForgeryFactory.kt +116 -0
- package/ios/Sources/Attributes.swift +14 -0
- package/ios/Sources/DdSdk.swift +18 -0
- package/lib/commonjs/DdSdkReactNative.js +40 -8
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +42 -2
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/foundation.js +2 -139
- package/lib/commonjs/foundation.js.map +1 -1
- package/lib/commonjs/index.js +18 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +71 -0
- package/lib/commonjs/logs/DdLogs.js.map +1 -0
- package/lib/commonjs/logs/eventMapper.js +39 -0
- package/lib/commonjs/logs/eventMapper.js.map +1 -0
- package/lib/commonjs/logs/types.js +2 -0
- package/lib/commonjs/{rum/instrumentation/EventsInterceptor.js.map → logs/types.js.map} +0 -0
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +234 -0
- package/lib/commonjs/rum/DdRum.js.map +1 -0
- package/lib/commonjs/rum/eventMappers/actionEventMapper.js +36 -0
- package/lib/commonjs/rum/eventMappers/actionEventMapper.js.map +1 -0
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js +32 -0
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js.map +1 -0
- package/lib/commonjs/rum/eventMappers/resourceEventMapper.js +38 -0
- package/lib/commonjs/rum/eventMappers/resourceEventMapper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +4 -4
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/{DdEventsInterceptor.js → interactionTracking/DdEventsInterceptor.js} +6 -6
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/{DdRumUserInteractionTracking.js → interactionTracking/DdRumUserInteractionTracking.js} +13 -4
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/{EventsInterceptor.js → interactionTracking/EventsInterceptor.js} +0 -0
- package/lib/{module/rum/instrumentation → commonjs/rum/instrumentation/interactionTracking}/EventsInterceptor.js.map +0 -0
- package/lib/commonjs/rum/instrumentation/{NoOpEventsInterceptor.js → interactionTracking/NoOpEventsInterceptor.js} +0 -0
- package/lib/commonjs/rum/instrumentation/{NoOpEventsInterceptor.js.map → interactionTracking/NoOpEventsInterceptor.js.map} +0 -0
- package/lib/commonjs/rum/instrumentation/{ShallowObjectEqualityChecker.js → interactionTracking/ShallowObjectEqualityChecker.js} +0 -0
- package/lib/commonjs/rum/instrumentation/{ShallowObjectEqualityChecker.js.map → interactionTracking/ShallowObjectEqualityChecker.js.map} +0 -0
- package/lib/commonjs/rum/instrumentation/{getJsxRuntime.js → interactionTracking/getJsxRuntime.js} +0 -0
- package/lib/commonjs/rum/instrumentation/{getJsxRuntime.js.map → interactionTracking/getJsxRuntime.js.map} +0 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js +3 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/XHRProxy.js +2 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/types.js +42 -0
- package/lib/commonjs/rum/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +45 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AttributesSingleton/types.js.map +1 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +85 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/utils/deepClone.js +98 -0
- package/lib/commonjs/sdk/EventMappers/utils/deepClone.js.map +1 -0
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +43 -0
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/UserInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/UserInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/types.js +1 -26
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdSdkReactNative.js +33 -7
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +42 -2
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/foundation.js +2 -124
- package/lib/module/foundation.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +64 -0
- package/lib/module/logs/DdLogs.js.map +1 -0
- package/lib/module/logs/eventMapper.js +20 -0
- package/lib/module/logs/eventMapper.js.map +1 -0
- package/lib/module/logs/types.js +2 -0
- package/lib/module/logs/types.js.map +1 -0
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +212 -0
- package/lib/module/rum/DdRum.js.map +1 -0
- package/lib/module/rum/eventMappers/actionEventMapper.js +26 -0
- package/lib/module/rum/eventMappers/actionEventMapper.js.map +1 -0
- package/lib/module/rum/eventMappers/errorEventMapper.js +22 -0
- package/lib/module/rum/eventMappers/errorEventMapper.js.map +1 -0
- package/lib/module/rum/eventMappers/resourceEventMapper.js +28 -0
- package/lib/module/rum/eventMappers/resourceEventMapper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +2 -2
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/{DdEventsInterceptor.js → interactionTracking/DdEventsInterceptor.js} +6 -6
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -0
- package/lib/module/rum/instrumentation/{DdRumUserInteractionTracking.js → interactionTracking/DdRumUserInteractionTracking.js} +13 -4
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -0
- package/lib/module/rum/instrumentation/{EventsInterceptor.js → interactionTracking/EventsInterceptor.js} +0 -0
- package/lib/module/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -0
- package/lib/module/rum/instrumentation/{NoOpEventsInterceptor.js → interactionTracking/NoOpEventsInterceptor.js} +0 -0
- package/lib/module/rum/instrumentation/{NoOpEventsInterceptor.js.map → interactionTracking/NoOpEventsInterceptor.js.map} +0 -0
- package/lib/module/rum/instrumentation/{ShallowObjectEqualityChecker.js → interactionTracking/ShallowObjectEqualityChecker.js} +0 -0
- package/lib/module/rum/instrumentation/{ShallowObjectEqualityChecker.js.map → interactionTracking/ShallowObjectEqualityChecker.js.map} +0 -0
- package/lib/module/rum/instrumentation/{getJsxRuntime.js → interactionTracking/getJsxRuntime.js} +0 -0
- package/lib/module/rum/instrumentation/{getJsxRuntime.js.map → interactionTracking/getJsxRuntime.js.map} +0 -0
- package/lib/module/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js +2 -2
- package/lib/module/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/implementation/XHRProxy.js +2 -1
- package/lib/module/rum/instrumentation/resourceTracking/implementation/XHRProxy.js.map +1 -1
- package/lib/module/rum/types.js +33 -0
- package/lib/module/rum/types.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +36 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/types.js +2 -0
- package/lib/module/sdk/AttributesSingleton/types.js.map +1 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.js +4 -4
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +72 -0
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -0
- package/lib/module/sdk/EventMappers/utils/deepClone.js +89 -0
- package/lib/module/sdk/EventMappers/utils/deepClone.js.map +1 -0
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +34 -0
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -0
- package/lib/module/sdk/UserInfoSingleton/types.js +2 -0
- package/lib/module/sdk/UserInfoSingleton/types.js.map +1 -0
- package/lib/module/types.js +0 -23
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts +7 -3
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +22 -0
- package/lib/typescript/foundation.d.ts +2 -4
- package/lib/typescript/index.d.ts +5 -3
- package/lib/typescript/logs/DdLogs.d.ts +14 -0
- package/lib/typescript/logs/eventMapper.d.ts +11 -0
- package/lib/typescript/logs/types.d.ts +54 -0
- package/lib/typescript/nativeModulesTypes.d.ts +1 -1
- package/lib/typescript/rum/DdRum.d.ts +36 -0
- package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts +21 -0
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +21 -0
- package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/{DdEventsInterceptor.d.ts → interactionTracking/DdEventsInterceptor.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{DdRumUserInteractionTracking.d.ts → interactionTracking/DdRumUserInteractionTracking.d.ts} +1 -0
- package/lib/typescript/rum/instrumentation/{EventsInterceptor.d.ts → interactionTracking/EventsInterceptor.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{NoOpEventsInterceptor.d.ts → interactionTracking/NoOpEventsInterceptor.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{ShallowObjectEqualityChecker.d.ts → interactionTracking/ShallowObjectEqualityChecker.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{getJsxRuntime.d.ts → interactionTracking/getJsxRuntime.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/implementation/XHRProxy.d.ts +0 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/implementation/responseSize.d.ts +0 -1
- package/lib/typescript/rum/types.d.ts +110 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +12 -0
- package/lib/typescript/sdk/AttributesSingleton/types.d.ts +3 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.d.ts +2 -2
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +24 -0
- package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts +10 -0
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +12 -0
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/types.d.ts +0 -139
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/scripts/replace-react-require.js +3 -2
- package/src/DdSdkReactNative.tsx +41 -7
- package/src/DdSdkReactNativeConfiguration.tsx +83 -3
- package/src/__tests__/DdSdkReactNative.test.tsx +244 -13
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +29 -7
- package/src/__tests__/{longTasksUtils.ts → longTasksUtils.test.ts} +0 -0
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +4 -3
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +3 -2
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +135 -117
- package/src/__tests__/rum/instrumentation/ShallowObjectEqualityChecker.test.ts +1 -1
- package/src/foundation.tsx +4 -114
- package/src/index.tsx +5 -3
- package/src/logs/DdLogs.ts +67 -0
- package/src/logs/__tests__/DdLogs.test.ts +51 -0
- package/src/logs/__tests__/eventMapper.test.ts +53 -0
- package/src/logs/eventMapper.ts +43 -0
- package/src/logs/types.ts +70 -0
- package/src/nativeModulesTypes.ts +1 -1
- package/src/rum/DdRum.ts +387 -0
- package/src/rum/__tests__/DdRum.test.ts +386 -0
- package/src/rum/eventMappers/actionEventMapper.ts +66 -0
- package/src/rum/eventMappers/errorEventMapper.ts +57 -0
- package/src/rum/eventMappers/resourceEventMapper.ts +74 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +2 -2
- package/src/rum/instrumentation/{DdEventsInterceptor.tsx → interactionTracking/DdEventsInterceptor.tsx} +14 -6
- package/src/rum/instrumentation/{DdRumUserInteractionTracking.tsx → interactionTracking/DdRumUserInteractionTracking.tsx} +12 -4
- package/src/rum/instrumentation/{EventsInterceptor.tsx → interactionTracking/EventsInterceptor.tsx} +0 -0
- package/src/rum/instrumentation/{NoOpEventsInterceptor.tsx → interactionTracking/NoOpEventsInterceptor.tsx} +0 -0
- package/src/rum/instrumentation/{ShallowObjectEqualityChecker.ts → interactionTracking/ShallowObjectEqualityChecker.ts} +0 -0
- package/src/rum/instrumentation/{getJsxRuntime.ts → interactionTracking/getJsxRuntime.ts} +0 -0
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +3 -2
- package/src/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.ts +2 -1
- package/src/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.ts +3 -2
- package/src/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/__tests__/ResourceReporter.test.ts +3 -2
- package/src/rum/instrumentation/resourceTracking/implementation/XHRProxy.ts +2 -1
- package/src/rum/instrumentation/resourceTracking/implementation/__tests__/XHRProxy.test.ts +89 -40
- package/src/rum/types.ts +182 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +34 -0
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +44 -0
- package/src/sdk/AttributesSingleton/types.ts +9 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.ts +4 -4
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/__tests__/BoundedBuffer.test.ts +2 -2
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/__tests__/BufferSingleton.test.ts +2 -1
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.tsx +5 -5
- package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/__utils__/renderWithProvider.tsx +2 -2
- package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/initialization.test.tsx +13 -10
- package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/initializationModes.test.tsx +10 -6
- package/src/sdk/EventMappers/EventMapper.ts +94 -0
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +50 -0
- package/src/sdk/EventMappers/utils/__tests__/deepClone.test.ts +79 -0
- package/src/sdk/EventMappers/utils/deepClone.ts +86 -0
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +31 -0
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +29 -0
- package/src/sdk/UserInfoSingleton/types.ts +12 -0
- package/src/types.tsx +0 -210
- package/src/version.ts +1 -1
- package/lib/commonjs/DatadogProvider/Buffer/BoundedBuffer.js.map +0 -1
- package/lib/commonjs/DatadogProvider/DatadogProvider.js.map +0 -1
- package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js.map +0 -1
- package/lib/commonjs/rum/instrumentation/DdRumUserInteractionTracking.js.map +0 -1
- package/lib/module/DatadogProvider/Buffer/BoundedBuffer.js.map +0 -1
- package/lib/module/DatadogProvider/DatadogProvider.js.map +0 -1
- package/lib/module/rum/instrumentation/DdEventsInterceptor.js.map +0 -1
- package/lib/module/rum/instrumentation/DdRumUserInteractionTracking.js.map +0 -1
- package/src/__tests__/DdRumWrapper.test.tsx +0 -74
- package/src/__tests__/foundation.test.ts +0 -88
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The entry point to use Datadog's RUM feature.
|
|
3
|
+
*/
|
|
4
|
+
export declare type DdRumType = {
|
|
5
|
+
/**
|
|
6
|
+
* Start tracking a RUM View.
|
|
7
|
+
* @param key: The view unique key identifier.
|
|
8
|
+
* @param name: The view name.
|
|
9
|
+
* @param context: The additional context to send.
|
|
10
|
+
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
11
|
+
*/
|
|
12
|
+
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Stop tracking a RUM View.
|
|
15
|
+
* @param key: The view unique key identifier.
|
|
16
|
+
* @param context: The additional context to send.
|
|
17
|
+
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
18
|
+
*/
|
|
19
|
+
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Start tracking a RUM Action.
|
|
22
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
23
|
+
* @param name: The action name.
|
|
24
|
+
* @param context: The additional context to send.
|
|
25
|
+
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
26
|
+
*/
|
|
27
|
+
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Stop tracking the ongoing RUM Action.
|
|
30
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
31
|
+
* @param name: The action name.
|
|
32
|
+
* @param context: The additional context to send.
|
|
33
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
34
|
+
*/
|
|
35
|
+
stopAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Stop tracking the ongoing RUM Action.
|
|
38
|
+
*
|
|
39
|
+
* Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated add the `type` and `name` of the action as first two arguments.
|
|
42
|
+
* @param context: The additional context to send.
|
|
43
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
44
|
+
*/
|
|
45
|
+
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Add a RUM Action.
|
|
48
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
49
|
+
* @param name: The action name.
|
|
50
|
+
* @param context: The additional context to send.
|
|
51
|
+
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
52
|
+
*/
|
|
53
|
+
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Start tracking a RUM Resource.
|
|
56
|
+
* @param key: The resource unique key identifier.
|
|
57
|
+
* @param method: The resource method (GET, POST, …).
|
|
58
|
+
* @param url: The resource url.
|
|
59
|
+
* @param context: The additional context to send.
|
|
60
|
+
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
61
|
+
*/
|
|
62
|
+
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Stop tracking a RUM Resource.
|
|
65
|
+
* @param key: The resource unique key identifier.
|
|
66
|
+
* @param statusCode: The resource status code.
|
|
67
|
+
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
68
|
+
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
69
|
+
* @param context: The additional context to send.
|
|
70
|
+
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
71
|
+
*/
|
|
72
|
+
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Add a RUM Error.
|
|
75
|
+
* @param message: The error message.
|
|
76
|
+
* @param source: The error source (network, source, console, webview, custom).
|
|
77
|
+
* @param stacktrace: The error stacktrace.
|
|
78
|
+
* @param context: The additional context to send.
|
|
79
|
+
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
80
|
+
*/
|
|
81
|
+
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
|
|
84
|
+
* @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.
|
|
85
|
+
*/
|
|
86
|
+
addTiming(name: string): Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Describe the type of a RUM Action.
|
|
90
|
+
*/
|
|
91
|
+
export declare enum RumActionType {
|
|
92
|
+
/** User tapped on a widget. */
|
|
93
|
+
TAP = "TAP",
|
|
94
|
+
/** User scrolled a view. */
|
|
95
|
+
SCROLL = "SCROLL",
|
|
96
|
+
/** User swiped on a view. */
|
|
97
|
+
SWIPE = "SWIPE",
|
|
98
|
+
/** User pressed hardware back button (Android only). */
|
|
99
|
+
BACK = "BACK",
|
|
100
|
+
/** A custom action. */
|
|
101
|
+
CUSTOM = "CUSTOM"
|
|
102
|
+
}
|
|
103
|
+
export declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
104
|
+
export declare enum ErrorSource {
|
|
105
|
+
NETWORK = "NETWORK",
|
|
106
|
+
SOURCE = "SOURCE",
|
|
107
|
+
CONSOLE = "CONSOLE",
|
|
108
|
+
WEBVIEW = "WEBVIEW",
|
|
109
|
+
CUSTOM = "CUSTOM"
|
|
110
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Attributes } from './types';
|
|
2
|
+
declare class AttributesProvider {
|
|
3
|
+
private attributes;
|
|
4
|
+
setAttributes: (attributes: Attributes) => void;
|
|
5
|
+
getAttributes: () => Attributes;
|
|
6
|
+
}
|
|
7
|
+
export declare class AttributesSingleton {
|
|
8
|
+
private static attributesProvider;
|
|
9
|
+
static getInstance: () => AttributesProvider;
|
|
10
|
+
static reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import { DatadogProviderConfiguration } from '
|
|
4
|
-
import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '
|
|
3
|
+
import { DatadogProviderConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
4
|
+
import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
5
5
|
declare type Props = PropsWithChildren<{
|
|
6
6
|
/**
|
|
7
7
|
* If a `DatadogProviderConfiguration` instance is passed, the SDK will start tracking errors, resources and actions and sending events.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Attributes } from '../AttributesSingleton/types';
|
|
2
|
+
import type { UserInfo } from '../UserInfoSingleton/types';
|
|
3
|
+
export declare type AdditionalEventDataForMapper = {
|
|
4
|
+
userInfo: UserInfo;
|
|
5
|
+
attributes: Attributes;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Generic class for applying event mappers.
|
|
9
|
+
*
|
|
10
|
+
* Calls params in this order: formatRawEventForMapper, eventMapper, formatMapperEventForNative.
|
|
11
|
+
*
|
|
12
|
+
* @param eventMapper the user-registered event mapper
|
|
13
|
+
* @param formatRawEventForMapper formatter that gets the raw event (from javascript call) and returns the input given to the mapper
|
|
14
|
+
* @param formatMapperEventForNative formatter that gets the ouput of the mapper, and returns the input given to the native SDKs
|
|
15
|
+
* @param formatRawEventForNative called when no event mapper is registered
|
|
16
|
+
*/
|
|
17
|
+
export declare class EventMapper<RawEvent, MapperEvent, NativeEvent> {
|
|
18
|
+
private eventMapper?;
|
|
19
|
+
private formatRawEventForMapper;
|
|
20
|
+
private formatMapperEventForNative;
|
|
21
|
+
private formatRawEventForNative;
|
|
22
|
+
constructor(eventMapper: ((event: MapperEvent) => MapperEvent | null) | undefined, formatRawEventForMapper: (event: RawEvent, additionalData: AdditionalEventDataForMapper) => MapperEvent, formatMapperEventForNative: (event: MapperEvent, originalEvent: MapperEvent) => NativeEvent, formatRawEventForNative: (event: RawEvent) => NativeEvent);
|
|
23
|
+
applyEventMapper: (rawEvent: RawEvent) => NativeEvent | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple deep clone inspired from https://github.com/angus-c/just/blob/master/packages/collection-clone/index.cjs
|
|
3
|
+
* Functions and RegExp will be returned as they are.
|
|
4
|
+
* Maps and Sets are cloned even though they won't be accepted by React Native, just in case they are mutated by the user to avoid side effects.
|
|
5
|
+
*
|
|
6
|
+
* We added support for circular references by limiting the number of depth levels to 8.
|
|
7
|
+
* @param originalObject
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const deepClone: <T>(originalObject: T, depth?: number) => T;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UserInfo } from './types';
|
|
2
|
+
declare class UserInfoProvider {
|
|
3
|
+
private userInfo;
|
|
4
|
+
setUserInfo: (userInfo: UserInfo) => void;
|
|
5
|
+
getUserInfo: () => UserInfo;
|
|
6
|
+
}
|
|
7
|
+
export declare class UserInfoSingleton {
|
|
8
|
+
private static userInfoProvider;
|
|
9
|
+
static getInstance: () => UserInfoProvider;
|
|
10
|
+
static reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -52,35 +52,6 @@ export declare type DdSdkType = {
|
|
|
52
52
|
*/
|
|
53
53
|
setTrackingConsent(trackingConsent: string): Promise<void>;
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
56
|
-
* The entry point to use Datadog's Logs feature.
|
|
57
|
-
*/
|
|
58
|
-
export declare type DdLogsType = {
|
|
59
|
-
/**
|
|
60
|
-
* Send a log with level debug.
|
|
61
|
-
* @param message: The message to send.
|
|
62
|
-
* @param context: The additional context to send.
|
|
63
|
-
*/
|
|
64
|
-
debug(message: string, context?: object): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Send a log with level info.
|
|
67
|
-
* @param message: The message to send.
|
|
68
|
-
* @param context: The additional context to send.
|
|
69
|
-
*/
|
|
70
|
-
info(message: string, context?: object): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* Send a log with level warn.
|
|
73
|
-
* @param message: The message to send.
|
|
74
|
-
* @param context: The additional context to send.
|
|
75
|
-
*/
|
|
76
|
-
warn(message: string, context?: object): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Send a log with level error.
|
|
79
|
-
* @param message: The message to send.
|
|
80
|
-
* @param context: The additional context to send.
|
|
81
|
-
*/
|
|
82
|
-
error(message: string, context?: object): Promise<void>;
|
|
83
|
-
};
|
|
84
55
|
/**
|
|
85
56
|
* The entry point to use Datadog's Trace feature.
|
|
86
57
|
*/
|
|
@@ -100,113 +71,3 @@ export declare type DdTraceType = {
|
|
|
100
71
|
*/
|
|
101
72
|
finishSpan(spanId: string, context?: object, timestampMs?: number): Promise<void>;
|
|
102
73
|
};
|
|
103
|
-
/**
|
|
104
|
-
* The entry point to use Datadog's RUM feature.
|
|
105
|
-
*/
|
|
106
|
-
export declare type DdRumType = {
|
|
107
|
-
/**
|
|
108
|
-
* Start tracking a RUM View.
|
|
109
|
-
* @param key: The view unique key identifier.
|
|
110
|
-
* @param name: The view name.
|
|
111
|
-
* @param context: The additional context to send.
|
|
112
|
-
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
113
|
-
*/
|
|
114
|
-
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Stop tracking a RUM View.
|
|
117
|
-
* @param key: The view unique key identifier.
|
|
118
|
-
* @param context: The additional context to send.
|
|
119
|
-
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
120
|
-
*/
|
|
121
|
-
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
122
|
-
/**
|
|
123
|
-
* Start tracking a RUM Action.
|
|
124
|
-
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
125
|
-
* @param name: The action name.
|
|
126
|
-
* @param context: The additional context to send.
|
|
127
|
-
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
128
|
-
*/
|
|
129
|
-
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
130
|
-
/**
|
|
131
|
-
* Stop tracking the ongoing RUM Action.
|
|
132
|
-
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
133
|
-
* @param name: The action name.
|
|
134
|
-
* @param context: The additional context to send.
|
|
135
|
-
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
136
|
-
*/
|
|
137
|
-
stopAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Stop tracking the ongoing RUM Action.
|
|
140
|
-
*
|
|
141
|
-
* Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.
|
|
142
|
-
*
|
|
143
|
-
* @deprecated add the `type` and `name` of the action as first two arguments.
|
|
144
|
-
* @param context: The additional context to send.
|
|
145
|
-
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
146
|
-
*/
|
|
147
|
-
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* Add a RUM Action.
|
|
150
|
-
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
151
|
-
* @param name: The action name.
|
|
152
|
-
* @param context: The additional context to send.
|
|
153
|
-
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
154
|
-
*/
|
|
155
|
-
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
156
|
-
/**
|
|
157
|
-
* Start tracking a RUM Resource.
|
|
158
|
-
* @param key: The resource unique key identifier.
|
|
159
|
-
* @param method: The resource method (GET, POST, …).
|
|
160
|
-
* @param url: The resource url.
|
|
161
|
-
* @param context: The additional context to send.
|
|
162
|
-
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
163
|
-
*/
|
|
164
|
-
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Stop tracking a RUM Resource.
|
|
167
|
-
* @param key: The resource unique key identifier.
|
|
168
|
-
* @param statusCode: The resource status code.
|
|
169
|
-
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
170
|
-
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
171
|
-
* @param context: The additional context to send.
|
|
172
|
-
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
173
|
-
*/
|
|
174
|
-
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number): Promise<void>;
|
|
175
|
-
/**
|
|
176
|
-
* Add a RUM Error.
|
|
177
|
-
* @param message: The error message.
|
|
178
|
-
* @param source: The error source (network, source, console, webview, custom).
|
|
179
|
-
* @param stacktrace: The error stacktrace.
|
|
180
|
-
* @param context: The additional context to send.
|
|
181
|
-
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
182
|
-
*/
|
|
183
|
-
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
184
|
-
/**
|
|
185
|
-
* Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
|
|
186
|
-
* @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.
|
|
187
|
-
*/
|
|
188
|
-
addTiming(name: string): Promise<void>;
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Describe the type of a RUM Action.
|
|
192
|
-
*/
|
|
193
|
-
export declare enum RumActionType {
|
|
194
|
-
/** User tapped on a widget. */
|
|
195
|
-
TAP = "TAP",
|
|
196
|
-
/** User scrolled a view. */
|
|
197
|
-
SCROLL = "SCROLL",
|
|
198
|
-
/** User swiped on a view. */
|
|
199
|
-
SWIPE = "SWIPE",
|
|
200
|
-
/** User pressed hardware back button (Android only). */
|
|
201
|
-
BACK = "BACK",
|
|
202
|
-
/** A custom action. */
|
|
203
|
-
CUSTOM = "CUSTOM"
|
|
204
|
-
}
|
|
205
|
-
export declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
206
|
-
export declare enum ErrorSource {
|
|
207
|
-
NETWORK = "NETWORK",
|
|
208
|
-
SOURCE = "SOURCE",
|
|
209
|
-
CONSOLE = "CONSOLE",
|
|
210
|
-
WEBVIEW = "WEBVIEW",
|
|
211
|
-
CUSTOM = "CUSTOM"
|
|
212
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.3.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
]
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "c70d62caff28da6111c8e526de4dfbb82bb9bf2d"
|
|
81
81
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* This script replaces the inline require of 'react' in src/rum/instrumentation/getJsxRuntime.ts
|
|
10
|
+
* This script replaces the inline require of 'react' in src/rum/instrumentation/interactionTracking/getJsxRuntime.ts
|
|
11
11
|
* to 'react/jsx-runtime'.
|
|
12
12
|
*
|
|
13
13
|
* Context:
|
|
@@ -28,7 +28,8 @@ const { readFileSync, writeFileSync } = require('fs');
|
|
|
28
28
|
|
|
29
29
|
process.stdout.write('[datadog] postinstall replace-react-require starts\n');
|
|
30
30
|
|
|
31
|
-
const GET_JSX_RUNTIME_RELATIVE_PATH =
|
|
31
|
+
const GET_JSX_RUNTIME_RELATIVE_PATH =
|
|
32
|
+
'rum/instrumentation/interactionTracking/getJsxRuntime';
|
|
32
33
|
|
|
33
34
|
const isJsxExportedInReactVersion = (major, minor) => {
|
|
34
35
|
if (Number(major) > 16) {
|
package/src/DdSdkReactNative.tsx
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
import { InteractionManager } from 'react-native';
|
|
8
8
|
|
|
9
|
-
import { BufferSingleton } from './DatadogProvider/Buffer/BufferSingleton';
|
|
10
9
|
import {
|
|
11
10
|
DdSdkReactNativeConfiguration,
|
|
12
11
|
buildConfigurationFromPartialConfiguration,
|
|
@@ -25,10 +24,17 @@ import { ProxyType } from './ProxyConfiguration';
|
|
|
25
24
|
import { SdkVerbosity } from './SdkVerbosity';
|
|
26
25
|
import type { TrackingConsent } from './TrackingConsent';
|
|
27
26
|
import { DdSdk } from './foundation';
|
|
27
|
+
import { DdLogs } from './logs/DdLogs';
|
|
28
28
|
import { adaptLongTaskThreshold } from './longTasksUtils';
|
|
29
|
+
import { DdRum } from './rum/DdRum';
|
|
29
30
|
import { DdRumErrorTracking } from './rum/instrumentation/DdRumErrorTracking';
|
|
30
|
-
import { DdRumUserInteractionTracking } from './rum/instrumentation/DdRumUserInteractionTracking';
|
|
31
|
+
import { DdRumUserInteractionTracking } from './rum/instrumentation/interactionTracking/DdRumUserInteractionTracking';
|
|
31
32
|
import { DdRumResourceTracking } from './rum/instrumentation/resourceTracking/DdRumResourceTracking';
|
|
33
|
+
import { AttributesSingleton } from './sdk/AttributesSingleton/AttributesSingleton';
|
|
34
|
+
import type { Attributes } from './sdk/AttributesSingleton/types';
|
|
35
|
+
import { BufferSingleton } from './sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
36
|
+
import { UserInfoSingleton } from './sdk/UserInfoSingleton/UserInfoSingleton';
|
|
37
|
+
import type { UserInfo } from './sdk/UserInfoSingleton/types';
|
|
32
38
|
import { DdSdkConfiguration } from './types';
|
|
33
39
|
import { version as sdkVersion } from './version';
|
|
34
40
|
|
|
@@ -42,6 +48,8 @@ export class DdSdkReactNative {
|
|
|
42
48
|
private static readonly DD_SDK_VERBOSITY_KEY = '_dd.sdk_verbosity';
|
|
43
49
|
private static readonly DD_NATIVE_VIEW_TRACKING_KEY =
|
|
44
50
|
'_dd.native_view_tracking';
|
|
51
|
+
private static readonly DD_NATIVE_INTERACTION_TRACKING_KEY =
|
|
52
|
+
'_dd.native_interaction_tracking';
|
|
45
53
|
private static readonly DD_VERSION = '_dd.version';
|
|
46
54
|
private static readonly DD_VERSION_SUFFIX = '_dd.version_suffix';
|
|
47
55
|
|
|
@@ -185,17 +193,19 @@ export class DdSdkReactNative {
|
|
|
185
193
|
};
|
|
186
194
|
|
|
187
195
|
/**
|
|
188
|
-
*
|
|
196
|
+
* Adds a set of attributes to the global context attached with all future Logs, Spans and RUM events.
|
|
197
|
+
* To remove an attribute, set it to `undefined` in a call to `setAttributes`.
|
|
189
198
|
* @param attributes: The global context attributes.
|
|
190
199
|
* @returns a Promise.
|
|
191
200
|
*/
|
|
192
201
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
193
|
-
static setAttributes(attributes:
|
|
202
|
+
static async setAttributes(attributes: Attributes): Promise<void> {
|
|
194
203
|
InternalLog.log(
|
|
195
204
|
`Setting attributes ${JSON.stringify(attributes)}`,
|
|
196
205
|
SdkVerbosity.DEBUG
|
|
197
206
|
);
|
|
198
|
-
|
|
207
|
+
await DdSdk.setAttributes(attributes);
|
|
208
|
+
AttributesSingleton.getInstance().setAttributes(attributes);
|
|
199
209
|
}
|
|
200
210
|
|
|
201
211
|
/**
|
|
@@ -204,12 +214,13 @@ export class DdSdkReactNative {
|
|
|
204
214
|
* @returns a Promise.
|
|
205
215
|
*/
|
|
206
216
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
207
|
-
static setUser(user:
|
|
217
|
+
static async setUser(user: UserInfo): Promise<void> {
|
|
208
218
|
InternalLog.log(
|
|
209
219
|
`Setting user ${JSON.stringify(user)}`,
|
|
210
220
|
SdkVerbosity.DEBUG
|
|
211
221
|
);
|
|
212
|
-
|
|
222
|
+
await DdSdk.setUser(user);
|
|
223
|
+
UserInfoSingleton.getInstance().setUserInfo(user);
|
|
213
224
|
}
|
|
214
225
|
|
|
215
226
|
/**
|
|
@@ -233,6 +244,10 @@ export class DdSdkReactNative {
|
|
|
233
244
|
configuration.additionalConfig[
|
|
234
245
|
DdSdkReactNative.DD_NATIVE_VIEW_TRACKING_KEY
|
|
235
246
|
] = configuration.nativeViewTracking;
|
|
247
|
+
configuration.additionalConfig[
|
|
248
|
+
DdSdkReactNative.DD_NATIVE_INTERACTION_TRACKING_KEY
|
|
249
|
+
] = configuration.nativeInteractionTracking;
|
|
250
|
+
|
|
236
251
|
if (configuration.verbosity) {
|
|
237
252
|
configuration.additionalConfig[
|
|
238
253
|
DdSdkReactNative.DD_SDK_VERBOSITY_KEY
|
|
@@ -314,6 +329,25 @@ export class DdSdkReactNative {
|
|
|
314
329
|
if (configuration.trackErrors) {
|
|
315
330
|
DdRumErrorTracking.startTracking();
|
|
316
331
|
}
|
|
332
|
+
|
|
333
|
+
if (configuration.logEventMapper) {
|
|
334
|
+
DdLogs.registerLogEventMapper(configuration.logEventMapper);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (configuration.errorEventMapper) {
|
|
338
|
+
DdRum.registerErrorEventMapper(configuration.errorEventMapper);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (configuration.resourceEventMapper) {
|
|
342
|
+
DdRum.registerResourceEventMapper(
|
|
343
|
+
configuration.resourceEventMapper
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (configuration.actionEventMapper) {
|
|
348
|
+
DdRum.registerActionEventMapper(configuration.actionEventMapper);
|
|
349
|
+
}
|
|
350
|
+
|
|
317
351
|
DdSdkReactNative.wasAutoInstrumented = true;
|
|
318
352
|
}
|
|
319
353
|
}
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
import type { ProxyConfiguration } from './ProxyConfiguration';
|
|
8
8
|
import type { SdkVerbosity } from './SdkVerbosity';
|
|
9
9
|
import { TrackingConsent } from './TrackingConsent';
|
|
10
|
+
import type { LogEventMapper } from './logs/types';
|
|
11
|
+
import type { ActionEventMapper } from './rum/eventMappers/actionEventMapper';
|
|
12
|
+
import type { ErrorEventMapper } from './rum/eventMappers/errorEventMapper';
|
|
13
|
+
import type { ResourceEventMapper } from './rum/eventMappers/resourceEventMapper';
|
|
10
14
|
|
|
11
15
|
export enum VitalsUpdateFrequency {
|
|
12
16
|
FREQUENT = 'FREQUENT',
|
|
@@ -23,11 +27,16 @@ const DEFAULTS = {
|
|
|
23
27
|
longTaskThresholdMs: 0,
|
|
24
28
|
nativeLongTaskThresholdMs: 200,
|
|
25
29
|
nativeViewTracking: false,
|
|
30
|
+
nativeInteractionTracking: false,
|
|
26
31
|
getFirstPartyHosts: () => [],
|
|
27
32
|
getAdditionalConfig: () => ({}),
|
|
28
33
|
trackingConsent: TrackingConsent.GRANTED,
|
|
29
34
|
telemetrySampleRate: 20.0,
|
|
30
|
-
vitalsUpdateFrequency: VitalsUpdateFrequency.AVERAGE
|
|
35
|
+
vitalsUpdateFrequency: VitalsUpdateFrequency.AVERAGE,
|
|
36
|
+
logEventMapper: null,
|
|
37
|
+
errorEventMapper: null,
|
|
38
|
+
resourceEventMapper: null,
|
|
39
|
+
actionEventMapper: null
|
|
31
40
|
};
|
|
32
41
|
|
|
33
42
|
/**
|
|
@@ -64,6 +73,12 @@ export class DdSdkReactNativeConfiguration {
|
|
|
64
73
|
* Set to `true` if you use a custom navigation system relying on native views.
|
|
65
74
|
*/
|
|
66
75
|
public nativeViewTracking: boolean = DEFAULTS.nativeViewTracking;
|
|
76
|
+
/**
|
|
77
|
+
* Enables native interaction tracking.
|
|
78
|
+
* Set to `true` if you want to track interactions on native screens.
|
|
79
|
+
*/
|
|
80
|
+
public nativeInteractionTracking: boolean =
|
|
81
|
+
DEFAULTS.nativeInteractionTracking;
|
|
67
82
|
public proxyConfig?: ProxyConfiguration = undefined;
|
|
68
83
|
public serviceName?: string = undefined;
|
|
69
84
|
/**
|
|
@@ -134,6 +149,17 @@ export class DdSdkReactNativeConfiguration {
|
|
|
134
149
|
public vitalsUpdateFrequency: VitalsUpdateFrequency =
|
|
135
150
|
DEFAULTS.vitalsUpdateFrequency;
|
|
136
151
|
|
|
152
|
+
public logEventMapper: LogEventMapper | null = DEFAULTS.logEventMapper;
|
|
153
|
+
|
|
154
|
+
public errorEventMapper: ErrorEventMapper | null =
|
|
155
|
+
DEFAULTS.errorEventMapper;
|
|
156
|
+
|
|
157
|
+
public resourceEventMapper: ResourceEventMapper | null =
|
|
158
|
+
DEFAULTS.resourceEventMapper;
|
|
159
|
+
|
|
160
|
+
public actionEventMapper: ActionEventMapper | null =
|
|
161
|
+
DEFAULTS.actionEventMapper;
|
|
162
|
+
|
|
137
163
|
public additionalConfig: {
|
|
138
164
|
[k: string]: any;
|
|
139
165
|
} = DEFAULTS.getAdditionalConfig();
|
|
@@ -159,6 +185,10 @@ export type AutoInstrumentationConfiguration = {
|
|
|
159
185
|
readonly firstPartyHosts?: string[];
|
|
160
186
|
readonly resourceTracingSamplingRate?: number;
|
|
161
187
|
readonly trackErrors: boolean;
|
|
188
|
+
readonly logEventMapper?: LogEventMapper | null;
|
|
189
|
+
readonly errorEventMapper?: ErrorEventMapper | null;
|
|
190
|
+
readonly resourceEventMapper?: ResourceEventMapper | null;
|
|
191
|
+
readonly actionEventMapper?: ActionEventMapper | null;
|
|
162
192
|
};
|
|
163
193
|
|
|
164
194
|
/**
|
|
@@ -170,6 +200,10 @@ export type AutoInstrumentationParameters = {
|
|
|
170
200
|
readonly firstPartyHosts: string[];
|
|
171
201
|
readonly resourceTracingSamplingRate: number;
|
|
172
202
|
readonly trackErrors: boolean;
|
|
203
|
+
readonly logEventMapper: LogEventMapper | null;
|
|
204
|
+
readonly errorEventMapper: ErrorEventMapper | null;
|
|
205
|
+
readonly resourceEventMapper: ResourceEventMapper | null;
|
|
206
|
+
readonly actionEventMapper: ActionEventMapper | null;
|
|
173
207
|
};
|
|
174
208
|
|
|
175
209
|
/**
|
|
@@ -184,8 +218,25 @@ export const addDefaultValuesToAutoInstrumentationConfiguration = (
|
|
|
184
218
|
firstPartyHosts:
|
|
185
219
|
features.firstPartyHosts || DEFAULTS.getFirstPartyHosts(),
|
|
186
220
|
resourceTracingSamplingRate:
|
|
187
|
-
features.resourceTracingSamplingRate
|
|
188
|
-
|
|
221
|
+
features.resourceTracingSamplingRate === undefined
|
|
222
|
+
? DEFAULTS.resourceTracingSamplingRate
|
|
223
|
+
: features.resourceTracingSamplingRate,
|
|
224
|
+
logEventMapper:
|
|
225
|
+
features.logEventMapper === undefined
|
|
226
|
+
? DEFAULTS.logEventMapper
|
|
227
|
+
: features.logEventMapper,
|
|
228
|
+
errorEventMapper:
|
|
229
|
+
features.errorEventMapper === undefined
|
|
230
|
+
? DEFAULTS.errorEventMapper
|
|
231
|
+
: features.errorEventMapper,
|
|
232
|
+
resourceEventMapper:
|
|
233
|
+
features.resourceEventMapper === undefined
|
|
234
|
+
? DEFAULTS.resourceEventMapper
|
|
235
|
+
: features.resourceEventMapper,
|
|
236
|
+
actionEventMapper:
|
|
237
|
+
features.actionEventMapper === undefined
|
|
238
|
+
? DEFAULTS.actionEventMapper
|
|
239
|
+
: features.actionEventMapper
|
|
189
240
|
};
|
|
190
241
|
};
|
|
191
242
|
|
|
@@ -197,6 +248,7 @@ export type PartialInitializationConfiguration = {
|
|
|
197
248
|
readonly site?: string;
|
|
198
249
|
readonly verbosity?: SdkVerbosity | undefined;
|
|
199
250
|
readonly nativeViewTracking?: boolean;
|
|
251
|
+
readonly nativeInteractionTracking?: boolean;
|
|
200
252
|
readonly proxyConfig?: ProxyConfiguration;
|
|
201
253
|
readonly serviceName?: string;
|
|
202
254
|
readonly version?: string;
|
|
@@ -264,6 +316,34 @@ export const buildConfigurationFromPartialConfiguration = (
|
|
|
264
316
|
{ name: 'firstPartyHosts', value: features.firstPartyHosts },
|
|
265
317
|
SdkConfiguration
|
|
266
318
|
);
|
|
319
|
+
setConfigurationAttribute(
|
|
320
|
+
{
|
|
321
|
+
name: 'logEventMapper',
|
|
322
|
+
value: features.logEventMapper
|
|
323
|
+
},
|
|
324
|
+
SdkConfiguration
|
|
325
|
+
);
|
|
326
|
+
setConfigurationAttribute(
|
|
327
|
+
{
|
|
328
|
+
name: 'errorEventMapper',
|
|
329
|
+
value: features.errorEventMapper
|
|
330
|
+
},
|
|
331
|
+
SdkConfiguration
|
|
332
|
+
);
|
|
333
|
+
setConfigurationAttribute(
|
|
334
|
+
{
|
|
335
|
+
name: 'resourceEventMapper',
|
|
336
|
+
value: features.resourceEventMapper
|
|
337
|
+
},
|
|
338
|
+
SdkConfiguration
|
|
339
|
+
);
|
|
340
|
+
setConfigurationAttribute(
|
|
341
|
+
{
|
|
342
|
+
name: 'actionEventMapper',
|
|
343
|
+
value: features.actionEventMapper
|
|
344
|
+
},
|
|
345
|
+
SdkConfiguration
|
|
346
|
+
);
|
|
267
347
|
|
|
268
348
|
return SdkConfiguration;
|
|
269
349
|
};
|