@sentry/react-native 5.13.0 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/android/build.gradle +1 -1
  3. package/dist/js/NativeRNSentry.d.ts +1 -0
  4. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  5. package/dist/js/NativeRNSentry.js.map +1 -1
  6. package/dist/js/profiling/cache.d.ts +3 -3
  7. package/dist/js/profiling/cache.d.ts.map +1 -1
  8. package/dist/js/profiling/cache.js.map +1 -1
  9. package/dist/js/profiling/debugid.d.ts +6 -0
  10. package/dist/js/profiling/debugid.d.ts.map +1 -0
  11. package/dist/js/profiling/debugid.js +29 -0
  12. package/dist/js/profiling/debugid.js.map +1 -0
  13. package/dist/js/profiling/hermes.d.ts +0 -9
  14. package/dist/js/profiling/hermes.d.ts.map +1 -1
  15. package/dist/js/profiling/hermes.js +0 -24
  16. package/dist/js/profiling/hermes.js.map +1 -1
  17. package/dist/js/profiling/integration.d.ts +19 -1
  18. package/dist/js/profiling/integration.d.ts.map +1 -1
  19. package/dist/js/profiling/integration.js +81 -8
  20. package/dist/js/profiling/integration.js.map +1 -1
  21. package/dist/js/profiling/nativeTypes.d.ts +43 -0
  22. package/dist/js/profiling/nativeTypes.d.ts.map +1 -0
  23. package/dist/js/profiling/nativeTypes.js +2 -0
  24. package/dist/js/profiling/nativeTypes.js.map +1 -0
  25. package/dist/js/profiling/types.d.ts +12 -1
  26. package/dist/js/profiling/types.d.ts.map +1 -1
  27. package/dist/js/profiling/types.js.map +1 -1
  28. package/dist/js/profiling/utils.d.ts +6 -6
  29. package/dist/js/profiling/utils.d.ts.map +1 -1
  30. package/dist/js/profiling/utils.js +33 -89
  31. package/dist/js/profiling/utils.js.map +1 -1
  32. package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
  33. package/dist/js/tools/sentryMetroSerializer.js +1 -2
  34. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  35. package/dist/js/tools/utils.d.ts +2 -0
  36. package/dist/js/tools/utils.d.ts.map +1 -1
  37. package/dist/js/tools/utils.js +22 -1
  38. package/dist/js/tools/utils.js.map +1 -1
  39. package/dist/js/version.d.ts +1 -1
  40. package/dist/js/version.js +1 -1
  41. package/dist/js/version.js.map +1 -1
  42. package/dist/js/wrapper.d.ts +5 -1
  43. package/dist/js/wrapper.d.ts.map +1 -1
  44. package/dist/js/wrapper.js +8 -2
  45. package/dist/js/wrapper.js.map +1 -1
  46. package/ios/RNSentry.mm +70 -7
  47. package/package.json +11 -10
  48. package/src/js/NativeRNSentry.ts +1 -1
  49. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
  50. package/ts3.8/dist/js/profiling/cache.d.ts +3 -3
  51. package/ts3.8/dist/js/profiling/debugid.d.ts +6 -0
  52. package/ts3.8/dist/js/profiling/hermes.d.ts +0 -9
  53. package/ts3.8/dist/js/profiling/integration.d.ts +19 -1
  54. package/ts3.8/dist/js/profiling/nativeTypes.d.ts +43 -0
  55. package/ts3.8/dist/js/profiling/types.d.ts +12 -1
  56. package/ts3.8/dist/js/profiling/utils.d.ts +6 -6
  57. package/ts3.8/dist/js/version.d.ts +1 -1
  58. package/ts3.8/dist/js/wrapper.d.ts +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.14.0
4
+
5
+ ### Features
6
+
7
+ - Add iOS profiles to React Native Profiling ([#3349](https://github.com/getsentry/sentry-react-native/pull/3349))
8
+
9
+ ### Fixes
10
+
11
+ - Conditionally use Set or CountingSet in Sentry Metro plugin ([#3409](https://github.com/getsentry/sentry-react-native/pull/3409))
12
+ - This makes sentryMetroSerializer compatible with Metro 0.66.2 and newer
13
+ - Fix SIGSEV, SIGABRT and SIGBUS crashes happening after/around the August Google Play System update, see [#2955](https://github.com/getsentry/sentry-java/issues/2955) for more details
14
+
15
+ ### Dependencies
16
+
17
+ - Bump Android SDK from v6.33.1 to v6.34.0 ([#3408](https://github.com/getsentry/sentry-react-native/pull/3408))
18
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6340)
19
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.33.1...6.34.0)
20
+ - Bump JavaScript SDK from v7.80.0 to v7.81.1 ([#3396](https://github.com/getsentry/sentry-react-native/pull/3396))
21
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7811)
22
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.80.0...7.81.1)
23
+
24
+ ## 5.13.1-beta.1
25
+
26
+ ### Fixes
27
+
28
+ - Fix SIGSEV, SIGABRT and SIGBUS crashes happening after/around the August Google Play System update, see [#2955](https://github.com/getsentry/sentry-java/issues/2955) for more details
29
+
30
+ ### Dependencies
31
+
32
+ - Bump Android SDK from v6.33.1 to v6.33.2-beta.1 ([#3385](https://github.com/getsentry/sentry-react-native/pull/3385))
33
+ - [changelog](https://github.com/getsentry/sentry-java/blob/6.33.2-beta.1/CHANGELOG.md#6332-beta1)
34
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.33.1...6.33.2-beta.1)
35
+
3
36
  ## 5.13.0
4
37
 
5
38
  ### Features
@@ -54,5 +54,5 @@ android {
54
54
 
55
55
  dependencies {
56
56
  implementation 'com.facebook.react:react-native:+'
57
- api 'io.sentry:sentry-android:6.33.1'
57
+ api 'io.sentry:sentry-android:6.34.0'
58
58
  }
@@ -30,6 +30,7 @@ export interface Spec extends TurboModule {
30
30
  };
31
31
  stopProfiling(): {
32
32
  profile?: string;
33
+ nativeProfile?: UnsafeObject;
33
34
  error?: string;
34
35
  };
35
36
  fetchNativePackageName(): Promise<string | undefined | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.d.ts","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,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ACL,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;;AAGF,wBAAkE"}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.js","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAwInD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/types';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\n\n// There has to be only one interface and it has to be named `Spec`\n// Only extra allowed definitions are types (probably codegen bug)\nexport interface Spec extends TurboModule {\n addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: number[],\n options: {\n store: boolean;\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package | null>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(defaultUserKeys: UnsafeObject | null, otherUserKeys: UnsafeObject | null): void;\n setContext(key: string, value: UnsafeObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n enableNativeFramesTracking(): void;\n fetchModules(): Promise<string | undefined | null>;\n fetchViewHierarchy(): Promise<number[] | undefined | null>;\n startProfiling(): { started?: boolean; error?: string };\n stopProfiling(): { profile?: string; error?: string };\n fetchNativePackageName(): Promise<string | undefined | null>;\n fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | undefined | null>;\n}\n\nexport type NativeStackFrame = {\n platform: string;\n /**\n * The instruction address of this frame.\n * Formatted as hex with 0x prefix.\n */\n instruction_addr: string;\n package?: string;\n /**\n * The debug image address of this frame.\n * Formatted as hex with 0x prefix.\n */\n image_addr?: string;\n in_app?: boolean;\n /**\n * The symbol name of this frame.\n * If symbolicated locally.\n */\n function?: string;\n /**\n * The symbol address of this frame.\n * If symbolicated locally.\n * Formatted as hex with 0x prefix.\n */\n symbol_addr?: string;\n};\n\nexport type NativeDebugImage = {\n name?: string;\n type?: string;\n uuid?: string;\n debug_id?: string;\n image_addr?: string;\n image_size?: number;\n code_file?: string;\n image_vmaddr?: string;\n};\n\nexport type NativeStackFrames = {\n frames: NativeStackFrame[];\n debugMetaImages?: NativeDebugImage[];\n};\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\n/**\n * This type describes serialized scope from sentry-cocoa and sentry-android\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n * https://github.com/getsentry/sentry-java/blob/a461f7e125b65240004e6162b341f383ce2e1394/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java#L32\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n contexts?: Record<string, Record<string, unknown>>;\n user?: {\n userId?: string;\n email?: string;\n username?: string;\n ipAddress?: string;\n segment?: string;\n data?: Record<string, unknown>;\n };\n dist?: string;\n environment?: string;\n fingerprint?: string[];\n level?: string;\n breadcrumbs?: {\n level?: string;\n timestamp?: string;\n category?: string;\n type?: string;\n message?: string;\n data?: Record<string, unknown>;\n }[];\n};\n\nexport type NativeScreenshot = {\n data: number[];\n contentType: string;\n filename: string;\n};\n\n// The export must be here to pass codegen even if not used\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNSentry');\n"]}
1
+ {"version":3,"file":"NativeRNSentry.js","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAwInD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/types';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\n\n// There has to be only one interface and it has to be named `Spec`\n// Only extra allowed definitions are types (probably codegen bug)\nexport interface Spec extends TurboModule {\n addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: number[],\n options: {\n store: boolean;\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package | null>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(defaultUserKeys: UnsafeObject | null, otherUserKeys: UnsafeObject | null): void;\n setContext(key: string, value: UnsafeObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n enableNativeFramesTracking(): void;\n fetchModules(): Promise<string | undefined | null>;\n fetchViewHierarchy(): Promise<number[] | undefined | null>;\n startProfiling(): { started?: boolean; error?: string };\n stopProfiling(): { profile?: string; nativeProfile?: UnsafeObject; error?: string };\n fetchNativePackageName(): Promise<string | undefined | null>;\n fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | undefined | null>;\n}\n\nexport type NativeStackFrame = {\n platform: string;\n /**\n * The instruction address of this frame.\n * Formatted as hex with 0x prefix.\n */\n instruction_addr: string;\n package?: string;\n /**\n * The debug image address of this frame.\n * Formatted as hex with 0x prefix.\n */\n image_addr?: string;\n in_app?: boolean;\n /**\n * The symbol name of this frame.\n * If symbolicated locally.\n */\n function?: string;\n /**\n * The symbol address of this frame.\n * If symbolicated locally.\n * Formatted as hex with 0x prefix.\n */\n symbol_addr?: string;\n};\n\nexport type NativeDebugImage = {\n name?: string;\n type?: string;\n uuid?: string;\n debug_id?: string;\n image_addr?: string;\n image_size?: number;\n code_file?: string;\n image_vmaddr?: string;\n};\n\nexport type NativeStackFrames = {\n frames: NativeStackFrame[];\n debugMetaImages?: NativeDebugImage[];\n};\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\n/**\n * This type describes serialized scope from sentry-cocoa and sentry-android\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n * https://github.com/getsentry/sentry-java/blob/a461f7e125b65240004e6162b341f383ce2e1394/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java#L32\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n contexts?: Record<string, Record<string, unknown>>;\n user?: {\n userId?: string;\n email?: string;\n username?: string;\n ipAddress?: string;\n segment?: string;\n data?: Record<string, unknown>;\n };\n dist?: string;\n environment?: string;\n fingerprint?: string[];\n level?: string;\n breadcrumbs?: {\n level?: string;\n timestamp?: string;\n category?: string;\n type?: string;\n message?: string;\n data?: Record<string, unknown>;\n }[];\n};\n\nexport type NativeScreenshot = {\n data: number[];\n contentType: string;\n filename: string;\n};\n\n// The export must be here to pass codegen even if not used\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNSentry');\n"]}
@@ -1,7 +1,7 @@
1
- import type { RawThreadCpuProfile } from './types';
1
+ import type { CombinedProfileEvent } from './types';
2
2
  export declare const PROFILE_QUEUE: {
3
- get: (key: string) => RawThreadCpuProfile | undefined;
4
- add: (key: string, value: RawThreadCpuProfile) => void;
3
+ get: (key: string) => CombinedProfileEvent | undefined;
4
+ add: (key: string, value: CombinedProfileEvent) => void;
5
5
  delete: (key: string) => boolean;
6
6
  clear: () => void;
7
7
  size: () => number;
@@ -1 +1 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/cache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,aAAa;;;;;;CAAiD,CAAC"}
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/cache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,aAAa;;;;;;CAAkD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/js/profiling/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAA8B,EAAE,CAAC,CAAC","sourcesContent":["import { makeFifoCache } from '@sentry/utils';\n\nimport type { RawThreadCpuProfile } from './types';\n\nexport const PROFILE_QUEUE = makeFifoCache<string, RawThreadCpuProfile>(20);\n"]}
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/js/profiling/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAA+B,EAAE,CAAC,CAAC","sourcesContent":["import { makeFifoCache } from '@sentry/utils';\n\nimport type { CombinedProfileEvent } from './types';\n\nexport const PROFILE_QUEUE = makeFifoCache<string, CombinedProfileEvent>(20);\n"]}
@@ -0,0 +1,6 @@
1
+ import type { DebugImage } from '@sentry/types';
2
+ /**
3
+ * Returns debug meta images of the loaded bundle.
4
+ */
5
+ export declare function getDebugMetadata(): DebugImage[];
6
+ //# sourceMappingURL=debugid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugid.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/debugid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,EAAE,CA4B/C"}
@@ -0,0 +1,29 @@
1
+ import { GLOBAL_OBJ, logger } from '@sentry/utils';
2
+ import { DEFAULT_BUNDLE_NAME } from './hermes';
3
+ /**
4
+ * Returns debug meta images of the loaded bundle.
5
+ */
6
+ export function getDebugMetadata() {
7
+ if (!DEFAULT_BUNDLE_NAME) {
8
+ return [];
9
+ }
10
+ const debugIdMap = GLOBAL_OBJ._sentryDebugIds;
11
+ if (!debugIdMap) {
12
+ return [];
13
+ }
14
+ const debugIdsKeys = Object.keys(debugIdMap);
15
+ if (!debugIdsKeys.length) {
16
+ return [];
17
+ }
18
+ if (debugIdsKeys.length > 1) {
19
+ logger.warn('[Profiling] Multiple debug images found, but only one one bundle is supported. Using the first one...');
20
+ }
21
+ return [
22
+ {
23
+ code_file: DEFAULT_BUNDLE_NAME,
24
+ debug_id: debugIdMap[debugIdsKeys[0]],
25
+ type: 'sourcemap',
26
+ },
27
+ ];
28
+ }
29
+ //# sourceMappingURL=debugid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugid.js","sourceRoot":"","sources":["../../../src/js/profiling/debugid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,mBAAmB,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,EAAE,CAAC;KACX;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3B,MAAM,CAAC,IAAI,CACT,uGAAuG,CACxG,CAAC;KACH;IAED,OAAO;QACL;YACE,SAAS,EAAE,mBAAmB;YAC9B,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,EAAE,WAAW;SAClB;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { DebugImage } from '@sentry/types';\nimport { GLOBAL_OBJ, logger } from '@sentry/utils';\n\nimport { DEFAULT_BUNDLE_NAME } from './hermes';\n\n/**\n * Returns debug meta images of the loaded bundle.\n */\nexport function getDebugMetadata(): DebugImage[] {\n if (!DEFAULT_BUNDLE_NAME) {\n return [];\n }\n\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n if (!debugIdMap) {\n return [];\n }\n\n const debugIdsKeys = Object.keys(debugIdMap);\n if (!debugIdsKeys.length) {\n return [];\n }\n\n if (debugIdsKeys.length > 1) {\n logger.warn(\n '[Profiling] Multiple debug images found, but only one one bundle is supported. Using the first one...',\n );\n }\n\n return [\n {\n code_file: DEFAULT_BUNDLE_NAME,\n debug_id: debugIdMap[debugIdsKeys[0]],\n type: 'sourcemap',\n },\n ];\n}\n"]}
@@ -1,4 +1,3 @@
1
- import type { RawThreadCpuProfile } from './types';
2
1
  export type StackFrameId = number;
3
2
  export type MicrosecondsSinceBoot = string;
4
3
  export interface TraceEvent {
@@ -38,12 +37,4 @@ export interface Profile {
38
37
  stackFrames: Record<string, StackFrame>;
39
38
  }
40
39
  export declare const DEFAULT_BUNDLE_NAME: string | undefined;
41
- /**
42
- * Starts Hermes Sampling Profiler and returns the timestamp when profiling started in nanoseconds.
43
- */
44
- export declare function startProfiling(): number | null;
45
- /**
46
- * Stops Hermes Sampling Profiler and returns the profile.
47
- */
48
- export declare function stopProfiling(): RawThreadCpuProfile | null;
49
40
  //# sourceMappingURL=hermes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,qBAAqB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,qBAAqB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAA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ACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,qBAAqB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IAEzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,mBAAmB,oBACuF,CAAC"}
@@ -1,28 +1,4 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { ANDROID_DEFAULT_BUNDLE_NAME, IOS_DEFAULT_BUNDLE_NAME } from '../integrations/rewriteframes';
3
- import { NATIVE } from '../wrapper';
4
- import { convertToSentryProfile } from './convertHermesProfile';
5
3
  export const DEFAULT_BUNDLE_NAME = Platform.OS === 'android' ? ANDROID_DEFAULT_BUNDLE_NAME : Platform.OS === 'ios' ? IOS_DEFAULT_BUNDLE_NAME : undefined;
6
- const MS_TO_NS = 1e6;
7
- /**
8
- * Starts Hermes Sampling Profiler and returns the timestamp when profiling started in nanoseconds.
9
- */
10
- export function startProfiling() {
11
- const started = NATIVE.startProfiling();
12
- if (!started) {
13
- return null;
14
- }
15
- const profileStartTimestampNs = Date.now() * MS_TO_NS;
16
- return profileStartTimestampNs;
17
- }
18
- /**
19
- * Stops Hermes Sampling Profiler and returns the profile.
20
- */
21
- export function stopProfiling() {
22
- const hermesProfile = NATIVE.stopProfiling();
23
- if (!hermesProfile) {
24
- return null;
25
- }
26
- return convertToSentryProfile(hermesProfile);
27
- }
28
4
  //# sourceMappingURL=hermes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAmDhE,MAAM,CAAC,MAAM,mBAAmB,GAC9B,QAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC;AAExH,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 { Platform } from 'react-native';\n\nimport { ANDROID_DEFAULT_BUNDLE_NAME, IOS_DEFAULT_BUNDLE_NAME } from '../integrations/rewriteframes';\nimport { 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 // Hermes Bytecode\n funcVirtAddr?: string;\n offset?: string;\n\n // JavaScript\n line?: string;\n column?: string;\n funcLine?: string;\n funcColumn?: string;\n\n // Common\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\nexport const DEFAULT_BUNDLE_NAME =\n Platform.OS === 'android' ? ANDROID_DEFAULT_BUNDLE_NAME : Platform.OS === 'ios' ? IOS_DEFAULT_BUNDLE_NAME : undefined;\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"]}
1
+ {"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAkDrG,MAAM,CAAC,MAAM,mBAAmB,GAC9B,QAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC","sourcesContent":["import { Platform } from 'react-native';\n\nimport { ANDROID_DEFAULT_BUNDLE_NAME, IOS_DEFAULT_BUNDLE_NAME } from '../integrations/rewriteframes';\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 // Hermes Bytecode\n funcVirtAddr?: string;\n offset?: string;\n\n // JavaScript\n line?: string;\n column?: string;\n funcLine?: string;\n funcColumn?: string;\n\n // Common\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\nexport const DEFAULT_BUNDLE_NAME =\n Platform.OS === 'android' ? ANDROID_DEFAULT_BUNDLE_NAME : Platform.OS === 'ios' ? IOS_DEFAULT_BUNDLE_NAME : undefined;\n"]}
@@ -1,5 +1,7 @@
1
1
  import type { Hub } from '@sentry/core';
2
- import type { EventProcessor, Integration } from '@sentry/types';
2
+ import type { EventProcessor, Integration, ThreadCpuProfile } from '@sentry/types';
3
+ import type { NativeProfileEvent } from './nativeTypes';
4
+ import type { CombinedProfileEvent, HermesProfileEvent } from './types';
3
5
  export declare const MAX_PROFILE_DURATION_MS: number;
4
6
  /**
5
7
  * Profiling integration creates a profile for each transaction and adds it to the event envelope.
@@ -36,4 +38,20 @@ export declare class HermesProfiling implements Integration {
36
38
  private _createProfileEventFor;
37
39
  private _clearCurrentProfileTimeout;
38
40
  }
41
+ /**
42
+ * Starts Profilers and returns the timestamp when profiling started in nanoseconds.
43
+ */
44
+ export declare function startProfiling(): number | null;
45
+ /**
46
+ * Stops Profilers and returns collected combined profile.
47
+ */
48
+ export declare function stopProfiling(): CombinedProfileEvent | null;
49
+ /**
50
+ * Merges Hermes and Native profile events into one.
51
+ */
52
+ export declare function addNativeProfileToHermesProfile(hermes: HermesProfileEvent, native: NativeProfileEvent): CombinedProfileEvent;
53
+ /**
54
+ * Merges Hermes And Native profiles into one.
55
+ */
56
+ export declare function addNativeThreadCpuProfileToHermes(hermes: ThreadCpuProfile, native: ThreadCpuProfile, hermes_active_thread_id: string | undefined): CombinedProfileEvent['profile'];
39
57
  //# sourceMappingURL=integration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAmB,cAAc,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAQxG,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;IAwChF,OA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;IAEF,OAAO,CAAC,2BAA2B,CAGjC;CACH;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAO9C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,oBAAoB,GAAG,IAAI,CAqB3D;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,kBAAkB,GACzB,oBAAoB,CAStB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,uBAAuB,EAAE,MAAM,GAAG,SAAS,GAC1C,oBAAoB,CAAC,SAAS,CAAC,CAkCjC"}
@@ -1,10 +1,13 @@
1
1
  import { getActiveTransaction } from '@sentry/core';
2
2
  import { logger, uuid4 } from '@sentry/utils';
3
+ import { Platform } from 'react-native';
3
4
  import { isHermesEnabled } from '../utils/environment';
5
+ import { NATIVE } from '../wrapper';
4
6
  import { PROFILE_QUEUE } from './cache';
5
- import { startProfiling, stopProfiling } from './hermes';
6
- import { addProfilesToEnvelope, createProfilingEvent, findProfiledTransactionsFromEnvelope } from './utils';
7
+ import { convertToSentryProfile } from './convertHermesProfile';
8
+ import { addProfilesToEnvelope, createHermesProfilingEvent, enrichCombinedProfileWithEventContext, findProfiledTransactionsFromEnvelope, } from './utils';
7
9
  export const MAX_PROFILE_DURATION_MS = 30 * 1e3;
10
+ const MS_TO_NS = 1e6;
8
11
  /**
9
12
  * Profiling integration creates a profile for each transaction and adds it to the event envelope.
10
13
  *
@@ -84,8 +87,7 @@ export class HermesProfiling {
84
87
  this._currentProfile = undefined;
85
88
  return;
86
89
  }
87
- profile.profile_id = this._currentProfile.profile_id;
88
- PROFILE_QUEUE.add(profile.profile_id, profile);
90
+ PROFILE_QUEUE.add(this._currentProfile.profile_id, profile);
89
91
  logger.log('[Profiling] finished profiling: ', this._currentProfile.profile_id);
90
92
  this._currentProfile = undefined;
91
93
  };
@@ -100,15 +102,15 @@ export class HermesProfiling {
100
102
  if ((_c = profiledTransaction === null || profiledTransaction === void 0 ? void 0 : profiledTransaction.contexts) === null || _c === void 0 ? void 0 : _c['.profile']) {
101
103
  delete profiledTransaction.contexts.profile;
102
104
  }
103
- const cpuProfile = PROFILE_QUEUE.get(profile_id);
105
+ const profile = PROFILE_QUEUE.get(profile_id);
104
106
  PROFILE_QUEUE.delete(profile_id);
105
- if (!cpuProfile) {
107
+ if (!profile) {
106
108
  logger.log(`[Profiling] cannot find profile ${profile_id} for transaction ${profiledTransaction.event_id}`);
107
109
  return null;
108
110
  }
109
- const profile = createProfilingEvent(cpuProfile, profiledTransaction);
111
+ const profileWithEvent = enrichCombinedProfileWithEventContext(profile_id, profile, profiledTransaction);
110
112
  logger.log(`[Profiling] Created profile ${profile_id} for transaction ${profiledTransaction.event_id}`);
111
- return profile;
113
+ return profileWithEvent;
112
114
  };
113
115
  this._clearCurrentProfileTimeout = () => {
114
116
  this._currentProfileTimeout !== undefined && clearTimeout(this._currentProfileTimeout);
@@ -155,4 +157,75 @@ export class HermesProfiling {
155
157
  * @inheritDoc
156
158
  */
157
159
  HermesProfiling.id = 'HermesProfiling';
160
+ /**
161
+ * Starts Profilers and returns the timestamp when profiling started in nanoseconds.
162
+ */
163
+ export function startProfiling() {
164
+ const started = NATIVE.startProfiling();
165
+ if (!started) {
166
+ return null;
167
+ }
168
+ return Date.now() * MS_TO_NS;
169
+ }
170
+ /**
171
+ * Stops Profilers and returns collected combined profile.
172
+ */
173
+ export function stopProfiling() {
174
+ const collectedProfiles = NATIVE.stopProfiling();
175
+ if (!collectedProfiles) {
176
+ return null;
177
+ }
178
+ const hermesProfile = convertToSentryProfile(collectedProfiles.hermesProfile);
179
+ if (!hermesProfile) {
180
+ return null;
181
+ }
182
+ const hermesProfileEvent = createHermesProfilingEvent(hermesProfile);
183
+ if (!hermesProfileEvent) {
184
+ return null;
185
+ }
186
+ if (!collectedProfiles.nativeProfile) {
187
+ return hermesProfileEvent;
188
+ }
189
+ return addNativeProfileToHermesProfile(hermesProfileEvent, collectedProfiles.nativeProfile);
190
+ }
191
+ /**
192
+ * Merges Hermes and Native profile events into one.
193
+ */
194
+ export function addNativeProfileToHermesProfile(hermes, native) {
195
+ return Object.assign(Object.assign({}, hermes), { profile: addNativeThreadCpuProfileToHermes(hermes.profile, native.profile, hermes.transaction.active_thread_id), debug_meta: {
196
+ images: native.debug_meta.images,
197
+ }, measurements: native.measurements });
198
+ }
199
+ /**
200
+ * Merges Hermes And Native profiles into one.
201
+ */
202
+ export function addNativeThreadCpuProfileToHermes(hermes, native, hermes_active_thread_id) {
203
+ // assumes thread ids are unique
204
+ hermes.thread_metadata = Object.assign(Object.assign({}, native.thread_metadata), hermes.thread_metadata);
205
+ // assumes queue ids are unique
206
+ hermes.queue_metadata = Object.assign(Object.assign({}, native.queue_metadata), hermes.queue_metadata);
207
+ // recalculate frames and stacks using offset
208
+ const framesOffset = hermes.frames.length;
209
+ const stacksOffset = hermes.stacks.length;
210
+ if (native.frames) {
211
+ for (const frame of native.frames) {
212
+ hermes.frames.push({
213
+ function: frame.function,
214
+ instruction_addr: frame.instruction_addr,
215
+ platform: Platform.OS === 'ios' ? 'cocoa' : undefined,
216
+ });
217
+ }
218
+ }
219
+ hermes.stacks = [
220
+ ...(hermes.stacks || []),
221
+ ...(native.stacks || []).map(stack => stack.map(frameId => frameId + framesOffset)),
222
+ ];
223
+ hermes.samples = [
224
+ ...(hermes.samples || []),
225
+ ...(native.samples || [])
226
+ .filter(sample => sample.thread_id !== hermes_active_thread_id)
227
+ .map(sample => (Object.assign(Object.assign({}, sample), { stack_id: stacksOffset + sample.stack_id }))),
228
+ ];
229
+ return hermes;
230
+ }
158
231
  //# sourceMappingURL=integration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD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a,CAAC,IAAI,EAAE,EAAE;gBACzB,OAAO;aACR;YAED,MAAM,oBAAoB,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC;YAC5E,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;gBAChC,MAAM,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;gBACrE,OAAO;aACR;YAED,MAAM,uBAAuB,GAAc,EAAE,CAAC;YAC9C,KAAK,MAAM,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;;AA9DD;;GAEG;AACW,kBAAE,GAAW,iBAAiB,CAAC","sourcesContent":["import type { Hub } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport type { Envelope, Event, EventProcessor, 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 this._startCurrentProfileForActiveTransaction();\n client.on('startTransaction', this._startCurrentProfile);\n\n client.on('finishTransaction', this._finishCurrentProfile);\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 _startCurrentProfileForActiveTransaction = (): void => {\n if (this._currentProfile) {\n return;\n }\n const transaction = this._getCurrentHub && getActiveTransaction(this._getCurrentHub());\n transaction && this._startCurrentProfile(transaction);\n };\n\n private _startCurrentProfile = (transaction: Transaction): void => {\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 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 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"]}
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAUpD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,GAAG,CAAC;AAEhD,MAAM,QAAQ,GAAW,GAAG,CAAC;AAE7B;;;;GAIG;AACH,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;QAwDjC,6CAAwC,GAAG,GAAS,EAAE;YAC5D,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,OAAO;aACR;YACD,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,IAAI,oBAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;YACvF,WAAW,IAAI,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACxD,CAAC,CAAC;QAEM,yBAAoB,GAAG,CAAC,WAAwB,EAAQ,EAAE;YAChE,I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CAAC,MAAM,CAAC,MAAM,CAAC;IAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAE1C,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE;YACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;gBACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,QAAQ,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aACtD,CAAC,CAAC;SACJ;KACF;IACD,MAAM,CAAC,MAAM,GAAG;QACd,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;QACxB,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;KACpF,CAAC;IACF,MAAM,CAAC,OAAO,GAAG;QACf,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACzB,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;aACtB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,KAAK,uBAAuB,CAAC;aAC9D,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,iCACV,MAAM,KACT,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,QAAQ,IACxC,CAAC;KACN,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Hub } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport type {\n Envelope,\n Event,\n EventProcessor,\n Integration,\n Profile,\n ThreadCpuProfile,\n Transaction,\n} from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\nimport { Platform } from 'react-native';\n\nimport { isHermesEnabled } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { PROFILE_QUEUE } from './cache';\nimport { convertToSentryProfile } from './convertHermesProfile';\nimport type { NativeProfileEvent } from './nativeTypes';\nimport type { CombinedProfileEvent, HermesProfileEvent } from './types';\nimport {\n addProfilesToEnvelope,\n createHermesProfilingEvent,\n enrichCombinedProfileWithEventContext,\n findProfiledTransactionsFromEnvelope,\n} from './utils';\n\nexport const MAX_PROFILE_DURATION_MS = 30 * 1e3;\n\nconst MS_TO_NS: number = 1e6;\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 this._startCurrentProfileForActiveTransaction();\n client.on('startTransaction', this._startCurrentProfile);\n\n client.on('finishTransaction', this._finishCurrentProfile);\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 _startCurrentProfileForActiveTransaction = (): void => {\n if (this._currentProfile) {\n return;\n }\n const transaction = this._getCurrentHub && getActiveTransaction(this._getCurrentHub());\n transaction && this._startCurrentProfile(transaction);\n };\n\n private _startCurrentProfile = (transaction: Transaction): void => {\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 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 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_QUEUE.add(this._currentProfile.profile_id, profile);\n\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 profile = PROFILE_QUEUE.get(profile_id);\n PROFILE_QUEUE.delete(profile_id);\n\n if (!profile) {\n logger.log(`[Profiling] cannot find profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n return null;\n }\n\n const profileWithEvent = enrichCombinedProfileWithEventContext(profile_id, profile, profiledTransaction);\n logger.log(`[Profiling] Created profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n\n return profileWithEvent;\n };\n\n private _clearCurrentProfileTimeout = (): void => {\n this._currentProfileTimeout !== undefined && clearTimeout(this._currentProfileTimeout);\n this._currentProfileTimeout = undefined;\n };\n}\n\n/**\n * Starts Profilers 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 return Date.now() * MS_TO_NS;\n}\n\n/**\n * Stops Profilers and returns collected combined profile.\n */\nexport function stopProfiling(): CombinedProfileEvent | null {\n const collectedProfiles = NATIVE.stopProfiling();\n if (!collectedProfiles) {\n return null;\n }\n\n const hermesProfile = convertToSentryProfile(collectedProfiles.hermesProfile);\n if (!hermesProfile) {\n return null;\n }\n\n const hermesProfileEvent = createHermesProfilingEvent(hermesProfile);\n if (!hermesProfileEvent) {\n return null;\n }\n\n if (!collectedProfiles.nativeProfile) {\n return hermesProfileEvent;\n }\n\n return addNativeProfileToHermesProfile(hermesProfileEvent, collectedProfiles.nativeProfile);\n}\n\n/**\n * Merges Hermes and Native profile events into one.\n */\nexport function addNativeProfileToHermesProfile(\n hermes: HermesProfileEvent,\n native: NativeProfileEvent,\n): CombinedProfileEvent {\n return {\n ...hermes,\n profile: addNativeThreadCpuProfileToHermes(hermes.profile, native.profile, hermes.transaction.active_thread_id),\n debug_meta: {\n images: native.debug_meta.images,\n },\n measurements: native.measurements,\n };\n}\n\n/**\n * Merges Hermes And Native profiles into one.\n */\nexport function addNativeThreadCpuProfileToHermes(\n hermes: ThreadCpuProfile,\n native: ThreadCpuProfile,\n hermes_active_thread_id: string | undefined,\n): CombinedProfileEvent['profile'] {\n // assumes thread ids are unique\n hermes.thread_metadata = { ...native.thread_metadata, ...hermes.thread_metadata };\n // assumes queue ids are unique\n hermes.queue_metadata = { ...native.queue_metadata, ...hermes.queue_metadata };\n\n // recalculate frames and stacks using offset\n const framesOffset = hermes.frames.length;\n const stacksOffset = hermes.stacks.length;\n\n if (native.frames) {\n for (const frame of native.frames) {\n hermes.frames.push({\n function: frame.function,\n instruction_addr: frame.instruction_addr,\n platform: Platform.OS === 'ios' ? 'cocoa' : undefined,\n });\n }\n }\n hermes.stacks = [\n ...(hermes.stacks || []),\n ...(native.stacks || []).map(stack => stack.map(frameId => frameId + framesOffset)),\n ];\n hermes.samples = [\n ...(hermes.samples || []),\n ...(native.samples || [])\n .filter(sample => sample.thread_id !== hermes_active_thread_id)\n .map(sample => ({\n ...sample,\n stack_id: stacksOffset + sample.stack_id,\n })),\n ];\n\n return hermes;\n}\n"]}
@@ -0,0 +1,43 @@
1
+ export interface NativeProfileEvent {
2
+ profile_id: string;
3
+ profile: {
4
+ samples: {
5
+ stack_id: number;
6
+ thread_id: string;
7
+ queue_address?: string;
8
+ elapsed_since_start_ns: string;
9
+ }[];
10
+ stacks: number[][];
11
+ frames: {
12
+ function?: string;
13
+ instruction_addr?: string;
14
+ }[];
15
+ thread_metadata: Record<string, {
16
+ name?: string;
17
+ priority?: number;
18
+ }>;
19
+ queue_metadata?: Record<string, {
20
+ label: string;
21
+ }>;
22
+ };
23
+ transaction: {
24
+ active_thread_id: string;
25
+ };
26
+ measurements: Record<string, {
27
+ values: {
28
+ elapsed_since_start_ns: number;
29
+ value: number;
30
+ }[];
31
+ unit: string;
32
+ }>;
33
+ debug_meta: {
34
+ images: {
35
+ type: 'macho';
36
+ debug_id: string;
37
+ image_addr: string;
38
+ image_size: number;
39
+ code_file: string;
40
+ }[];
41
+ };
42
+ }
43
+ //# sourceMappingURL=nativeTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeTypes.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/nativeTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,aAAa,CAAC,EAAE,MAAM,CAAC;YACvB,sBAAsB,EAAE,MAAM,CAAC;SAChC,EAAE,CAAC;QACJ,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;QACnB,MAAM,EAAE;YACN,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;SAC3B,EAAE,CAAC;QACJ,eAAe,EAAE,MAAM,CACrB,MAAM,EACN;YACE,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CACF,CAAC;QACF,cAAc,CAAC,EAAE,MAAM,CACrB,MAAM,EACN;YACE,KAAK,EAAE,MAAM,CAAC;SACf,CACF,CAAC;KACH,CAAC;IACF,WAAW,EAAE;QACX,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,YAAY,EAAE,MAAM,CAClB,MAAM,EACN;QACE,MAAM,EAAE;YACN,sBAAsB,EAAE,MAAM,CAAC;YAC/B,KAAK,EAAE,MAAM,CAAC;SACf,EAAE,CAAC;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CACF,CAAC;IACF,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,CAAC;YACd,QAAQ,EAAE,MAAM,CAAC;YACjB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;SACnB,EAAE,CAAC;KACL,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nativeTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeTypes.js","sourceRoot":"","sources":["../../../src/js/profiling/nativeTypes.ts"],"names":[],"mappings":"","sourcesContent":["export interface NativeProfileEvent {\n profile_id: string;\n profile: {\n samples: {\n stack_id: number;\n thread_id: string;\n queue_address?: string;\n elapsed_since_start_ns: string;\n }[];\n stacks: number[][];\n frames: {\n function?: string;\n instruction_addr?: string;\n }[];\n thread_metadata: Record<\n string,\n {\n name?: string;\n priority?: number;\n }\n >;\n queue_metadata?: Record<\n string,\n {\n label: string;\n }\n >;\n };\n transaction: {\n active_thread_id: string;\n };\n measurements: Record<\n string,\n {\n values: {\n elapsed_since_start_ns: number;\n value: number;\n }[];\n unit: string;\n }\n >;\n debug_meta: {\n images: {\n type: 'macho';\n debug_id: string;\n image_addr: string;\n image_size: number;\n code_file: string;\n }[];\n };\n}\n"]}
@@ -1,7 +1,18 @@
1
- import type { ThreadCpuFrame, ThreadCpuProfile } from '@sentry/types';
1
+ import type { Profile, ThreadCpuFrame, ThreadCpuProfile } from '@sentry/types';
2
+ import type { NativeProfileEvent } from './nativeTypes';
2
3
  export interface RawThreadCpuProfile extends ThreadCpuProfile {
3
4
  frames: ThreadCpuFrame[];
4
5
  profile_id?: string;
5
6
  active_thread_id: string;
6
7
  }
8
+ export type HermesProfileEvent = {
9
+ platform: 'javascript';
10
+ version: '1';
11
+ profile: ThreadCpuProfile;
12
+ transaction: {
13
+ active_thread_id: string;
14
+ };
15
+ };
16
+ export type ProfileEvent = Profile;
17
+ export type CombinedProfileEvent = HermesProfileEvent & Partial<NativeProfileEvent>;
7
18
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE;QACX,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AAEnC,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/profiling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ThreadCpuFrame, ThreadCpuProfile } from '@sentry/types';\n\nexport interface RawThreadCpuProfile extends ThreadCpuProfile {\n frames: ThreadCpuFrame[];\n profile_id?: string;\n active_thread_id: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/profiling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Profile, ThreadCpuFrame, ThreadCpuProfile } from '@sentry/types';\n\nimport type { NativeProfileEvent } from './nativeTypes';\n\nexport interface RawThreadCpuProfile extends ThreadCpuProfile {\n frames: ThreadCpuFrame[];\n profile_id?: string;\n active_thread_id: string;\n}\n\nexport type HermesProfileEvent = {\n platform: 'javascript';\n version: '1';\n profile: ThreadCpuProfile;\n transaction: {\n active_thread_id: string;\n };\n};\n\nexport type ProfileEvent = Profile;\n\nexport type CombinedProfileEvent = HermesProfileEvent & Partial<NativeProfileEvent>;\n"]}
@@ -1,9 +1,9 @@
1
- import type { DebugImage, Envelope, Event, Profile } from '@sentry/types';
2
- import type { RawThreadCpuProfile } from './types';
1
+ import type { Envelope, Event, Profile, ThreadCpuProfile } from '@sentry/types';
2
+ import type { CombinedProfileEvent, HermesProfileEvent, RawThreadCpuProfile } from './types';
3
3
  /**
4
4
  *
5
5
  */
6
- export declare function isValidProfile(profile: RawThreadCpuProfile): profile is RawThreadCpuProfile & {
6
+ export declare function isValidProfile(profile: ThreadCpuProfile): profile is RawThreadCpuProfile & {
7
7
  profile_id: string;
8
8
  };
9
9
  /**
@@ -17,11 +17,11 @@ export declare function findProfiledTransactionsFromEnvelope(envelope: Envelope)
17
17
  * @param event
18
18
  * @returns {Profile | null}
19
19
  */
20
- export declare function createProfilingEvent(profile: RawThreadCpuProfile, event: Event): Profile | null;
20
+ export declare function enrichCombinedProfileWithEventContext(profile_id: string, profile: CombinedProfileEvent, event: Event): Profile | null;
21
21
  /**
22
- * Returns debug meta images of the loaded bundle.
22
+ * Creates profiling event compatible carrier Object from raw Hermes profile.
23
23
  */
24
- export declare function getDebugMetadata(): DebugImage[];
24
+ export declare function createHermesProfilingEvent(profile: RawThreadCpuProfile): HermesProfileEvent;
25
25
  /**
26
26
  * Adds items to envelope if they are not already present - mutates the envelope.
27
27
  * @param envelope
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAK1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;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;AA2FD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,EAAE,CA4B/C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,QAAQ,CAUvF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKhF,OAAO,KAAK,EAAE,oBAAoB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