@sentry/react-native 5.7.1 → 5.8.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/CHANGELOG.md +48 -0
- package/RNSentry.podspec +9 -4
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/MapConverter.java +134 -0
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +103 -15
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +14 -2
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +13 -2
- package/dist/js/NativeRNSentry.d.ts +13 -4
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +1 -0
- package/dist/js/client.js.map +1 -1
- package/dist/js/integrations/devicecontext.js +5 -5
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/index.d.ts +1 -0
- package/dist/js/integrations/index.d.ts.map +1 -1
- package/dist/js/integrations/index.js +1 -0
- package/dist/js/integrations/index.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts +5 -0
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +31 -6
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/rewriteframes.d.ts +2 -0
- package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
- package/dist/js/integrations/rewriteframes.js +2 -2
- package/dist/js/integrations/rewriteframes.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +1 -2
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/profiling/cache.d.ts +9 -0
- package/dist/js/profiling/cache.d.ts.map +1 -0
- package/dist/js/profiling/cache.js +3 -0
- package/dist/js/profiling/cache.js.map +1 -0
- package/dist/js/profiling/convertHermesProfile.d.ts +27 -0
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -0
- package/dist/js/profiling/convertHermesProfile.js +141 -0
- package/dist/js/profiling/convertHermesProfile.js.map +1 -0
- package/dist/js/profiling/hermes.d.ts +52 -0
- package/dist/js/profiling/hermes.d.ts.map +1 -0
- package/dist/js/profiling/hermes.js +35 -0
- package/dist/js/profiling/hermes.js.map +1 -0
- package/dist/js/profiling/integration.d.ts +36 -0
- package/dist/js/profiling/integration.d.ts.map +1 -0
- package/dist/js/profiling/integration.js +151 -0
- package/dist/js/profiling/integration.js.map +1 -0
- package/dist/js/profiling/types.d.ts +5 -0
- package/dist/js/profiling/types.d.ts.map +1 -0
- package/dist/js/profiling/types.js +2 -0
- package/dist/js/profiling/types.js.map +1 -0
- package/dist/js/profiling/utils.d.ts +26 -0
- package/dist/js/profiling/utils.d.ts.map +1 -0
- package/dist/js/profiling/utils.js +135 -0
- package/dist/js/profiling/utils.js.map +1 -0
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +6 -1
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +4 -2
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +36 -27
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +75 -13
- package/package.json +15 -14
- package/src/js/NativeRNSentry.ts +7 -4
- package/ts3.8/dist/js/NativeRNSentry.d.ts +13 -4
- package/ts3.8/dist/js/integrations/index.d.ts +1 -0
- package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +5 -0
- package/ts3.8/dist/js/integrations/rewriteframes.d.ts +2 -0
- package/ts3.8/dist/js/profiling/cache.d.ts +9 -0
- package/ts3.8/dist/js/profiling/convertHermesProfile.d.ts +27 -0
- package/ts3.8/dist/js/profiling/hermes.d.ts +52 -0
- package/ts3.8/dist/js/profiling/integration.d.ts +36 -0
- package/ts3.8/dist/js/profiling/types.d.ts +5 -0
- package/ts3.8/dist/js/profiling/utils.d.ts +26 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AA4ChE;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,UAAkB;IAClE,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,sBAAsB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAC1G,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,QAAQ,GAAW,GAAG,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IAED,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC;IACtD,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;IAC7C,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,sBAAsB,CAAC,aAAa,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { NATIVE } from '../wrapper';\nimport { convertToSentryProfile } from './convertHermesProfile';\nimport type { RawThreadCpuProfile } from './types';\n\nexport type StackFrameId = number;\nexport type MicrosecondsSinceBoot = string;\n\nexport interface TraceEvent {\n name: string;\n ph: string;\n cat: string;\n pid: number;\n ts: MicrosecondsSinceBoot;\n tid: string;\n args: {\n name?: string;\n };\n}\n\nexport interface Sample {\n cpu: string;\n name: string;\n ts: MicrosecondsSinceBoot;\n pid: number;\n tid: string;\n weight: string;\n sf: StackFrameId;\n}\n\nexport interface StackFrame {\n line?: string;\n column?: string;\n funcLine?: string;\n funcColumn?: string;\n name: string;\n category: string;\n parent?: number;\n}\n\nexport interface Profile {\n traceEvents: TraceEvent[];\n samples: Sample[];\n stackFrames: Record<string, StackFrame>;\n}\n\n/**\n * Hermes Profile Stack Frame Name contains function name and file path.\n *\n * `foo(/path/to/file.js:1:2)` -> `foo`\n */\nexport function parseHermesStackFrameFunctionName(hermesName: string): string {\n const indexOfLeftParenthesis = hermesName.indexOf('(');\n const name = indexOfLeftParenthesis !== -1 ? hermesName.substring(0, indexOfLeftParenthesis) : hermesName;\n return name;\n}\n\nconst MS_TO_NS: number = 1e6;\n\n/**\n * Starts Hermes Sampling Profiler and returns the timestamp when profiling started in nanoseconds.\n */\nexport function startProfiling(): number | null {\n const started = NATIVE.startProfiling();\n if (!started) {\n return null;\n }\n\n const profileStartTimestampNs = Date.now() * MS_TO_NS;\n return profileStartTimestampNs;\n}\n\n/**\n * Stops Hermes Sampling Profiler and returns the profile.\n */\nexport function stopProfiling(): RawThreadCpuProfile | null {\n const hermesProfile = NATIVE.stopProfiling();\n if (!hermesProfile) {\n return null;\n }\n return convertToSentryProfile(hermesProfile);\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EventProcessor, Hub, Integration } from '@sentry/types';
|
|
2
|
+
export declare const MAX_PROFILE_DURATION_MS: number;
|
|
3
|
+
/**
|
|
4
|
+
* Profiling integration creates a profile for each transaction and adds it to the event envelope.
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare class HermesProfiling implements Integration {
|
|
9
|
+
/**
|
|
10
|
+
* @inheritDoc
|
|
11
|
+
*/
|
|
12
|
+
static id: string;
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
private _getCurrentHub?;
|
|
18
|
+
private _currentProfile;
|
|
19
|
+
private _currentProfileTimeout;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
setupOnce(_: (e: EventProcessor) => void, getCurrentHub: () => Hub): void;
|
|
24
|
+
private _shouldStartProfiling;
|
|
25
|
+
/**
|
|
26
|
+
* Starts a new profile and links it to the transaction.
|
|
27
|
+
*/
|
|
28
|
+
private _startNewProfile;
|
|
29
|
+
/**
|
|
30
|
+
* Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.
|
|
31
|
+
*/
|
|
32
|
+
private _finishCurrentProfile;
|
|
33
|
+
private _createProfileEventFor;
|
|
34
|
+
private _clearCurrentProfileTimeout;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,cAAc,EAAE,GAAG,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAQ7G,eAAO,MAAM,uBAAuB,QAAW,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,eAAgB,YAAW,WAAW;IACjD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAqB;IAE7C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAsB;IAEzC,OAAO,CAAC,cAAc,CAAC,CAAY;IAEnC,OAAO,CAAC,eAAe,CAKT;IAEd,OAAO,CAAC,sBAAsB,CAAqB;IAEnD;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;IAmDhF,OAAO,CAAC,qBAAqB,CA0B3B;IAEF;;OAEG;IACH,OAAO,CAAC,gBAAgB,CActB;IAEF;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAiB3B;IAEF,OAAO,CAAC,sBAAsB,CAwB5B;IAEF,OAAO,CAAC,2BAA2B,CAGjC;CACH"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { logger, uuid4 } from '@sentry/utils';
|
|
2
|
+
import { isHermesEnabled } from '../utils/environment';
|
|
3
|
+
import { PROFILE_QUEUE } from './cache';
|
|
4
|
+
import { startProfiling, stopProfiling } from './hermes';
|
|
5
|
+
import { addProfilesToEnvelope, createProfilingEvent, findProfiledTransactionsFromEnvelope } from './utils';
|
|
6
|
+
export const MAX_PROFILE_DURATION_MS = 30 * 1e3;
|
|
7
|
+
/**
|
|
8
|
+
* Profiling integration creates a profile for each transaction and adds it to the event envelope.
|
|
9
|
+
*
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
export class HermesProfiling {
|
|
13
|
+
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
this.name = HermesProfiling.id;
|
|
18
|
+
this._shouldStartProfiling = (transaction) => {
|
|
19
|
+
if (!transaction.sampled) {
|
|
20
|
+
logger.log('[Profiling] Transaction is not sampled, skipping profiling');
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const client = this._getCurrentHub && this._getCurrentHub().getClient();
|
|
24
|
+
const options = client && client.getOptions();
|
|
25
|
+
// @ts-ignore not part of the browser options yet
|
|
26
|
+
const profilesSampleRate = options && options._experiments && typeof options._experiments.profilesSampleRate === 'number'
|
|
27
|
+
? options._experiments.profilesSampleRate
|
|
28
|
+
: undefined;
|
|
29
|
+
if (profilesSampleRate === undefined) {
|
|
30
|
+
logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
// Check if we should sample this profile
|
|
34
|
+
if (Math.random() > profilesSampleRate) {
|
|
35
|
+
logger.log('[Profiling] Skip profiling transaction due to sampling.');
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Starts a new profile and links it to the transaction.
|
|
42
|
+
*/
|
|
43
|
+
this._startNewProfile = (transaction) => {
|
|
44
|
+
const profileStartTimestampNs = startProfiling();
|
|
45
|
+
if (!profileStartTimestampNs) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this._currentProfile = {
|
|
49
|
+
profile_id: uuid4(),
|
|
50
|
+
startTimestampNs: profileStartTimestampNs,
|
|
51
|
+
};
|
|
52
|
+
transaction.setContext('profile', { profile_id: this._currentProfile.profile_id });
|
|
53
|
+
// @ts-expect-error profile_id is not part of the metadata type
|
|
54
|
+
transaction.setMetadata({ profile_id: this._currentProfile.profile_id });
|
|
55
|
+
logger.log('[Profiling] started profiling: ', this._currentProfile.profile_id);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.
|
|
59
|
+
*/
|
|
60
|
+
this._finishCurrentProfile = () => {
|
|
61
|
+
this._clearCurrentProfileTimeout();
|
|
62
|
+
if (this._currentProfile === undefined) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const profile = stopProfiling();
|
|
66
|
+
if (!profile) {
|
|
67
|
+
logger.warn('[Profiling] Stop failed. Cleaning up...');
|
|
68
|
+
this._currentProfile = undefined;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
profile.profile_id = this._currentProfile.profile_id;
|
|
72
|
+
PROFILE_QUEUE.add(profile.profile_id, profile);
|
|
73
|
+
logger.log('[Profiling] finished profiling: ', this._currentProfile.profile_id);
|
|
74
|
+
this._currentProfile = undefined;
|
|
75
|
+
};
|
|
76
|
+
this._createProfileEventFor = (profiledTransaction) => {
|
|
77
|
+
var _a, _b, _c;
|
|
78
|
+
const profile_id = (_b = (_a = profiledTransaction === null || profiledTransaction === void 0 ? void 0 : profiledTransaction.contexts) === null || _a === void 0 ? void 0 : _a['profile']) === null || _b === void 0 ? void 0 : _b['profile_id'];
|
|
79
|
+
if (typeof profile_id !== 'string') {
|
|
80
|
+
logger.log('[Profiling] cannot find profile for a transaction without a profile context');
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
// Remove the profile from the transaction context before sending, relay will take care of the rest.
|
|
84
|
+
if ((_c = profiledTransaction === null || profiledTransaction === void 0 ? void 0 : profiledTransaction.contexts) === null || _c === void 0 ? void 0 : _c['.profile']) {
|
|
85
|
+
delete profiledTransaction.contexts.profile;
|
|
86
|
+
}
|
|
87
|
+
const cpuProfile = PROFILE_QUEUE.get(profile_id);
|
|
88
|
+
PROFILE_QUEUE.delete(profile_id);
|
|
89
|
+
if (!cpuProfile) {
|
|
90
|
+
logger.log(`[Profiling] cannot find profile ${profile_id} for transaction ${profiledTransaction.event_id}`);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const profile = createProfilingEvent(cpuProfile, profiledTransaction);
|
|
94
|
+
logger.log(`[Profiling] Created profile ${profile_id} for transaction ${profiledTransaction.event_id}`);
|
|
95
|
+
return profile;
|
|
96
|
+
};
|
|
97
|
+
this._clearCurrentProfileTimeout = () => {
|
|
98
|
+
this._currentProfileTimeout !== undefined && clearTimeout(this._currentProfileTimeout);
|
|
99
|
+
this._currentProfileTimeout = undefined;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @inheritDoc
|
|
104
|
+
*/
|
|
105
|
+
setupOnce(_, getCurrentHub) {
|
|
106
|
+
if (!isHermesEnabled()) {
|
|
107
|
+
logger.log('[Profiling] Hermes is not enabled, not adding profiling integration.');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
this._getCurrentHub = getCurrentHub;
|
|
111
|
+
const client = getCurrentHub().getClient();
|
|
112
|
+
if (!client || typeof client.on !== 'function') {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
client.on('startTransaction', (transaction) => {
|
|
116
|
+
this._finishCurrentProfile();
|
|
117
|
+
const shouldStartProfiling = this._shouldStartProfiling(transaction);
|
|
118
|
+
if (!shouldStartProfiling) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this._currentProfileTimeout = setTimeout(this._finishCurrentProfile, MAX_PROFILE_DURATION_MS);
|
|
122
|
+
this._startNewProfile(transaction);
|
|
123
|
+
});
|
|
124
|
+
client.on('finishTransaction', () => {
|
|
125
|
+
this._finishCurrentProfile();
|
|
126
|
+
});
|
|
127
|
+
client.on('beforeEnvelope', (envelope) => {
|
|
128
|
+
if (!PROFILE_QUEUE.size()) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const profiledTransactions = findProfiledTransactionsFromEnvelope(envelope);
|
|
132
|
+
if (!profiledTransactions.length) {
|
|
133
|
+
logger.log('[Profiling] no profiled transactions found in envelope');
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const profilesToAddToEnvelope = [];
|
|
137
|
+
for (const profiledTransaction of profiledTransactions) {
|
|
138
|
+
const profile = this._createProfileEventFor(profiledTransaction);
|
|
139
|
+
if (profile) {
|
|
140
|
+
profilesToAddToEnvelope.push(profile);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
addProfilesToEnvelope(envelope, profilesToAddToEnvelope);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @inheritDoc
|
|
149
|
+
*/
|
|
150
|
+
HermesProfiling.id = 'HermesProfiling';
|
|
151
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sour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mBAAmB,IAAI,oBAAoB,EAAE;gBACtD,MAAM,OAAO,GAAG,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;gBACjE,IAAI,OAAO,EAAE;oBACX,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACvC;aACF;YACD,qBAAqB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC;;AAzED;;GAEG;AACW,kBAAE,GAAW,iBAAiB,CAAC","sourcesContent":["import type { Envelope, Event, EventProcessor, Hub, Integration, Profile, Transaction } from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\n\nimport { isHermesEnabled } from '../utils/environment';\nimport { PROFILE_QUEUE } from './cache';\nimport { startProfiling, stopProfiling } from './hermes';\nimport { addProfilesToEnvelope, createProfilingEvent, findProfiledTransactionsFromEnvelope } from './utils';\n\nexport const MAX_PROFILE_DURATION_MS = 30 * 1e3;\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @experimental\n */\nexport class HermesProfiling implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'HermesProfiling';\n\n /**\n * @inheritDoc\n */\n public name: string = HermesProfiling.id;\n\n private _getCurrentHub?: () => Hub;\n\n private _currentProfile:\n | {\n profile_id: string;\n startTimestampNs: number;\n }\n | undefined;\n\n private _currentProfileTimeout: number | undefined;\n\n /**\n * @inheritDoc\n */\n public setupOnce(_: (e: EventProcessor) => void, getCurrentHub: () => Hub): void {\n if (!isHermesEnabled()) {\n logger.log('[Profiling] Hermes is not enabled, not adding profiling integration.');\n return;\n }\n\n this._getCurrentHub = getCurrentHub;\n const client = getCurrentHub().getClient();\n\n if (!client || typeof client.on !== 'function') {\n return;\n }\n\n client.on('startTransaction', (transaction: Transaction) => {\n this._finishCurrentProfile();\n\n const shouldStartProfiling = this._shouldStartProfiling(transaction);\n if (!shouldStartProfiling) {\n return;\n }\n\n this._currentProfileTimeout = setTimeout(this._finishCurrentProfile, MAX_PROFILE_DURATION_MS);\n this._startNewProfile(transaction);\n });\n\n client.on('finishTransaction', () => {\n this._finishCurrentProfile();\n });\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (!PROFILE_QUEUE.size()) {\n return;\n }\n\n const profiledTransactions = findProfiledTransactionsFromEnvelope(envelope);\n if (!profiledTransactions.length) {\n logger.log('[Profiling] no profiled transactions found in envelope');\n return;\n }\n\n const profilesToAddToEnvelope: Profile[] = [];\n for (const profiledTransaction of profiledTransactions) {\n const profile = this._createProfileEventFor(profiledTransaction);\n if (profile) {\n profilesToAddToEnvelope.push(profile);\n }\n }\n addProfilesToEnvelope(envelope, profilesToAddToEnvelope);\n });\n }\n\n private _shouldStartProfiling = (transaction: Transaction): boolean => {\n if (!transaction.sampled) {\n logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n return false;\n }\n\n const client = this._getCurrentHub && this._getCurrentHub().getClient();\n const options = client && client.getOptions();\n\n // @ts-ignore not part of the browser options yet\n const profilesSampleRate =\n options && options._experiments && typeof options._experiments.profilesSampleRate === 'number'\n ? options._experiments.profilesSampleRate\n : undefined;\n if (profilesSampleRate === undefined) {\n logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');\n return false;\n }\n\n // Check if we should sample this profile\n if (Math.random() > profilesSampleRate) {\n logger.log('[Profiling] Skip profiling transaction due to sampling.');\n return false;\n }\n\n return true;\n };\n\n /**\n * Starts a new profile and links it to the transaction.\n */\n private _startNewProfile = (transaction: Transaction): void => {\n const profileStartTimestampNs = startProfiling();\n if (!profileStartTimestampNs) {\n return;\n }\n\n this._currentProfile = {\n profile_id: uuid4(),\n startTimestampNs: profileStartTimestampNs,\n };\n transaction.setContext('profile', { profile_id: this._currentProfile.profile_id });\n // @ts-expect-error profile_id is not part of the metadata type\n transaction.setMetadata({ profile_id: this._currentProfile.profile_id });\n logger.log('[Profiling] started profiling: ', this._currentProfile.profile_id);\n };\n\n /**\n * Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.\n */\n private _finishCurrentProfile = (): void => {\n this._clearCurrentProfileTimeout();\n if (this._currentProfile === undefined) {\n return;\n }\n\n const profile = stopProfiling();\n if (!profile) {\n logger.warn('[Profiling] Stop failed. Cleaning up...');\n this._currentProfile = undefined;\n return;\n }\n\n profile.profile_id = this._currentProfile.profile_id;\n PROFILE_QUEUE.add(profile.profile_id, profile);\n logger.log('[Profiling] finished profiling: ', this._currentProfile.profile_id);\n this._currentProfile = undefined;\n };\n\n private _createProfileEventFor = (profiledTransaction: Event): Profile | null => {\n const profile_id = profiledTransaction?.contexts?.['profile']?.['profile_id'];\n\n if (typeof profile_id !== 'string') {\n logger.log('[Profiling] cannot find profile for a transaction without a profile context');\n return null;\n }\n\n // Remove the profile from the transaction context before sending, relay will take care of the rest.\n if (profiledTransaction?.contexts?.['.profile']) {\n delete profiledTransaction.contexts.profile;\n }\n\n const cpuProfile = PROFILE_QUEUE.get(profile_id);\n PROFILE_QUEUE.delete(profile_id);\n\n if (!cpuProfile) {\n logger.log(`[Profiling] cannot find profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n return null;\n }\n\n const profile = createProfilingEvent(cpuProfile, profiledTransaction);\n logger.log(`[Profiling] Created profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n return profile;\n };\n\n private _clearCurrentProfileTimeout = (): void => {\n this._currentProfileTimeout !== undefined && clearTimeout(this._currentProfileTimeout);\n this._currentProfileTimeout = undefined;\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/profiling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ThreadCpuProfile } from '@sentry/types';\n\nexport interface RawThreadCpuProfile extends ThreadCpuProfile {\n profile_id?: string;\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Envelope, Event, Profile } from '@sentry/types';
|
|
2
|
+
import type { RawThreadCpuProfile } from './types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare function isValidProfile(profile: RawThreadCpuProfile): profile is RawThreadCpuProfile & {
|
|
7
|
+
profile_id: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Finds transactions with profile_id context in the envelope
|
|
11
|
+
* @param envelope
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[];
|
|
15
|
+
/**
|
|
16
|
+
* Creates a profiling envelope item, if the profile does not pass validation, returns null.
|
|
17
|
+
* @param event
|
|
18
|
+
* @returns {Profile | null}
|
|
19
|
+
*/
|
|
20
|
+
export declare function createProfilingEvent(profile: RawThreadCpuProfile, event: Event): Profile | null;
|
|
21
|
+
/**
|
|
22
|
+
* Adds items to envelope if they are not already present - mutates the envelope.
|
|
23
|
+
* @param envelope
|
|
24
|
+
*/
|
|
25
|
+
export declare function addProfilesToEnvelope(envelope: Envelope, profiles: Profile[]): Envelope;
|
|
26
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,IAAI,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAgBpH;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,CAqBhF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAuB/F;AAwFD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,QAAQ,CAUvF"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { forEachEnvelopeItem, logger } from '@sentry/utils';
|
|
2
|
+
const ACTIVE_THREAD_ID_STRING = '0';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export function isValidProfile(profile) {
|
|
7
|
+
if (profile.samples.length <= 1) {
|
|
8
|
+
if (__DEV__) {
|
|
9
|
+
// Log a warning if the profile has less than 2 samples so users can know why
|
|
10
|
+
// they are not seeing any profiling data and we cant avoid the back and forth
|
|
11
|
+
// of asking them to provide us with a dump of the profile data.
|
|
12
|
+
logger.log('[Profiling] Discarding profile because it contains less than 2 samples');
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (!profile.profile_id) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Finds transactions with profile_id context in the envelope
|
|
23
|
+
* @param envelope
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export function findProfiledTransactionsFromEnvelope(envelope) {
|
|
27
|
+
const events = [];
|
|
28
|
+
forEachEnvelopeItem(envelope, (item, type) => {
|
|
29
|
+
if (type !== 'transaction') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// First item is the type
|
|
33
|
+
for (let j = 1; j < item.length; j++) {
|
|
34
|
+
const event = item[j];
|
|
35
|
+
// @ts-expect-error accessing private property
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
37
|
+
if (event && event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id']) {
|
|
38
|
+
events.push(item[j]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return events;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a profiling envelope item, if the profile does not pass validation, returns null.
|
|
46
|
+
* @param event
|
|
47
|
+
* @returns {Profile | null}
|
|
48
|
+
*/
|
|
49
|
+
export function createProfilingEvent(profile, event) {
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
51
|
+
if (!isValidProfile(profile)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return createProfilePayload(profile, {
|
|
55
|
+
release: event.release || '',
|
|
56
|
+
environment: event.environment || '',
|
|
57
|
+
event_id: event.event_id || '',
|
|
58
|
+
transaction: event.transaction || '',
|
|
59
|
+
start_timestamp: event.start_timestamp ? event.start_timestamp * 1000 : Date.now(),
|
|
60
|
+
trace_id: (_c = (_b = (_a = event === null || event === void 0 ? void 0 : event.contexts) === null || _a === void 0 ? void 0 : _a.trace) === null || _b === void 0 ? void 0 : _b.trace_id) !== null && _c !== void 0 ? _c : '',
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
62
|
+
profile_id: profile.profile_id,
|
|
63
|
+
os_platform: ((_e = (_d = event.contexts) === null || _d === void 0 ? void 0 : _d.os) === null || _e === void 0 ? void 0 : _e.name) || '',
|
|
64
|
+
os_version: ((_g = (_f = event.contexts) === null || _f === void 0 ? void 0 : _f.os) === null || _g === void 0 ? void 0 : _g.version) || '',
|
|
65
|
+
os_build: ((_j = (_h = event.contexts) === null || _h === void 0 ? void 0 : _h.os) === null || _j === void 0 ? void 0 : _j.build) || '',
|
|
66
|
+
device_locale: ((_l = (_k = event.contexts) === null || _k === void 0 ? void 0 : _k.device) === null || _l === void 0 ? void 0 : _l.locale) || '',
|
|
67
|
+
device_model: ((_o = (_m = event.contexts) === null || _m === void 0 ? void 0 : _m.device) === null || _o === void 0 ? void 0 : _o.model) || '',
|
|
68
|
+
device_manufacturer: ((_q = (_p = event.contexts) === null || _p === void 0 ? void 0 : _p.device) === null || _q === void 0 ? void 0 : _q.manufacturer) || '',
|
|
69
|
+
device_architecture: ((_s = (_r = event.contexts) === null || _r === void 0 ? void 0 : _r.device) === null || _s === void 0 ? void 0 : _s.arch) || '',
|
|
70
|
+
device_is_emulator: ((_u = (_t = event.contexts) === null || _t === void 0 ? void 0 : _t.device) === null || _u === void 0 ? void 0 : _u.simulator) || false,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a profile
|
|
75
|
+
* @param profile
|
|
76
|
+
* @param options
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
function createProfilePayload(cpuProfile, { release, environment, event_id, transaction, start_timestamp, trace_id, profile_id, os_platform, os_version, os_build, device_locale, device_model, device_manufacturer, device_architecture, device_is_emulator, }) {
|
|
80
|
+
// Log a warning if the profile has an invalid traceId (should be uuidv4).
|
|
81
|
+
// All profiles and transactions are rejected if this is the case and we want to
|
|
82
|
+
// warn users that this is happening if they enable debug flag
|
|
83
|
+
if (trace_id && trace_id.length !== 32) {
|
|
84
|
+
if (__DEV__) {
|
|
85
|
+
logger.log(`[Profiling] Invalid traceId: ${trace_id} on profiled event`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const profile = {
|
|
89
|
+
event_id: profile_id,
|
|
90
|
+
timestamp: new Date(start_timestamp).toISOString(),
|
|
91
|
+
platform: 'node',
|
|
92
|
+
version: '1',
|
|
93
|
+
release: release,
|
|
94
|
+
environment: environment,
|
|
95
|
+
runtime: {
|
|
96
|
+
name: 'hermes',
|
|
97
|
+
version: '',
|
|
98
|
+
},
|
|
99
|
+
os: {
|
|
100
|
+
name: os_platform,
|
|
101
|
+
version: os_version,
|
|
102
|
+
build_number: os_build,
|
|
103
|
+
},
|
|
104
|
+
device: {
|
|
105
|
+
locale: device_locale,
|
|
106
|
+
model: device_model,
|
|
107
|
+
manufacturer: device_manufacturer,
|
|
108
|
+
architecture: device_architecture,
|
|
109
|
+
is_emulator: device_is_emulator,
|
|
110
|
+
},
|
|
111
|
+
profile: cpuProfile,
|
|
112
|
+
transaction: {
|
|
113
|
+
name: transaction,
|
|
114
|
+
id: event_id,
|
|
115
|
+
trace_id: trace_id || '',
|
|
116
|
+
active_thread_id: ACTIVE_THREAD_ID_STRING,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
return profile;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Adds items to envelope if they are not already present - mutates the envelope.
|
|
123
|
+
* @param envelope
|
|
124
|
+
*/
|
|
125
|
+
export function addProfilesToEnvelope(envelope, profiles) {
|
|
126
|
+
if (!profiles.length) {
|
|
127
|
+
return envelope;
|
|
128
|
+
}
|
|
129
|
+
for (const profile of profiles) {
|
|
130
|
+
// @ts-expect-error untyped envelope
|
|
131
|
+
envelope[1].push([{ type: 'profile' }, profile]);
|
|
132
|
+
}
|
|
133
|
+
return envelope;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/profiling/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAA4B;IACzD,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,I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,OAAO,IAAI,QAAQ,EAAE;QAC9B,oCAAoC;QACpC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;KAClD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { Envelope, Event, Profile } from '@sentry/types';\nimport { forEachEnvelopeItem, logger } from '@sentry/utils';\n\nimport type { RawThreadCpuProfile } from './types';\n\nconst ACTIVE_THREAD_ID_STRING = '0';\n\n/**\n *\n */\nexport function isValidProfile(profile: RawThreadCpuProfile): profile is RawThreadCpuProfile & { profile_id: string } {\n if (profile.samples.length <= 1) {\n if (__DEV__) {\n // Log a warning if the profile has less than 2 samples so users can know why\n // they are not seeing any profiling data and we cant avoid the back and forth\n // of asking them to provide us with a dump of the profile data.\n logger.log('[Profiling] Discarding profile because it contains less than 2 samples');\n }\n return false;\n }\n\n if (!profile.profile_id) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Finds transactions with profile_id context in the envelope\n * @param envelope\n * @returns\n */\nexport function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[] {\n const events: Event[] = [];\n\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type !== 'transaction') {\n return;\n }\n\n // First item is the type\n for (let j = 1; j < item.length; j++) {\n const event = item[j];\n\n // @ts-expect-error accessing private property\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event && event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id']) {\n events.push(item[j] as Event);\n }\n }\n });\n\n return events;\n}\n\n/**\n * Creates a profiling envelope item, if the profile does not pass validation, returns null.\n * @param event\n * @returns {Profile | null}\n */\nexport function createProfilingEvent(profile: RawThreadCpuProfile, event: Event): Profile | null {\n if (!isValidProfile(profile)) {\n return null;\n }\n\n return createProfilePayload(profile, {\n release: event.release || '',\n environment: event.environment || '',\n event_id: event.event_id || '',\n transaction: event.transaction || '',\n start_timestamp: event.start_timestamp ? event.start_timestamp * 1000 : Date.now(),\n trace_id: (event?.contexts?.trace?.trace_id as string) ?? '',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n profile_id: profile.profile_id,\n os_platform: event.contexts?.os?.name || '',\n os_version: event.contexts?.os?.version || '',\n os_build: event.contexts?.os?.build || '',\n device_locale: (event.contexts?.device?.locale as string) || '',\n device_model: event.contexts?.device?.model || '',\n device_manufacturer: event.contexts?.device?.manufacturer || '',\n device_architecture: event.contexts?.device?.arch || '',\n device_is_emulator: event.contexts?.device?.simulator || false,\n });\n}\n\n/**\n * Create a profile\n * @param profile\n * @param options\n * @returns\n */\nfunction createProfilePayload(\n cpuProfile: RawThreadCpuProfile,\n {\n release,\n environment,\n event_id,\n transaction,\n start_timestamp,\n trace_id,\n profile_id,\n os_platform,\n os_version,\n os_build,\n device_locale,\n device_model,\n device_manufacturer,\n device_architecture,\n device_is_emulator,\n }: {\n release: string;\n environment: string;\n event_id: string;\n transaction: string;\n start_timestamp: number;\n trace_id: string | undefined;\n profile_id: string;\n os_platform: string;\n os_version: string;\n os_build?: string;\n device_locale: string;\n device_model: string;\n device_manufacturer: string;\n device_architecture: string;\n device_is_emulator: boolean;\n },\n): Profile {\n // Log a warning if the profile has an invalid traceId (should be uuidv4).\n // All profiles and transactions are rejected if this is the case and we want to\n // warn users that this is happening if they enable debug flag\n if (trace_id && trace_id.length !== 32) {\n if (__DEV__) {\n logger.log(`[Profiling] Invalid traceId: ${trace_id} on profiled event`);\n }\n }\n\n const profile: Profile = {\n event_id: profile_id,\n timestamp: new Date(start_timestamp).toISOString(),\n platform: 'node',\n version: '1',\n release: release,\n environment: environment,\n runtime: {\n name: 'hermes',\n version: '', // TODO: get hermes version\n },\n os: {\n name: os_platform,\n version: os_version,\n build_number: os_build,\n },\n device: {\n locale: device_locale,\n model: device_model,\n manufacturer: device_manufacturer,\n architecture: device_architecture,\n is_emulator: device_is_emulator,\n },\n profile: cpuProfile,\n transaction: {\n name: transaction,\n id: event_id,\n trace_id: trace_id || '',\n active_thread_id: ACTIVE_THREAD_ID_STRING,\n },\n };\n\n return profile;\n}\n\n/**\n * Adds items to envelope if they are not already present - mutates the envelope.\n * @param envelope\n */\nexport function addProfilesToEnvelope(envelope: Envelope, profiles: Profile[]): Envelope {\n if (!profiles.length) {\n return envelope;\n }\n\n for (const profile of profiles) {\n // @ts-expect-error untyped envelope\n envelope[1].push([{ type: 'profile' }, profile]);\n }\n return envelope;\n}\n"]}
|
package/dist/js/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA6C,GAAG,EAAmC,MAAM,cAAc,CAAC;AAQ/G,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA6C,GAAG,EAAmC,MAAM,cAAc,CAAC;AAQ/G,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,KAAK,EAA4B,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AA6BzG;;GAEG;AACH,wBAAgB,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAkF5D;AAED;;GAEG;AAGH,wBAAgB,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,mBAAmB,EACpD,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,OAAO,CAAC,EAAE,yBAAyB,GAClC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAsBxB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC;AAED;;;GAGG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAe9C;AAED;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAEhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CASxF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CASlG"}
|
package/dist/js/sdk.js
CHANGED
|
@@ -5,7 +5,7 @@ import { defaultIntegrations as reactDefaultIntegrations, defaultStackParser, ge
|
|
|
5
5
|
import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { ReactNativeClient } from './client';
|
|
8
|
-
import { DebugSymbolicator, DeviceContext, EventOrigin, ModulesLoader, ReactNativeErrorHandlers, ReactNativeInfo, Release, SdkInfo, } from './integrations';
|
|
8
|
+
import { DebugSymbolicator, DeviceContext, EventOrigin, HermesProfiling, ModulesLoader, ReactNativeErrorHandlers, ReactNativeInfo, Release, SdkInfo, } from './integrations';
|
|
9
9
|
import { createReactNativeRewriteFrames } from './integrations/rewriteframes';
|
|
10
10
|
import { Screenshot } from './integrations/screenshot';
|
|
11
11
|
import { ViewHierarchy } from './integrations/viewhierarchy';
|
|
@@ -85,6 +85,9 @@ export function init(passedOptions) {
|
|
|
85
85
|
if (options.enableCaptureFailedRequests) {
|
|
86
86
|
defaultIntegrations.push(new HttpClient());
|
|
87
87
|
}
|
|
88
|
+
if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {
|
|
89
|
+
defaultIntegrations.push(new HermesProfiling());
|
|
90
|
+
}
|
|
88
91
|
}
|
|
89
92
|
options.integrations = getIntegrationsToSetup({
|
|
90
93
|
integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),
|
|
@@ -95,6 +98,8 @@ export function init(passedOptions) {
|
|
|
95
98
|
/**
|
|
96
99
|
* Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.
|
|
97
100
|
*/
|
|
101
|
+
// Deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/commit/f1b25591890978a92c610ce575ea2ba2bbde6a89
|
|
102
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
98
103
|
export function wrap(RootComponent, options) {
|
|
99
104
|
var _a, _b;
|
|
100
105
|
const tracingIntegration = getCurrentHub().getIntegration(ReactNativeTracing);
|
package/dist/js/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,mBAAmB,IAAI,wBAAwB,EAC/C,kBAAkB,EAClB,aAAa,EACb,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAA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AAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC;IACF,aAAa,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgC;IAC7D,MAAM,YAAY,GAAG,CAAC,KAAY,EAAQ,EAAE;QAC1C,IAAI;YACF,QAAQ,CAAC,KAAK,CAAC,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,6CAA6C,EAAE,CAAC,CAAC,CAAC;SAChE;IACH,CAAC,CAAC;IACF,aAAa,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import type { Scope } from '@sentry/core';\nimport { getIntegrationsToSetup, hasTracingEnabled, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';\nimport { HttpClient } from '@sentry/integrations';\nimport {\n defaultIntegrations as reactDefaultIntegrations,\n defaultStackParser,\n getCurrentHub,\n makeFetchTransport,\n} from '@sentry/react';\nimport type { Integration, UserFeedback } from '@sentry/types';\nimport { logger, stackParserFromStackParserOptions } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { ReactNativeClient } from './client';\nimport {\n DebugSymbolicator,\n DeviceContext,\n EventOrigin,\n ModulesLoader,\n ReactNativeErrorHandlers,\n ReactNativeInfo,\n Release,\n SdkInfo,\n} from './integrations';\nimport { createReactNativeRewriteFrames } from './integrations/rewriteframes';\nimport { Screenshot } from './integrations/screenshot';\nimport { ViewHierarchy } from './integrations/viewhierarchy';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { ReactNativeScope } from './scope';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler, ReactNativeTracing } from './tracing';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { makeUtf8TextEncoder } from './transports/TextEncoder';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { NATIVE } from './wrapper';\n\nconst IGNORED_DEFAULT_INTEGRATIONS = [\n 'GlobalHandlers', // We will use the react-native internal handlers\n 'TryCatch', // We don't need this\n];\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n transportOptions: {\n textEncoder: makeUtf8TextEncoder(),\n },\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n const reactNativeHub = new Hub(undefined, new ReactNativeScope());\n makeMain(reactNativeHub);\n\n const maxQueueSize = passedOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? passedOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n enableNative,\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }),\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n tracesSampler: safeTracesSampler(passedOptions.tracesSampler),\n };\n\n const defaultIntegrations: Integration[] = passedOptions.defaultIntegrations || [];\n if (passedOptions.defaultIntegrations === undefined) {\n defaultIntegrations.push(new ModulesLoader());\n defaultIntegrations.push(new ReactNativeErrorHandlers({\n patchGlobalPromise: options.patchGlobalPromise,\n }));\n defaultIntegrations.push(new Release());\n defaultIntegrations.push(...[\n ...reactDefaultIntegrations.filter(\n (i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)\n ),\n ]);\n\n defaultIntegrations.push(new EventOrigin());\n defaultIntegrations.push(new SdkInfo());\n defaultIntegrations.push(new ReactNativeInfo());\n\n if (__DEV__) {\n defaultIntegrations.push(new DebugSymbolicator());\n }\n\n defaultIntegrations.push(createReactNativeRewriteFrames());\n if (options.enableNative) {\n defaultIntegrations.push(new DeviceContext());\n }\n if (hasTracingEnabled(options) && options.enableAutoPerformanceTracing) {\n defaultIntegrations.push(new ReactNativeTracing());\n }\n if (options.attachScreenshot) {\n defaultIntegrations.push(new Screenshot());\n }\n if (options.attachViewHierarchy) {\n defaultIntegrations.push(new ViewHierarchy());\n }\n if (options.enableCaptureFailedRequests) {\n defaultIntegrations.push(new HttpClient());\n }\n }\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends JSX.IntrinsicAttributes>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const tracingIntegration = getCurrentHub().getIntegration(ReactNativeTracing);\n if (tracingIntegration) {\n tracingIntegration.useAppStartWithProfiler = true;\n }\n\n const profilerProps = {\n ...(options?.profilerProps ?? {}),\n name: RootComponent.displayName ?? 'Root',\n };\n\n const RootApp: React.FC<P> = (appProps) => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ReactNativeProfiler {...profilerProps}>\n <RootComponent {...appProps} />\n </ReactNativeProfiler>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * Deprecated. Sets the release on the event.\n * NOTE: Does not set the release on sessions.\n * @deprecated\n */\nexport function setRelease(release: string): void {\n setExtra('__sentry_release', release);\n}\n\n/**\n * Deprecated. Sets the dist on the event.\n * NOTE: Does not set the dist on sessions.\n * @deprecated\n */\nexport function setDist(dist: string): void {\n setExtra('__sentry_dist', dist);\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n if (client) {\n client.nativeCrash();\n }\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n logger.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n logger.error('Failed to close the SDK');\n }\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n getCurrentHub().getClient<ReactNativeClient>()?.captureUserFeedback(feedback);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {\n const safeCallback = (scope: Scope): void => {\n try {\n callback(scope);\n } catch (e) {\n logger.error('Error while running withScope callback', e);\n }\n };\n getCurrentHub().withScope(safeCallback);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n const safeCallback = (scope: Scope): void => {\n try {\n callback(scope);\n } catch (e) {\n logger.error('Error while running configureScope callback', e);\n }\n };\n getCurrentHub().configureScope(safeCallback);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,mBAAmB,IAAI,wBAAwB,EAC/C,kBAAkB,EAClB,aAAa,EACb,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,OAAO,EACP,OAAO,GACR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,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AChE;IACH,CAAC,CAAC;IACF,aAAa,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import type { Scope } from '@sentry/core';\nimport { getIntegrationsToSetup, hasTracingEnabled, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';\nimport { HttpClient } from '@sentry/integrations';\nimport {\n defaultIntegrations as reactDefaultIntegrations,\n defaultStackParser,\n getCurrentHub,\n makeFetchTransport,\n} from '@sentry/react';\nimport type { Integration, UserFeedback } from '@sentry/types';\nimport { logger, stackParserFromStackParserOptions } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { ReactNativeClient } from './client';\nimport {\n DebugSymbolicator,\n DeviceContext,\n EventOrigin,\n HermesProfiling,\n ModulesLoader,\n ReactNativeErrorHandlers,\n ReactNativeInfo,\n Release,\n SdkInfo,\n} from './integrations';\nimport { createReactNativeRewriteFrames } from './integrations/rewriteframes';\nimport { Screenshot } from './integrations/screenshot';\nimport { ViewHierarchy } from './integrations/viewhierarchy';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { ReactNativeScope } from './scope';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler, ReactNativeTracing } from './tracing';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { makeUtf8TextEncoder } from './transports/TextEncoder';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { NATIVE } from './wrapper';\n\nconst IGNORED_DEFAULT_INTEGRATIONS = [\n 'GlobalHandlers', // We will use the react-native internal handlers\n 'TryCatch', // We don't need this\n];\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n transportOptions: {\n textEncoder: makeUtf8TextEncoder(),\n },\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n const reactNativeHub = new Hub(undefined, new ReactNativeScope());\n makeMain(reactNativeHub);\n\n const maxQueueSize = passedOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? passedOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n enableNative,\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }),\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n tracesSampler: safeTracesSampler(passedOptions.tracesSampler),\n };\n\n const defaultIntegrations: Integration[] = passedOptions.defaultIntegrations || [];\n if (passedOptions.defaultIntegrations === undefined) {\n defaultIntegrations.push(new ModulesLoader());\n defaultIntegrations.push(new ReactNativeErrorHandlers({\n patchGlobalPromise: options.patchGlobalPromise,\n }));\n defaultIntegrations.push(new Release());\n defaultIntegrations.push(...[\n ...reactDefaultIntegrations.filter(\n (i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)\n ),\n ]);\n\n defaultIntegrations.push(new EventOrigin());\n defaultIntegrations.push(new SdkInfo());\n defaultIntegrations.push(new ReactNativeInfo());\n\n if (__DEV__) {\n defaultIntegrations.push(new DebugSymbolicator());\n }\n\n defaultIntegrations.push(createReactNativeRewriteFrames());\n if (options.enableNative) {\n defaultIntegrations.push(new DeviceContext());\n }\n if (hasTracingEnabled(options) && options.enableAutoPerformanceTracing) {\n defaultIntegrations.push(new ReactNativeTracing());\n }\n if (options.attachScreenshot) {\n defaultIntegrations.push(new Screenshot());\n }\n if (options.attachViewHierarchy) {\n defaultIntegrations.push(new ViewHierarchy());\n }\n if (options.enableCaptureFailedRequests) {\n defaultIntegrations.push(new HttpClient());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n defaultIntegrations.push(new HermesProfiling());\n }\n }\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\n// Deprecated in https://github.com/DefinitelyTyped/DefinitelyTyped/commit/f1b25591890978a92c610ce575ea2ba2bbde6a89\n// eslint-disable-next-line deprecation/deprecation\nexport function wrap<P extends JSX.IntrinsicAttributes>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const tracingIntegration = getCurrentHub().getIntegration(ReactNativeTracing);\n if (tracingIntegration) {\n tracingIntegration.useAppStartWithProfiler = true;\n }\n\n const profilerProps = {\n ...(options?.profilerProps ?? {}),\n name: RootComponent.displayName ?? 'Root',\n };\n\n const RootApp: React.FC<P> = (appProps) => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ReactNativeProfiler {...profilerProps}>\n <RootComponent {...appProps} />\n </ReactNativeProfiler>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * Deprecated. Sets the release on the event.\n * NOTE: Does not set the release on sessions.\n * @deprecated\n */\nexport function setRelease(release: string): void {\n setExtra('__sentry_release', release);\n}\n\n/**\n * Deprecated. Sets the dist on the event.\n * NOTE: Does not set the dist on sessions.\n * @deprecated\n */\nexport function setDist(dist: string): void {\n setExtra('__sentry_dist', dist);\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n if (client) {\n client.nativeCrash();\n }\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n logger.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n logger.error('Failed to close the SDK');\n }\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n getCurrentHub().getClient<ReactNativeClient>()?.captureUserFeedback(feedback);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {\n const safeCallback = (scope: Scope): void => {\n try {\n callback(scope);\n } catch (e) {\n logger.error('Error while running withScope callback', e);\n }\n };\n getCurrentHub().withScope(safeCallback);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n const safeCallback = (scope: Scope): void => {\n try {\n callback(scope);\n } catch (e) {\n logger.error('Error while running configureScope callback', e);\n }\n };\n getCurrentHub().configureScope(safeCallback);\n}\n"]}
|
package/dist/js/version.d.ts
CHANGED
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.8.1';\n"]}
|
package/dist/js/wrapper.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Breadcrumb, Envelope, EnvelopeItem, Event, Package, SeverityLevel,
|
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, Spec } from './NativeRNSentry';
|
|
4
4
|
import type { ReactNativeClientOptions } from './options';
|
|
5
|
+
import type * as Hermes from './profiling/hermes';
|
|
5
6
|
export interface Screenshot {
|
|
6
7
|
data: Uint8Array;
|
|
7
8
|
contentType: string;
|
|
@@ -22,14 +23,13 @@ interface SentryNativeWrapper {
|
|
|
22
23
|
[key: string]: string;
|
|
23
24
|
};
|
|
24
25
|
_isModuleLoaded(module: Spec | undefined): module is Spec;
|
|
25
|
-
_getBreadcrumbs(event: Event): Breadcrumb[] | undefined;
|
|
26
26
|
isNativeAvailable(): boolean;
|
|
27
27
|
initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;
|
|
28
28
|
closeNativeSdk(): PromiseLike<void>;
|
|
29
29
|
sendEnvelope(envelope: Envelope): Promise<void>;
|
|
30
30
|
captureScreenshot(): Promise<Screenshot[] | null>;
|
|
31
31
|
fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;
|
|
32
|
-
fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse>;
|
|
32
|
+
fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;
|
|
33
33
|
fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;
|
|
34
34
|
fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;
|
|
35
35
|
fetchNativeSdkInfo(): PromiseLike<Package | null>;
|
|
@@ -46,6 +46,8 @@ interface SentryNativeWrapper {
|
|
|
46
46
|
nativeCrash(): void;
|
|
47
47
|
fetchModules(): Promise<Record<string, string> | null>;
|
|
48
48
|
fetchViewHierarchy(): PromiseLike<Uint8Array | null>;
|
|
49
|
+
startProfiling(): boolean;
|
|
50
|
+
stopProfiling(): Hermes.Profile | null;
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
53
|
* Our internal interface for calling native functions
|
package/dist/js/wrapper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,aAAa,EACb,IAAI,EACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAiB,QAAQ,EAAuB,MAAM,cAAc,CAAC;AAG5E,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,E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