@nativescript-community/sentry 4.6.20 → 4.6.22
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/breadcrumb.d.ts +10 -0
- package/breadcrumb.js +34 -0
- package/breadcrumb.js.map +1 -0
- package/client.d.ts +5 -1
- package/client.js +49 -13
- package/client.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -8
- package/index.js.map +1 -1
- package/integrations/debugsymbolicator.js +0 -6
- package/integrations/debugsymbolicator.js.map +1 -1
- package/integrations/default.d.ts +13 -0
- package/integrations/default.js +114 -0
- package/integrations/default.js.map +1 -0
- package/integrations/devicecontext.js +50 -19
- package/integrations/devicecontext.js.map +1 -1
- package/integrations/factory.d.ts +6 -0
- package/integrations/factory.js +13 -0
- package/integrations/factory.js.map +1 -0
- package/integrations/rewriteframe.d.ts +0 -0
- package/integrations/rewriteframe.js +1 -0
- package/integrations/rewriteframe.js.map +1 -0
- package/measurements.d.ts +5 -4
- package/measurements.js +5 -49
- package/measurements.js.map +1 -1
- package/options.d.ts +46 -7
- package/package.json +9 -9
- package/platforms/android/native-api-usage.json +2 -0
- package/platforms/ios/Podfile +1 -1
- package/platforms/ios/src/NSSentry.h +4 -1
- package/sdk.d.ts +1 -4
- package/sdk.js +62 -59
- package/sdk.js.map +1 -1
- package/tracing/addTracingExtensions.d.ts +7 -0
- package/{measurement.js → tracing/addTracingExtensions.js} +17 -10
- package/tracing/addTracingExtensions.js.map +1 -0
- package/tracing/nstracing.d.ts +49 -1
- package/tracing/nstracing.js +148 -25
- package/tracing/nstracing.js.map +1 -1
- package/tracing/ops.d.ts +7 -0
- package/tracing/ops.js +8 -0
- package/tracing/ops.js.map +1 -0
- package/tracing/routingInstrumentation.d.ts +5 -0
- package/tracing/routingInstrumentation.js +3 -0
- package/tracing/routingInstrumentation.js.map +1 -1
- package/tracing/transaction.d.ts +10 -0
- package/tracing/transaction.js +36 -0
- package/tracing/transaction.js.map +1 -0
- package/wrapper.android.js +7 -1
- package/wrapper.android.js.map +1 -1
- package/wrapper.d.ts +32 -0
- package/wrapper.ios.d.ts +2 -4
- package/wrapper.ios.js +34 -12
- package/wrapper.ios.js.map +1 -1
- package/backend.d.ts +0 -105
- package/backend.js +0 -78
- package/backend.js.map +0 -1
- package/measurement.d.ts +0 -4
- package/measurement.js.map +0 -1
- package/nssentry.android.d.ts +0 -30
- package/nssentry.android.js +0 -645
- package/nssentry.android.js.map +0 -1
- package/nssentry.d.ts +0 -38
- package/nssentry.ios.d.ts +0 -34
- package/nssentry.ios.js +0 -286
- package/nssentry.ios.js.map +0 -1
package/measurements.js
CHANGED
@@ -1,50 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
export function _addTracingExtensions() {
|
7
|
-
const carrier = getMainCarrier();
|
8
|
-
if (carrier.__SENTRY__) {
|
9
|
-
carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
|
10
|
-
if (carrier.__SENTRY__.extensions.startTransaction) {
|
11
|
-
const originalStartTransaction = carrier.__SENTRY__.extensions
|
12
|
-
.startTransaction;
|
13
|
-
/*
|
14
|
-
Overwrites the transaction start and finish to start and finish stall tracking.
|
15
|
-
Preferably instead of overwriting add a callback method for this in the Transaction itself.
|
16
|
-
*/
|
17
|
-
const _startTransaction = _patchStartTransaction(originalStartTransaction);
|
18
|
-
carrier.__SENTRY__.extensions.startTransaction = _startTransaction;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
22
|
-
/**
|
23
|
-
* Overwrite the startTransaction extension method to start and end stall tracking.
|
24
|
-
*/
|
25
|
-
const _patchStartTransaction = (originalStartTransaction) => {
|
26
|
-
/**
|
27
|
-
* Method to overwrite with
|
28
|
-
*/
|
29
|
-
function _startTransaction(transactionContext, customSamplingContext) {
|
30
|
-
const transaction = originalStartTransaction.apply(this, [
|
31
|
-
transactionContext,
|
32
|
-
customSamplingContext,
|
33
|
-
]);
|
34
|
-
const nativescriptTracing = getCurrentHub().getIntegration(NativescriptTracing);
|
35
|
-
if (nativescriptTracing) {
|
36
|
-
nativescriptTracing.onTransactionStart(transaction);
|
37
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
38
|
-
const originalFinish = transaction.finish;
|
39
|
-
transaction.finish = (endTimestamp) => {
|
40
|
-
if (nativescriptTracing) {
|
41
|
-
nativescriptTracing.onTransactionFinish(transaction);
|
42
|
-
}
|
43
|
-
return originalFinish.apply(transaction, [endTimestamp]);
|
44
|
-
};
|
45
|
-
}
|
46
|
-
return transaction;
|
47
|
-
}
|
48
|
-
return _startTransaction;
|
49
|
-
};
|
1
|
+
export const APP_START_WARM = 'app_start_warm';
|
2
|
+
export const APP_START_COLD = 'app_start_cold';
|
3
|
+
export const STALL_COUNT = 'stall_count';
|
4
|
+
export const STALL_TOTAL_TIME = 'stall_total_time';
|
5
|
+
export const STALL_LONGEST_TIME = 'stall_longest_time';
|
50
6
|
//# sourceMappingURL=measurements.js.map
|
package/measurements.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"measurements.js","sourceRoot":"","sources":["../src/measurements.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"measurements.js","sourceRoot":"","sources":["../src/measurements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC"}
|
package/options.d.ts
CHANGED
@@ -48,12 +48,6 @@ export interface BaseNativescriptOptions {
|
|
48
48
|
/** When enabled, all the threads are automatically attached to all logged events on Android */
|
49
49
|
attachThreads?: boolean;
|
50
50
|
/**
|
51
|
-
* When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.
|
52
|
-
*
|
53
|
-
* @default false
|
54
|
-
*/
|
55
|
-
attachScreenshot?: boolean;
|
56
|
-
/**
|
57
51
|
* When enabled, certain personally identifiable information (PII) is added by active integrations.
|
58
52
|
*
|
59
53
|
* @default false
|
@@ -73,9 +67,15 @@ export interface BaseNativescriptOptions {
|
|
73
67
|
* See the following link for more information and possible restrictions:
|
74
68
|
* https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/
|
75
69
|
*
|
70
|
+
* Renamed from `enableOutOfMemoryTracking` in v5.
|
71
|
+
*
|
76
72
|
* @default true
|
77
73
|
*/
|
78
|
-
|
74
|
+
enableWatchdogTerminationTracking?: boolean;
|
75
|
+
/**
|
76
|
+
* Set data to the inital scope
|
77
|
+
* @deprecated Use `Sentry.configureScope(...)`
|
78
|
+
*/
|
79
79
|
/**
|
80
80
|
* The max cache items for capping the number of envelopes.
|
81
81
|
*
|
@@ -111,6 +111,45 @@ export interface BaseNativescriptOptions {
|
|
111
111
|
*/
|
112
112
|
colnoOffset?: number;
|
113
113
|
[k: string]: any;
|
114
|
+
/**
|
115
|
+
* When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.
|
116
|
+
*
|
117
|
+
* @default false
|
118
|
+
*/
|
119
|
+
attachScreenshot?: boolean;
|
120
|
+
/**
|
121
|
+
* When enabled Sentry includes the current view hierarchy in the error attachments.
|
122
|
+
*
|
123
|
+
* @default false
|
124
|
+
*/
|
125
|
+
attachViewHierarchy?: boolean;
|
126
|
+
/**
|
127
|
+
* When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.
|
128
|
+
* [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)
|
129
|
+
* is needed to capture HTTP Errors on Android.
|
130
|
+
*
|
131
|
+
* @default false
|
132
|
+
*/
|
133
|
+
enableCaptureFailedRequests?: boolean;
|
134
|
+
/**
|
135
|
+
* This option will enable forwarding captured Sentry events to Spotlight.
|
136
|
+
*
|
137
|
+
* More details: https://spotlightjs.com/
|
138
|
+
*
|
139
|
+
* IMPORTANT: Only set this option to `true` while developing, not in production!
|
140
|
+
*/
|
141
|
+
enableSpotlight?: boolean;
|
142
|
+
/**
|
143
|
+
* This option changes the default Spotlight Sidecar URL.
|
144
|
+
*
|
145
|
+
* By default, the SDK expects the Sidecar to be running
|
146
|
+
* on the same host as React Native Metro Dev Server.
|
147
|
+
*
|
148
|
+
* More details: https://spotlightjs.com/
|
149
|
+
*
|
150
|
+
* @default "http://localhost:8969/stream"
|
151
|
+
*/
|
152
|
+
spotlightSidecarUrl?: string;
|
114
153
|
}
|
115
154
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
116
155
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/sentry",
|
3
|
-
"version": "4.6.
|
3
|
+
"version": "4.6.22",
|
4
4
|
"description": "A cross-platform application monitoring tool, with a focus on error reporting.",
|
5
5
|
"main": "./index",
|
6
6
|
"typings": "./index.d.ts",
|
@@ -33,14 +33,14 @@
|
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@nativescript-community/arraybuffers": "^1.1.5",
|
36
|
-
"@sentry/browser": "^7.
|
37
|
-
"@sentry/core": "^7.
|
38
|
-
"@sentry/hub": "^7.
|
39
|
-
"@sentry/integrations": "^7.
|
40
|
-
"@sentry/tracing": "^7.
|
41
|
-
"@sentry/types": "^7.
|
42
|
-
"@sentry/utils": "^7.
|
36
|
+
"@sentry/browser": "^7.102.1",
|
37
|
+
"@sentry/core": "^7.102.1",
|
38
|
+
"@sentry/hub": "^7.102.1",
|
39
|
+
"@sentry/integrations": "^7.102.1",
|
40
|
+
"@sentry/tracing": "^7.102.1",
|
41
|
+
"@sentry/types": "^7.102.1",
|
42
|
+
"@sentry/utils": "^7.102.1",
|
43
43
|
"stacktrace-parser": "^0.1.10"
|
44
44
|
},
|
45
|
-
"gitHead": "
|
45
|
+
"gitHead": "3c233778b72caaf73b7ff25af7d3f341f1d2c0d4"
|
46
46
|
}
|
@@ -21,6 +21,7 @@
|
|
21
21
|
"io.sentry.transport:ITransportGate",
|
22
22
|
"io.sentry.transport:RateLimiter",
|
23
23
|
"io.sentry:Breadcrumb",
|
24
|
+
"io.sentry:Integration",
|
24
25
|
"io.sentry:ILogger",
|
25
26
|
"io.sentry:ITransportFactory",
|
26
27
|
"io.sentry:RequestDetails",
|
@@ -35,6 +36,7 @@
|
|
35
36
|
"io.sentry:SentryOptions.BeforeSendCallback",
|
36
37
|
"io.sentry:UncaughtExceptionHandlerIntegration",
|
37
38
|
"io.sentry:UserFeedback",
|
39
|
+
"io.sentry.android.fragment:FragmentLifecycleIntegration",
|
38
40
|
"java.lang:Boolean",
|
39
41
|
"java.lang:Integer",
|
40
42
|
"java.lang:Long",
|
package/platforms/ios/Podfile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
pod 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '
|
1
|
+
pod 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '8.20.0'
|
@@ -1,4 +1,7 @@
|
|
1
1
|
#import <Sentry/Sentry.h>
|
2
|
+
#import <Sentry/SentryEnvelope.h>
|
3
|
+
#import <Sentry/SentryScreenFrames.h>
|
4
|
+
#import <Sentry/SentryAppStartMeasurement.h>
|
2
5
|
|
3
6
|
@interface NSSentrySDK: SentrySDK
|
4
7
|
+ (void)captureEnvelope:(SentryEnvelope *)envelope;
|
@@ -13,4 +16,4 @@
|
|
13
16
|
@property (class, nonatomic, assign) BOOL appStartMeasurementHybridSDKMode;
|
14
17
|
@property (class, nonatomic, assign) BOOL framesTrackingMeasurementHybridSDKMode;
|
15
18
|
|
16
|
-
@end
|
19
|
+
@end
|
package/sdk.d.ts
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
import { Hub, Scope } from '@sentry/core';
|
2
|
-
import {
|
2
|
+
import { UserFeedback } from '@sentry/types';
|
3
3
|
import { NativescriptOptions } from './options';
|
4
|
-
export declare let rewriteFrameIntegration: {
|
5
|
-
_iteratee: (frame: StackFrame) => StackFrame;
|
6
|
-
};
|
7
4
|
/**
|
8
5
|
* Inits the SDK
|
9
6
|
*/
|
package/sdk.js
CHANGED
@@ -1,19 +1,13 @@
|
|
1
|
-
import {
|
1
|
+
import { getCurrentHub } from '@sentry/browser';
|
2
2
|
import { Hub, Scope, getIntegrationsToSetup, initAndBind, makeMain, setExtra } from '@sentry/core';
|
3
|
-
import { RewriteFrames } from '@sentry/integrations';
|
4
3
|
import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
|
5
4
|
import { NativescriptClient } from './client';
|
6
|
-
import {
|
7
|
-
import { EventOrigin } from './integrations/eventorigin';
|
8
|
-
import { SdkInfo } from './integrations/sdkinfo';
|
9
|
-
// import { NativescriptScope } from './scope';
|
10
|
-
import { NativescriptTracing } from './tracing';
|
5
|
+
import { getDefaultIntegrations } from './integrations/default';
|
11
6
|
import { DEFAULT_BUFFER_SIZE, makeNativescriptTransport } from './transports/native';
|
12
7
|
import { makeUtf8TextEncoder } from './transports/TextEncoder';
|
13
8
|
import { safeFactory, safeTracesSampler } from './utils/safe';
|
14
9
|
import { NATIVE } from './wrapper';
|
15
10
|
import { parseErrorStack } from './integrations/debugsymbolicator';
|
16
|
-
import { Screenshot } from './integrations/screenshot';
|
17
11
|
import { getDefaultEnvironment } from './utils/environment';
|
18
12
|
// const STACKTRACE_LIMIT = 50;
|
19
13
|
// function stripSentryFramesAndReverse(stack) {
|
@@ -68,7 +62,6 @@ const DEFAULT_OPTIONS = {
|
|
68
62
|
maxQueueSize: DEFAULT_BUFFER_SIZE,
|
69
63
|
attachStacktrace: true
|
70
64
|
};
|
71
|
-
export let rewriteFrameIntegration;
|
72
65
|
/**
|
73
66
|
* Inits the SDK
|
74
67
|
*/
|
@@ -82,62 +75,72 @@ export function init(passedOptions) {
|
|
82
75
|
// If custom transport factory fails the SDK won't initialize
|
83
76
|
transport: passedOptions.transport || makeNativescriptTransport, transportOptions: Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS.transportOptions), ((_d = passedOptions.transportOptions) !== null && _d !== void 0 ? _d : {})), { bufferSize: maxQueueSize }), maxQueueSize, integrations: [],
|
84
77
|
// integrations: getIntegrationsToSetup(passedOptions),
|
85
|
-
stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser), beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }), initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' })
|
78
|
+
stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser), beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }), initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }) });
|
79
|
+
if ('tracesSampler' in options) {
|
80
|
+
options.tracesSampler = safeTracesSampler(options.tracesSampler);
|
81
|
+
}
|
86
82
|
if (!('environment' in options)) {
|
87
83
|
options.environment = getDefaultEnvironment();
|
88
84
|
}
|
89
85
|
// As long as tracing is opt in with either one of these options, then this is how we determine tracing is enabled.
|
90
86
|
const tracingEnabled = typeof options.tracesSampler !== 'undefined' ||
|
91
87
|
typeof options.tracesSampleRate !== 'undefined';
|
92
|
-
const
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
88
|
+
const DEFAULT_INTEGRATIONS = getDefaultIntegrations(options);
|
89
|
+
const defaultIntegrations = passedOptions.defaultIntegrations === undefined
|
90
|
+
? DEFAULT_INTEGRATIONS
|
91
|
+
: passedOptions.defaultIntegrations;
|
92
|
+
// if (passedOptions.defaultIntegrations === undefined) {
|
93
|
+
// rewriteFrameIntegration = new RewriteFrames({
|
94
|
+
// iteratee: (frame: StackFrame) => {
|
95
|
+
// if (frame.platform === 'javascript' && frame.filename) {
|
96
|
+
// let filename = frame.filename
|
97
|
+
// .replace(/^file\:\/\//, '')
|
98
|
+
// .replace(/^address at /, '')
|
99
|
+
// .replace(/^.*\/[^\.]+(\.app|CodePush|.*(?=\/))/, '');
|
100
|
+
// if (frame.filename.indexOf('[native code]') === -1) {
|
101
|
+
// const appPrefix = options.appPrefix ?? '~/';
|
102
|
+
// if (appPrefix.endsWith('//') && !appPrefix.endsWith('///')) {
|
103
|
+
// filename = filename.indexOf('/') === 0 ? `${appPrefix}${filename}` : `${appPrefix}/${filename}`;
|
104
|
+
// } else {
|
105
|
+
// filename = filename.indexOf('/') === 0 ? `${appPrefix}${filename.slice(1)}` : `${appPrefix}${filename}`;
|
106
|
+
// }
|
107
|
+
// }
|
108
|
+
// frame.filename = filename;
|
109
|
+
// if (passedOptions.colnoOffset) {
|
110
|
+
// frame.colno += passedOptions.colnoOffset;
|
111
|
+
// }
|
112
|
+
// // We always want to have a tripple slash
|
113
|
+
// }
|
114
|
+
// return frame;
|
115
|
+
// }
|
116
|
+
// }) as any;
|
117
|
+
// defaultIntegrations.push(...[
|
118
|
+
// new NativescriptErrorHandlers(options),
|
119
|
+
// new Release(),
|
120
|
+
// ...sentryDefaultIntegrations.filter((i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)),
|
121
|
+
// new Integrations.Breadcrumbs({
|
122
|
+
// console: false,
|
123
|
+
// xhr: false,
|
124
|
+
// dom: false,
|
125
|
+
// fetch: false,
|
126
|
+
// ...(options.breadcrumbs || {})
|
127
|
+
// }),
|
128
|
+
// rewriteFrameIntegration as any,
|
129
|
+
// new EventOrigin(),
|
130
|
+
// new SdkInfo()
|
131
|
+
// ]);
|
132
|
+
// if (!!options.enableNative) {
|
133
|
+
// defaultIntegrations.push(new DeviceContext());
|
134
|
+
// }
|
135
|
+
// if (tracingEnabled) {
|
136
|
+
// if (options.enableAutoPerformanceTracking) {
|
137
|
+
// defaultIntegrations.push(new NativescriptTracing());
|
138
|
+
// }
|
139
|
+
// }
|
140
|
+
// if (options.attachScreenshot) {
|
141
|
+
// defaultIntegrations.push(new Screenshot());
|
142
|
+
// }
|
143
|
+
// }
|
141
144
|
options.integrations = getIntegrationsToSetup({
|
142
145
|
integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),
|
143
146
|
defaultIntegrations,
|
package/sdk.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAoD,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGnG,OAAO,EAAE,MAAM,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAI1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAK9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,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AAmB,CAAC,QAAsB;;IACtD,MAAA,aAAa,EAAE,CAAC,SAAS,EAAsB,0CAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACnF,CAAC;AAGD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgC;IACtD,MAAM,YAAY,GAAG,CAAC,KAAY,EAAQ,EAAE;QACxC,IAAI;YACA,MAAM,CAAC,SAAS,CAAC,MAAM,CAAA,EAAE;gBACrB,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;SACN;QAAC,OAAO,CAAC,EAAE;YACR,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;SAC7D;IACL,CAAC,CAAC;IACF,OAAO,aAAa,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AACnD,CAAC;AAED;;;KAGK;AACL,MAAM,UAAU,cAAc,CAAC,QAAgC;IAC3D,MAAM,YAAY,GAAG,CAAC,KAAY,EAAQ,EAAE;QACxC,IAAI;YACA,QAAQ,CAAC,KAAK,CAAC,CAAC;SACnB;QAAC,OAAO,CAAC,EAAE;YACR,MAAM,CAAC,KAAK,CAAC,6CAA6C,EAAE,CAAC,CAAC,CAAC;SAClE;IACL,CAAC,CAAC;IACF,aAAa,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AACjD,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { Hub, Transaction } from '@sentry/core';
|
2
|
+
import type { CustomSamplingContext, TransactionContext } from '@sentry/types';
|
3
|
+
/**
|
4
|
+
* Adds React Native's extensions. Needs to be called before any transactions are created.
|
5
|
+
*/
|
6
|
+
export declare function _addTracingExtensions(): void;
|
7
|
+
export declare type StartTransactionFunction = (this: Hub, transactionContext: TransactionContext, customSamplingContext?: CustomSamplingContext) => Transaction;
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
2
|
-
import {
|
1
|
+
// eslint-disable-next-line no-duplicate-imports
|
2
|
+
import { addTracingExtensions, getCurrentHub, getMainCarrier } from '@sentry/core';
|
3
|
+
import { NativescriptTracing } from '../tracing/nstracing';
|
4
|
+
import { DEFAULT } from '../tracing/ops';
|
3
5
|
/**
|
4
|
-
* Adds React Native's extensions. Needs to be called
|
6
|
+
* Adds React Native's extensions. Needs to be called before any transactions are created.
|
5
7
|
*/
|
6
8
|
export function _addTracingExtensions() {
|
9
|
+
addTracingExtensions();
|
7
10
|
const carrier = getMainCarrier();
|
8
11
|
if (carrier.__SENTRY__) {
|
9
12
|
carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
|
10
13
|
if (carrier.__SENTRY__.extensions.startTransaction) {
|
11
|
-
const originalStartTransaction = carrier.__SENTRY__.extensions
|
12
|
-
.startTransaction;
|
14
|
+
const originalStartTransaction = carrier.__SENTRY__.extensions.startTransaction;
|
13
15
|
/*
|
14
16
|
Overwrites the transaction start and finish to start and finish stall tracking.
|
15
17
|
Preferably instead of overwriting add a callback method for this in the Transaction itself.
|
@@ -27,10 +29,15 @@ const _patchStartTransaction = (originalStartTransaction) => {
|
|
27
29
|
* Method to overwrite with
|
28
30
|
*/
|
29
31
|
function _startTransaction(transactionContext, customSamplingContext) {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
// Native SDKs require op to be set - for JS Relay sets `default`
|
33
|
+
if (!transactionContext.op) {
|
34
|
+
transactionContext.op = DEFAULT;
|
35
|
+
}
|
36
|
+
const transaction = originalStartTransaction.apply(this, [transactionContext, customSamplingContext]);
|
37
|
+
const originalStartChild = transaction.startChild.bind(transaction);
|
38
|
+
transaction.startChild = (spanContext) => originalStartChild(Object.assign(Object.assign({}, spanContext), {
|
39
|
+
// Native SDKs require op to be set
|
40
|
+
op: (spanContext === null || spanContext === void 0 ? void 0 : spanContext.op) || DEFAULT }));
|
34
41
|
const reactNativeTracing = getCurrentHub().getIntegration(NativescriptTracing);
|
35
42
|
if (reactNativeTracing) {
|
36
43
|
reactNativeTracing.onTransactionStart(transaction);
|
@@ -47,4 +54,4 @@ const _patchStartTransaction = (originalStartTransaction) => {
|
|
47
54
|
}
|
48
55
|
return _startTransaction;
|
49
56
|
};
|
50
|
-
//# sourceMappingURL=
|
57
|
+
//# sourceMappingURL=addTracingExtensions.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"addTracingExtensions.js","sourceRoot":"","sources":["../../src/tracing/addTracingExtensions.ts"],"names":[],"mappings":"AACA,gDAAgD;AAChD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACjC,oBAAoB,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,IAAI,OAAO,CAAC,UAAU,EAAE;QACpB,OAAO,CAAC,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;QACpE,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,gBAAgB,EAAE;YAChD,MAAM,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,gBAA4C,CAAC;YAE5G;;;QAGJ;YACI,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,wBAAwB,CAAC,CAAC;YAE3E,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;SACtE;KACJ;AACL,CAAC;AAQD;;GAEG;AACH,MAAM,sBAAsB,GAAG,CAAC,wBAAkD,EAA4B,EAAE;IAC5G;;KAEC;IACD,SAAS,iBAAiB,CAEtB,kBAAsC,EACtC,qBAA6C;QAEjD,iEAAiE;QAC7D,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE;YACxB,kBAAkB,CAAC,EAAE,GAAG,OAAO,CAAC;SACnC;QAED,MAAM,WAAW,GAAgB,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC,CAAC;QACnH,MAAM,kBAAkB,GAA8B,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/F,WAAW,CAAC,UAAU,GAAG,CACrB,WAAmG,EAC/F,EAAE,CAAC,kBAAkB,iCACtB,WAAW;YACd,mCAAmC;YACnC,EAAE,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,KAAI,OAAO,IAChC,CAAC;QAEH,MAAM,kBAAkB,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAE/E,IAAI,kBAAkB,EAAE;YACpB,kBAAkB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAEnD,6DAA6D;YAC7D,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;YAE1C,WAAW,CAAC,MAAM,GAAG,CAAC,YAAgC,EAAE,EAAE;gBACtD,IAAI,kBAAkB,EAAE;oBACpB,kBAAkB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;iBACvD;gBAED,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YAC7D,CAAC,CAAC;SACL;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC7B,CAAC,CAAC"}
|
package/tracing/nstracing.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Hub } from '@sentry/hub';
|
2
2
|
import { RequestInstrumentationOptions, Transaction } from '@sentry/tracing';
|
3
|
-
import { EventProcessor, Integration } from '@sentry/types';
|
3
|
+
import { EventProcessor, Integration, Transaction as TransactionType } from '@sentry/types';
|
4
4
|
import { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';
|
5
5
|
import { NativeFramesInstrumentation } from './nativeframes';
|
6
6
|
import { StallTrackingInstrumentation } from './stalltracking';
|
@@ -22,6 +22,23 @@ export interface NativescriptTracingOptions extends RequestInstrumentationOption
|
|
22
22
|
* Default: 600
|
23
23
|
*/
|
24
24
|
maxTransactionDuration: number;
|
25
|
+
/**
|
26
|
+
* The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of
|
27
|
+
* the last finished span as the endtime for the transaction.
|
28
|
+
* Time is in ms.
|
29
|
+
*
|
30
|
+
* Default: 1000
|
31
|
+
*/
|
32
|
+
idleTimeoutMs: number;
|
33
|
+
/**
|
34
|
+
* The maximum duration (transaction duration + idle timeout) of a transaction
|
35
|
+
* before it will be marked as "deadline_exceeded".
|
36
|
+
* If you never want to mark a transaction set it to 0.
|
37
|
+
* Time is in ms.
|
38
|
+
*
|
39
|
+
* Default: 600000
|
40
|
+
*/
|
41
|
+
finalTimeoutMs: number;
|
25
42
|
/**
|
26
43
|
* The routing instrumentation to be used with the tracing integration.
|
27
44
|
* There is no routing instrumentation if nothing is passed.
|
@@ -58,6 +75,10 @@ export interface NativescriptTracingOptions extends RequestInstrumentationOption
|
|
58
75
|
* Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.
|
59
76
|
*/
|
60
77
|
enableStallTracking: boolean;
|
78
|
+
/**
|
79
|
+
* Trace User Interaction events like touch and gestures.
|
80
|
+
*/
|
81
|
+
enableUserInteractionTracing: boolean;
|
61
82
|
}
|
62
83
|
/**
|
63
84
|
* Tracing integration for React Native.
|
@@ -76,9 +97,14 @@ export declare class NativescriptTracing implements Integration {
|
|
76
97
|
nativeFramesInstrumentation?: NativeFramesInstrumentation;
|
77
98
|
stallTrackingInstrumentation?: StallTrackingInstrumentation;
|
78
99
|
useAppStartWithProfiler: boolean;
|
100
|
+
private _inflightInteractionTransaction?;
|
79
101
|
private _getCurrentHub?;
|
80
102
|
private _awaitingAppStartData?;
|
81
103
|
private _appStartFinishTimestamp?;
|
104
|
+
private _currentRoute?;
|
105
|
+
private _hasSetTracePropagationTargets;
|
106
|
+
private _hasSetTracingOrigins;
|
107
|
+
private _currentViewName;
|
82
108
|
constructor(options?: Partial<NativescriptTracingOptions>);
|
83
109
|
/**
|
84
110
|
* Registers routing and request instrumentation.
|
@@ -97,6 +123,24 @@ export declare class NativescriptTracing implements Integration {
|
|
97
123
|
*/
|
98
124
|
onAppStartFinish(endTimestamp: number): void;
|
99
125
|
/**
|
126
|
+
* Starts a new transaction for a user interaction.
|
127
|
+
* @param userInteractionId Consists of `op` representation UI Event and `elementId` unique element identifier on current screen.
|
128
|
+
*/
|
129
|
+
startUserInteractionTransaction(userInteractionId: {
|
130
|
+
elementId: string | undefined;
|
131
|
+
op: string;
|
132
|
+
}): TransactionType | undefined;
|
133
|
+
/**
|
134
|
+
* Sets the current view name into the app context.
|
135
|
+
* @param event Le event.
|
136
|
+
*/
|
137
|
+
private _getCurrentViewEventProcessor;
|
138
|
+
/**
|
139
|
+
* Returns the App Start Duration in Milliseconds. Also returns undefined if not able do
|
140
|
+
* define the duration.
|
141
|
+
*/
|
142
|
+
private _getAppStartDurationMilliseconds;
|
143
|
+
/**
|
100
144
|
* Instruments the app start measurements on the first route transaction.
|
101
145
|
* Starts a route transaction if there isn't routing instrumentation.
|
102
146
|
*/
|
@@ -113,4 +157,8 @@ export declare class NativescriptTracing implements Integration {
|
|
113
157
|
private _onConfirmRoute;
|
114
158
|
/** Create routing idle transaction. */
|
115
159
|
private _createRouteTransaction;
|
160
|
+
/**
|
161
|
+
* Start app state aware idle transaction on the scope.
|
162
|
+
*/
|
163
|
+
private _startIdleTransaction;
|
116
164
|
}
|