@datadog/mobile-react-native 2.6.1 → 2.6.3
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/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt +3 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +8 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +14 -0
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt +14 -7
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +49 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +7 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +8 -1
- package/ios/Sources/DdSdkConfiguration.swift +9 -1
- package/ios/Sources/DdSdkNativeInitialization.swift +3 -1
- package/ios/Sources/RNDdSdkConfiguration.swift +24 -2
- package/ios/Sources/SdkVersion.swift +1 -1
- package/jest/mock.js +5 -2
- package/lib/commonjs/DdSdkReactNative.js +1 -1
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +20 -2
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/index.js +33 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +2 -2
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +14 -11
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +77 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js +44 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +5 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +36 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/types.js +3 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/DdSdkReactNative.js +1 -1
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +19 -1
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/index.js +6 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +2 -2
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/rum/DdRum.js +15 -12
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +70 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js +37 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +4 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +32 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +2 -2
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/types.js +3 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +25 -0
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +8 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +7 -3
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +45 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +6 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/rum/types.d.ts +31 -6
- package/lib/typescript/rum/types.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +4 -1
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +3 -1
- package/src/DdSdkReactNativeConfiguration.tsx +31 -1
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +6 -0
- package/src/index.tsx +17 -4
- package/src/logs/DdLogs.ts +2 -2
- package/src/rum/DdRum.ts +38 -28
- package/src/rum/__tests__/DdRum.test.ts +628 -23
- package/src/rum/__tests__/__utils__/TracingHeadersUtils.ts +166 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +81 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.ts +49 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +5 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +71 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +2 -2
- package/src/rum/types.ts +42 -7
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +2 -0
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +4 -0
- package/src/types.tsx +5 -1
- package/src/version.ts +1 -1
|
@@ -34,6 +34,7 @@ describe('DdSdkReactNativeConfiguration', () => {
|
|
|
34
34
|
"actionEventMapper": null,
|
|
35
35
|
"additionalConfiguration": {},
|
|
36
36
|
"applicationId": "fake-app-id",
|
|
37
|
+
"batchProcessingLevel": "MEDIUM",
|
|
37
38
|
"batchSize": "MEDIUM",
|
|
38
39
|
"bundleLogsWithRum": true,
|
|
39
40
|
"bundleLogsWithTraces": true,
|
|
@@ -60,6 +61,7 @@ describe('DdSdkReactNativeConfiguration', () => {
|
|
|
60
61
|
"trackFrustrations": true,
|
|
61
62
|
"trackInteractions": false,
|
|
62
63
|
"trackResources": false,
|
|
64
|
+
"trackWatchdogTerminations": false,
|
|
63
65
|
"trackingConsent": "granted",
|
|
64
66
|
"uploadFrequency": "AVERAGE",
|
|
65
67
|
"useAccessibilityLabel": true,
|
|
@@ -130,6 +132,7 @@ describe('DdSdkReactNativeConfiguration', () => {
|
|
|
130
132
|
"additionalField": "fake-value",
|
|
131
133
|
},
|
|
132
134
|
"applicationId": "fake-app-id",
|
|
135
|
+
"batchProcessingLevel": "MEDIUM",
|
|
133
136
|
"batchSize": "LARGE",
|
|
134
137
|
"bundleLogsWithRum": true,
|
|
135
138
|
"bundleLogsWithTraces": true,
|
|
@@ -166,6 +169,7 @@ describe('DdSdkReactNativeConfiguration', () => {
|
|
|
166
169
|
"trackFrustrations": true,
|
|
167
170
|
"trackInteractions": true,
|
|
168
171
|
"trackResources": true,
|
|
172
|
+
"trackWatchdogTerminations": false,
|
|
169
173
|
"trackingConsent": "pending",
|
|
170
174
|
"uploadFrequency": "FREQUENT",
|
|
171
175
|
"useAccessibilityLabel": true,
|
|
@@ -214,6 +218,7 @@ describe('DdSdkReactNativeConfiguration', () => {
|
|
|
214
218
|
"actionEventMapper": null,
|
|
215
219
|
"additionalConfiguration": {},
|
|
216
220
|
"applicationId": "",
|
|
221
|
+
"batchProcessingLevel": "MEDIUM",
|
|
217
222
|
"batchSize": "MEDIUM",
|
|
218
223
|
"bundleLogsWithRum": false,
|
|
219
224
|
"bundleLogsWithTraces": false,
|
|
@@ -240,6 +245,7 @@ describe('DdSdkReactNativeConfiguration', () => {
|
|
|
240
245
|
"trackFrustrations": false,
|
|
241
246
|
"trackInteractions": false,
|
|
242
247
|
"trackResources": false,
|
|
248
|
+
"trackWatchdogTerminations": false,
|
|
243
249
|
"trackingConsent": "granted",
|
|
244
250
|
"uploadFrequency": "AVERAGE",
|
|
245
251
|
"useAccessibilityLabel": false,
|
package/src/index.tsx
CHANGED
|
@@ -11,9 +11,11 @@ import {
|
|
|
11
11
|
InitializationMode,
|
|
12
12
|
VitalsUpdateFrequency,
|
|
13
13
|
UploadFrequency,
|
|
14
|
-
BatchSize
|
|
14
|
+
BatchSize,
|
|
15
|
+
BatchProcessingLevel
|
|
15
16
|
} from './DdSdkReactNativeConfiguration';
|
|
16
17
|
import { DdSdkReactNative } from './DdSdkReactNative';
|
|
18
|
+
import { DdSdk } from './sdk/DdSdk';
|
|
17
19
|
import { InternalLog } from './InternalLog';
|
|
18
20
|
import { ProxyConfiguration, ProxyType } from './ProxyConfiguration';
|
|
19
21
|
import { SdkVerbosity } from './SdkVerbosity';
|
|
@@ -32,7 +34,13 @@ import { DdTrace } from './trace/DdTrace';
|
|
|
32
34
|
import { DefaultTimeProvider } from './utils/time-provider/DefaultTimeProvider';
|
|
33
35
|
import { TimeProvider } from './utils/time-provider/TimeProvider';
|
|
34
36
|
import type { Timestamp } from './utils/time-provider/TimeProvider';
|
|
35
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
TracingIdType,
|
|
39
|
+
TracingIdFormat
|
|
40
|
+
} from './rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier';
|
|
41
|
+
import { DatadogTracingIdentifier } from './rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier';
|
|
42
|
+
import { DatadogTracingContext } from './rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext';
|
|
43
|
+
import type { FirstPartyHost } from './rum/types';
|
|
36
44
|
|
|
37
45
|
/* eslint-enable arca/import-ordering */
|
|
38
46
|
|
|
@@ -48,6 +56,7 @@ export {
|
|
|
48
56
|
ErrorSource,
|
|
49
57
|
DdSdkReactNativeConfiguration,
|
|
50
58
|
DdSdkReactNative,
|
|
59
|
+
DdSdk,
|
|
51
60
|
InternalLog,
|
|
52
61
|
ProxyConfiguration,
|
|
53
62
|
ProxyType,
|
|
@@ -57,12 +66,16 @@ export {
|
|
|
57
66
|
PropagatorType,
|
|
58
67
|
UploadFrequency,
|
|
59
68
|
BatchSize,
|
|
69
|
+
BatchProcessingLevel,
|
|
60
70
|
TimeProvider,
|
|
61
71
|
DefaultTimeProvider,
|
|
62
72
|
DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER,
|
|
63
73
|
DATADOG_GRAPH_QL_OPERATION_NAME_HEADER,
|
|
64
74
|
DATADOG_GRAPH_QL_VARIABLES_HEADER,
|
|
65
|
-
TracingIdType
|
|
75
|
+
TracingIdType,
|
|
76
|
+
TracingIdFormat,
|
|
77
|
+
DatadogTracingIdentifier,
|
|
78
|
+
DatadogTracingContext
|
|
66
79
|
};
|
|
67
80
|
|
|
68
|
-
export type { Timestamp };
|
|
81
|
+
export type { Timestamp, FirstPartyHost };
|
package/src/logs/DdLogs.ts
CHANGED
|
@@ -180,7 +180,7 @@ class DdLogsWrapper implements DdLogsType {
|
|
|
180
180
|
stacktrace: string | undefined,
|
|
181
181
|
context: object,
|
|
182
182
|
status: 'debug' | 'info' | 'warn' | 'error',
|
|
183
|
-
fingerprint
|
|
183
|
+
fingerprint: string = '',
|
|
184
184
|
source?: ErrorSource
|
|
185
185
|
): Promise<void> => {
|
|
186
186
|
const rawLogEvent: RawLogWithError = {
|
|
@@ -190,7 +190,7 @@ class DdLogsWrapper implements DdLogsType {
|
|
|
190
190
|
stacktrace,
|
|
191
191
|
context,
|
|
192
192
|
status,
|
|
193
|
-
fingerprint
|
|
193
|
+
fingerprint,
|
|
194
194
|
source
|
|
195
195
|
};
|
|
196
196
|
|
package/src/rum/DdRum.ts
CHANGED
|
@@ -17,22 +17,26 @@ import { DefaultTimeProvider } from '../utils/time-provider/DefaultTimeProvider'
|
|
|
17
17
|
import type { TimeProvider } from '../utils/time-provider/TimeProvider';
|
|
18
18
|
|
|
19
19
|
import { DdAttributes } from './DdAttributes';
|
|
20
|
-
import type { ActionEventMapper } from './eventMappers/actionEventMapper';
|
|
21
20
|
import { generateActionEventMapper } from './eventMappers/actionEventMapper';
|
|
22
|
-
import type {
|
|
21
|
+
import type { ActionEventMapper } from './eventMappers/actionEventMapper';
|
|
23
22
|
import { generateErrorEventMapper } from './eventMappers/errorEventMapper';
|
|
24
|
-
import type {
|
|
23
|
+
import type { ErrorEventMapper } from './eventMappers/errorEventMapper';
|
|
25
24
|
import { generateResourceEventMapper } from './eventMappers/resourceEventMapper';
|
|
25
|
+
import type { ResourceEventMapper } from './eventMappers/resourceEventMapper';
|
|
26
|
+
import type { DatadogTracingContext } from './instrumentation/resourceTracking/distributedTracing/DatadogTracingContext';
|
|
27
|
+
import { DatadogTracingIdentifier } from './instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier';
|
|
28
|
+
import { TracingIdentifier } from './instrumentation/resourceTracking/distributedTracing/TracingIdentifier';
|
|
26
29
|
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from './instrumentation/resourceTracking/distributedTracing/TracingIdentifier';
|
|
30
|
+
getTracingContext,
|
|
31
|
+
getTracingContextForPropagators
|
|
32
|
+
} from './instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders';
|
|
31
33
|
import type {
|
|
32
34
|
ErrorSource,
|
|
33
35
|
DdRumType,
|
|
34
36
|
RumActionType,
|
|
35
|
-
ResourceKind
|
|
37
|
+
ResourceKind,
|
|
38
|
+
FirstPartyHost,
|
|
39
|
+
PropagatorType
|
|
36
40
|
} from './types';
|
|
37
41
|
|
|
38
42
|
const generateEmptyPromise = () => new Promise<void>(resolve => resolve());
|
|
@@ -230,26 +234,6 @@ class DdRumWrapper implements DdRumType {
|
|
|
230
234
|
);
|
|
231
235
|
};
|
|
232
236
|
|
|
233
|
-
generateUUID = (type: TracingIdType): string => {
|
|
234
|
-
switch (type) {
|
|
235
|
-
case TracingIdType.trace:
|
|
236
|
-
return TracingIdentifier.createTraceId().toString(
|
|
237
|
-
TracingIdFormat.paddedHex
|
|
238
|
-
);
|
|
239
|
-
case TracingIdType.span:
|
|
240
|
-
return TracingIdentifier.createSpanId().toString(
|
|
241
|
-
TracingIdFormat.decimal
|
|
242
|
-
);
|
|
243
|
-
default:
|
|
244
|
-
console.warn(
|
|
245
|
-
`Unsupported tracing ID type '${type}' for generateUUID. Falling back to 64 bit Span ID.`
|
|
246
|
-
);
|
|
247
|
-
return TracingIdentifier.createSpanId().toString(
|
|
248
|
-
TracingIdFormat.decimal
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
|
|
253
237
|
addError = (
|
|
254
238
|
message: string,
|
|
255
239
|
source: ErrorSource,
|
|
@@ -320,6 +304,32 @@ class DdRumWrapper implements DdRumType {
|
|
|
320
304
|
return this.nativeRum.getCurrentSessionId();
|
|
321
305
|
}
|
|
322
306
|
|
|
307
|
+
getTracingContext = (
|
|
308
|
+
url: string,
|
|
309
|
+
tracingSamplingRate: number,
|
|
310
|
+
firstPartyHosts: FirstPartyHost[]
|
|
311
|
+
): DatadogTracingContext => {
|
|
312
|
+
return getTracingContext(url, tracingSamplingRate, firstPartyHosts);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
getTracingContextForPropagators = (
|
|
316
|
+
propagators: PropagatorType[],
|
|
317
|
+
tracingSamplingRate: number
|
|
318
|
+
): DatadogTracingContext => {
|
|
319
|
+
return getTracingContextForPropagators(
|
|
320
|
+
propagators,
|
|
321
|
+
tracingSamplingRate
|
|
322
|
+
);
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
generateTraceId(): DatadogTracingIdentifier {
|
|
326
|
+
return new DatadogTracingIdentifier(TracingIdentifier.createTraceId());
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
generateSpanId(): DatadogTracingIdentifier {
|
|
330
|
+
return new DatadogTracingIdentifier(TracingIdentifier.createSpanId());
|
|
331
|
+
}
|
|
332
|
+
|
|
323
333
|
registerErrorEventMapper(errorEventMapper: ErrorEventMapper) {
|
|
324
334
|
this.errorEventMapper = generateErrorEventMapper(errorEventMapper);
|
|
325
335
|
}
|