@sentry/react-native 6.10.0 → 6.11.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 (131) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +43 -21
  3. package/android/src/main/java/io/sentry/react/RNSentryOnDrawReporterManager.java +82 -51
  4. package/android/src/main/java/io/sentry/react/RNSentryTimeToDisplay.java +37 -0
  5. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +16 -6
  8. package/dist/js/NativeRNSentry.d.ts +2 -0
  9. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  10. package/dist/js/NativeRNSentry.js.map +1 -1
  11. package/dist/js/index.d.ts +1 -1
  12. package/dist/js/index.d.ts.map +1 -1
  13. package/dist/js/index.js +1 -1
  14. package/dist/js/index.js.map +1 -1
  15. package/dist/js/integrations/appRegistry.d.ts +8 -0
  16. package/dist/js/integrations/appRegistry.d.ts.map +1 -0
  17. package/dist/js/integrations/appRegistry.js +43 -0
  18. package/dist/js/integrations/appRegistry.js.map +1 -0
  19. package/dist/js/integrations/default.d.ts.map +1 -1
  20. package/dist/js/integrations/default.js +5 -1
  21. package/dist/js/integrations/default.js.map +1 -1
  22. package/dist/js/integrations/exports.d.ts +2 -0
  23. package/dist/js/integrations/exports.d.ts.map +1 -1
  24. package/dist/js/integrations/exports.js +2 -0
  25. package/dist/js/integrations/exports.js.map +1 -1
  26. package/dist/js/profiling/integration.d.ts.map +1 -1
  27. package/dist/js/profiling/integration.js +2 -3
  28. package/dist/js/profiling/integration.js.map +1 -1
  29. package/dist/js/profiling/nativeTypes.d.ts +1 -1
  30. package/dist/js/profiling/nativeTypes.d.ts.map +1 -1
  31. package/dist/js/profiling/nativeTypes.js.map +1 -1
  32. package/dist/js/replay/CustomMask.d.ts.map +1 -1
  33. package/dist/js/replay/CustomMask.js +3 -2
  34. package/dist/js/replay/CustomMask.js.map +1 -1
  35. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  36. package/dist/js/tracing/integrations/appStart.js +38 -7
  37. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  38. package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts +4 -0
  39. package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -0
  40. package/dist/js/tracing/integrations/timeToDisplayIntegration.js +193 -0
  41. package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -0
  42. package/dist/js/tracing/ops.d.ts +2 -0
  43. package/dist/js/tracing/ops.d.ts.map +1 -1
  44. package/dist/js/tracing/ops.js +2 -0
  45. package/dist/js/tracing/ops.js.map +1 -1
  46. package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
  47. package/dist/js/tracing/reactnativeprofiler.js +12 -1
  48. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  49. package/dist/js/tracing/reactnavigation.d.ts +20 -2
  50. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  51. package/dist/js/tracing/reactnavigation.js +68 -40
  52. package/dist/js/tracing/reactnavigation.js.map +1 -1
  53. package/dist/js/tracing/semanticAttributes.d.ts +2 -0
  54. package/dist/js/tracing/semanticAttributes.d.ts.map +1 -1
  55. package/dist/js/tracing/semanticAttributes.js +2 -0
  56. package/dist/js/tracing/semanticAttributes.js.map +1 -1
  57. package/dist/js/tracing/timeToDisplayFallback.d.ts +3 -0
  58. package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -0
  59. package/dist/js/tracing/timeToDisplayFallback.js +21 -0
  60. package/dist/js/tracing/timeToDisplayFallback.js.map +1 -0
  61. package/dist/js/tracing/timetodisplay.d.ts +29 -0
  62. package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
  63. package/dist/js/tracing/timetodisplay.js +43 -20
  64. package/dist/js/tracing/timetodisplay.js.map +1 -1
  65. package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
  66. package/dist/js/tracing/timetodisplaynative.js +2 -1
  67. package/dist/js/tracing/timetodisplaynative.js.map +1 -1
  68. package/dist/js/tracing/timetodisplaynative.types.d.ts +1 -3
  69. package/dist/js/tracing/timetodisplaynative.types.d.ts.map +1 -1
  70. package/dist/js/tracing/timetodisplaynative.types.js.map +1 -1
  71. package/dist/js/utils/rnlibraries.d.ts +1 -1
  72. package/dist/js/utils/rnlibraries.d.ts.map +1 -1
  73. package/dist/js/utils/rnlibraries.js +5 -3
  74. package/dist/js/utils/rnlibraries.js.map +1 -1
  75. package/dist/js/utils/rnlibrariesinterface.d.ts +1 -0
  76. package/dist/js/utils/rnlibrariesinterface.d.ts.map +1 -1
  77. package/dist/js/utils/rnlibrariesinterface.js.map +1 -1
  78. package/dist/js/vendor/react-native/index.d.ts +3 -0
  79. package/dist/js/vendor/react-native/index.d.ts.map +1 -1
  80. package/dist/js/vendor/react-native/index.js.map +1 -1
  81. package/dist/js/vendor/react-navigation/types.d.ts +27 -0
  82. package/dist/js/vendor/react-navigation/types.d.ts.map +1 -0
  83. package/dist/js/vendor/react-navigation/types.js +3 -0
  84. package/dist/js/vendor/react-navigation/types.js.map +1 -0
  85. package/dist/js/version.d.ts +1 -1
  86. package/dist/js/version.js +1 -1
  87. package/dist/js/version.js.map +1 -1
  88. package/dist/js/wrapper.d.ts +2 -0
  89. package/dist/js/wrapper.d.ts.map +1 -1
  90. package/dist/js/wrapper.js +24 -0
  91. package/dist/js/wrapper.js.map +1 -1
  92. package/ios/RNSentry.mm +15 -6
  93. package/ios/RNSentryFramesTrackerListener.h +7 -3
  94. package/ios/RNSentryOnDrawReporter.h +6 -2
  95. package/ios/RNSentryOnDrawReporter.m +47 -20
  96. package/ios/RNSentryTimeToDisplay.h +7 -0
  97. package/ios/RNSentryTimeToDisplay.m +69 -2
  98. package/ios/RNSentryVersion.m +1 -1
  99. package/package.json +4 -4
  100. package/scripts/sentry-xcode-debug-files.sh +1 -4
  101. package/scripts/sentry-xcode.sh +6 -4
  102. package/sentry.gradle +4 -2
  103. package/src/js/NativeRNSentry.ts +2 -0
  104. package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
  105. package/ts3.8/dist/js/index.d.ts +1 -1
  106. package/ts3.8/dist/js/integrations/appRegistry.d.ts +8 -0
  107. package/ts3.8/dist/js/integrations/exports.d.ts +2 -0
  108. package/ts3.8/dist/js/profiling/nativeTypes.d.ts +1 -1
  109. package/ts3.8/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts +4 -0
  110. package/ts3.8/dist/js/tracing/ops.d.ts +2 -0
  111. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +20 -2
  112. package/ts3.8/dist/js/tracing/semanticAttributes.d.ts +2 -0
  113. package/ts3.8/dist/js/tracing/timeToDisplayFallback.d.ts +3 -0
  114. package/ts3.8/dist/js/tracing/timetodisplay.d.ts +29 -0
  115. package/ts3.8/dist/js/tracing/timetodisplaynative.types.d.ts +1 -3
  116. package/ts3.8/dist/js/utils/rnlibraries.d.ts +1 -1
  117. package/ts3.8/dist/js/utils/rnlibrariesinterface.d.ts +1 -0
  118. package/ts3.8/dist/js/vendor/react-native/index.d.ts +3 -0
  119. package/ts3.8/dist/js/vendor/react-navigation/types.d.ts +27 -0
  120. package/ts3.8/dist/js/version.d.ts +1 -1
  121. package/ts3.8/dist/js/wrapper.d.ts +2 -0
  122. package/dist/js/utils/sentryeventemitter.d.ts +0 -24
  123. package/dist/js/utils/sentryeventemitter.d.ts.map +0 -1
  124. package/dist/js/utils/sentryeventemitter.js +0 -82
  125. package/dist/js/utils/sentryeventemitter.js.map +0 -1
  126. package/dist/js/utils/sentryeventemitterfallback.d.ts +0 -19
  127. package/dist/js/utils/sentryeventemitterfallback.d.ts.map +0 -1
  128. package/dist/js/utils/sentryeventemitterfallback.js +0 -78
  129. package/dist/js/utils/sentryeventemitterfallback.js.map +0 -1
  130. package/ts3.8/dist/js/utils/sentryeventemitter.d.ts +0 -24
  131. package/ts3.8/dist/js/utils/sentryeventemitterfallback.d.ts +0 -19
@@ -1,6 +1,6 @@
1
1
  import { reactNativeTracingIntegration } from '../tracing';
2
2
  import { isExpoGo, notWeb } from '../utils/environment';
3
- import { appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, createNativeFramesIntegrations, createReactNativeRewriteFrames, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
3
+ import { appRegistryIntegration, appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, createNativeFramesIntegrations, createReactNativeRewriteFrames, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, timeToDisplayIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
4
4
  /**
5
5
  * Returns the default ReactNative integrations based on the current environment.
6
6
  *
@@ -66,8 +66,12 @@ export function getDefaultIntegrations(options) {
66
66
  integrations.push(userInteractionIntegration());
67
67
  }
68
68
  if (hasTracingEnabled && options.enableAutoPerformanceTracing) {
69
+ integrations.push(appRegistryIntegration());
69
70
  integrations.push(reactNativeTracingIntegration());
70
71
  }
72
+ if (hasTracingEnabled) {
73
+ integrations.push(timeToDisplayIntegration());
74
+ }
71
75
  if (options.enableCaptureFailedRequests) {
72
76
  integrations.push(httpClientIntegration());
73
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAEnB;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAiC;IACtE,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,IAAI,MAAM,EAAE,EAAE;QACZ,YAAY,CAAC,IAAI,CACf,mCAAmC,CAAC;YAClC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;SAC/C,CAAC,CACH,CAAC;QACF,YAAY,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,CAAC;KACpD;SAAM;QACL,YAAY,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,CAAC;QACjD,YAAY,CAAC,IAAI,CAAC,gCAAgC,EAAE,CAAC,CAAC;Q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AQ,IAAI,OAAO,OAAO,CAAC,wBAAwB,KAAK,QAAQ,CAAC;IAC/G,MAAM,2BAA2B,GAC/B,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,CAAC;IAE9F,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,EAAE;QACpD,wCAAwC;QACxC,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;QACjF,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;KAClF;IAED,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,CAAC,IAAI,MAAM,EAAE,EAAE;QACjE,0FAA0F;QAC1F,yFAAyF;QACzF,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,EAAE;QACvB,YAAY,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,CAAC;KACnD;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Integration } from '@sentry/core';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n createNativeFramesIntegrations,\n createReactNativeRewriteFrames,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (typeof options.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking) {\n integrations.push(appStartIntegration());\n }\n const nativeFramesIntegrationInstance = createNativeFramesIntegrations(\n hasTracingEnabled && options.enableNativeFramesTracking,\n );\n if (nativeFramesIntegrationInstance) {\n integrations.push(nativeFramesIntegrationInstance);\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(reactNativeTracingIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.spotlight) {\n const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n const hasReplayOptions =\n typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';\n const hasExperimentsReplayOptions =\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');\n\n if (!hasReplayOptions && hasExperimentsReplayOptions) {\n // Remove in the next major version (v7)\n options.replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n options.replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n\n if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {\n // We can't create and add browserReplayIntegration as it overrides the users supplied one\n // The browser replay integration works differently than the rest of default integrations\n integrations.push(mobileReplayIntegration());\n }\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n return integrations;\n}\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAA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,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,CAAC;IAE9F,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,EAAE;QACpD,wCAAwC;QACxC,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;QACjF,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;KAClF;IAED,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,CAAC,IAAI,MAAM,EAAE,EAAE;QACjE,0FAA0F;QAC1F,yFAAyF;QACzF,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,EAAE;QACvB,YAAY,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,CAAC;KACnD;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Integration } from '@sentry/core';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n appRegistryIntegration,\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n createNativeFramesIntegrations,\n createReactNativeRewriteFrames,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n timeToDisplayIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (typeof options.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking) {\n integrations.push(appStartIntegration());\n }\n const nativeFramesIntegrationInstance = createNativeFramesIntegrations(\n hasTracingEnabled && options.enableNativeFramesTracking,\n );\n if (nativeFramesIntegrationInstance) {\n integrations.push(nativeFramesIntegrationInstance);\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(appRegistryIntegration());\n integrations.push(reactNativeTracingIntegration());\n }\n if (hasTracingEnabled) {\n integrations.push(timeToDisplayIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.spotlight) {\n const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n const hasReplayOptions =\n typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';\n const hasExperimentsReplayOptions =\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');\n\n if (!hasReplayOptions && hasExperimentsReplayOptions) {\n // Remove in the next major version (v7)\n options.replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n options.replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n\n if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {\n // We can't create and add browserReplayIntegration as it overrides the users supplied one\n // The browser replay integration works differently than the rest of default integrations\n integrations.push(mobileReplayIntegration());\n }\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n return integrations;\n}\n"]}
@@ -20,5 +20,7 @@ export { nativeFramesIntegration, createNativeFramesIntegrations } from '../trac
20
20
  export { stallTrackingIntegration } from '../tracing/integrations/stalltracking';
21
21
  export { userInteractionIntegration } from '../tracing/integrations/userInteraction';
22
22
  export { createReactNativeRewriteFrames } from './rewriteframes';
23
+ export { appRegistryIntegration } from './appRegistry';
24
+ export { timeToDisplayIntegration } from '../tracing/integrations/timeToDisplayIntegration';
23
25
  export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, } from '@sentry/react';
24
26
  //# sourceMappingURL=exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,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AAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAC/G,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAE5F,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,GACzB,MAAM,eAAe,CAAC"}
@@ -20,5 +20,7 @@ export { nativeFramesIntegration, createNativeFramesIntegrations } from '../trac
20
20
  export { stallTrackingIntegration } from '../tracing/integrations/stalltracking';
21
21
  export { userInteractionIntegration } from '../tracing/integrations/userInteraction';
22
22
  export { createReactNativeRewriteFrames } from './rewriteframes';
23
+ export { appRegistryIntegration } from './appRegistry';
24
+ export { timeToDisplayIntegration } from '../tracing/integrations/timeToDisplayIntegration';
23
25
  export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, } from '@sentry/react';
24
26
  //# sourceMappingURL=exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAC/G,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,GACzB,MAAM,eAAe,CAAC","sourcesContent":["export { debugSymbolicatorIntegration } from './debugsymbolicator';\nexport { deviceContextIntegration } from './devicecontext';\nexport { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';\nexport { nativeLinkedErrorsIntegration } from './nativelinkederrors';\nexport { nativeReleaseIntegration } from './release';\nexport { eventOriginIntegration } from './eventorigin';\nexport { sdkInfoIntegration } from './sdkinfo';\nexport { reactNativeInfoIntegration } from './reactnativeinfo';\nexport { modulesLoaderIntegration } from './modulesloader';\nexport { hermesProfilingIntegration } from '../profiling/integration';\nexport { screenshotIntegration } from './screenshot';\nexport { viewHierarchyIntegration } from './viewhierarchy';\nexport { expoContextIntegration } from './expocontext';\nexport { spotlightIntegration } from './spotlight';\nexport { mobileReplayIntegration } from '../replay/mobilereplay';\nexport { feedbackIntegration } from '../feedback/integration';\nexport { browserReplayIntegration } from '../replay/browserReplay';\nexport { appStartIntegration } from '../tracing/integrations/appStart';\nexport { nativeFramesIntegration, createNativeFramesIntegrations } from '../tracing/integrations/nativeFrames';\nexport { stallTrackingIntegration } from '../tracing/integrations/stalltracking';\nexport { userInteractionIntegration } from '../tracing/integrations/userInteraction';\nexport { createReactNativeRewriteFrames } from './rewriteframes';\n\nexport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n globalHandlersIntegration as browserGlobalHandlersIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n linkedErrorsIntegration as browserLinkedErrorsIntegration,\n rewriteFramesIntegration,\n} from '@sentry/react';\n"]}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAC/G,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAE5F,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,GACzB,MAAM,eAAe,CAAC","sourcesContent":["export { debugSymbolicatorIntegration } from './debugsymbolicator';\nexport { deviceContextIntegration } from './devicecontext';\nexport { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';\nexport { nativeLinkedErrorsIntegration } from './nativelinkederrors';\nexport { nativeReleaseIntegration } from './release';\nexport { eventOriginIntegration } from './eventorigin';\nexport { sdkInfoIntegration } from './sdkinfo';\nexport { reactNativeInfoIntegration } from './reactnativeinfo';\nexport { modulesLoaderIntegration } from './modulesloader';\nexport { hermesProfilingIntegration } from '../profiling/integration';\nexport { screenshotIntegration } from './screenshot';\nexport { viewHierarchyIntegration } from './viewhierarchy';\nexport { expoContextIntegration } from './expocontext';\nexport { spotlightIntegration } from './spotlight';\nexport { mobileReplayIntegration } from '../replay/mobilereplay';\nexport { feedbackIntegration } from '../feedback/integration';\nexport { browserReplayIntegration } from '../replay/browserReplay';\nexport { appStartIntegration } from '../tracing/integrations/appStart';\nexport { nativeFramesIntegration, createNativeFramesIntegrations } from '../tracing/integrations/nativeFrames';\nexport { stallTrackingIntegration } from '../tracing/integrations/stalltracking';\nexport { userInteractionIntegration } from '../tracing/integrations/userInteraction';\nexport { createReactNativeRewriteFrames } from './rewriteframes';\nexport { appRegistryIntegration } from './appRegistry';\nexport { timeToDisplayIntegration } from '../tracing/integrations/timeToDisplayIntegration';\n\nexport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n globalHandlersIntegration as browserGlobalHandlersIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n linkedErrorsIntegration as browserLinkedErrorsIntegration,\n rewriteFramesIntegration,\n} from '@sentry/react';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,WAAW,EAAQ,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,kBAAkB,EAAgB,MAAM,SAAS,CAAC;AAYnH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAMD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,sBAAsB,KAAoB,WAyMjG,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOxE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,uBAAuB,EAAE,MAAM,GAC9B,oBAAoB,GAAG,2BAA2B,GAAG,IAAI,CAyB3D;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,yBAAyB,EACxC,UAAU,EAAE,MAAM,GACjB,2BAA2B,CAQ7B;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
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,WAAW,EAAQ,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,kBAAkB,EAAgB,MAAM,SAAS,CAAC;AAYnH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAMD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,sBAAsB,KAAoB,WAyMjG,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOxE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,uBAAuB,EAAE,MAAM,GAC9B,oBAAoB,GAAG,2BAA2B,GAAG,IAAI,CAyB3D;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,yBAAyB,EACxC,UAAU,EAAE,MAAM,GACjB,2BAA2B,CAQ7B;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,kBAAkB,GACzB,oBAAoB,CAOtB;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"}
@@ -219,9 +219,8 @@ export function createAndroidWithHermesProfile(hermes, nativeAndroid, durationNs
219
219
  * Merges Hermes and Native profile events into one.
220
220
  */
221
221
  export function addNativeProfileToHermesProfile(hermes, native) {
222
- return Object.assign(Object.assign({}, hermes), { profile: addNativeThreadCpuProfileToHermes(hermes.profile, native.profile, hermes.transaction.active_thread_id), debug_meta: {
223
- images: native.debug_meta.images,
224
- }, measurements: native.measurements });
222
+ var _a;
223
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, hermes), { profile: addNativeThreadCpuProfileToHermes(hermes.profile, native.profile, hermes.transaction.active_thread_id) }), (((_a = native.debug_meta) === null || _a === void 0 ? void 0 : _a.images) ? { debug_meta: { images: native.debug_meta.images } } : {})), { measurements: native.measurements });
225
224
  }
226
225
  /**
227
226
  * Merges Hermes And Native profiles into one.
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,MAAM,QAAQ,GAAW,GAAG,CAAC;AAW7B,MAAM,cAAc,GAAqC;IACvD,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF;;;;GAIG;AAC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C;IAC7C,MAAM,YAAY,GAAG,MAAM,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 { Envelope, Event, Integration, Span, ThreadCpuProfile } from '@sentry/core';\nimport { getActiveSpan, getClient, logger, spanIsSampled, uuid4 } from '@sentry/core';\nimport { Platform } from 'react-native';\n\nimport type { ReactNativeClient } from '../client';\nimport { isHermesEnabled } from '../utils/environment';\nimport { isRootSpan } from '../utils/span';\nimport { NATIVE } from '../wrapper';\nimport { PROFILE_QUEUE } from './cache';\nimport { MAX_PROFILE_DURATION_MS } from './constants';\nimport { convertToSentryProfile } from './convertHermesProfile';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './nativeTypes';\nimport type { AndroidCombinedProfileEvent, CombinedProfileEvent, HermesProfileEvent, ProfileEvent } from './types';\nimport {\n addProfilesToEnvelope,\n createHermesProfilingEvent,\n enrichCombinedProfileWithEventContext,\n findProfiledTransactionsFromEnvelope,\n} from './utils';\n\nconst INTEGRATION_NAME = 'HermesProfiling';\n\nconst MS_TO_NS: number = 1e6;\n\nexport interface HermesProfilingOptions {\n /**\n * Enable or disable profiling of native (iOS and Android) threads\n *\n * @default true\n */\n platformProfilers?: boolean;\n}\n\nconst defaultOptions: Required<HermesProfilingOptions> = {\n platformProfilers: true,\n};\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @experimental\n */\nexport const hermesProfilingIntegration = (initOptions: HermesProfilingOptions = defaultOptions): Integration => {\n const usePlatformProfilers = initOptions.platformProfilers ?? true;\n let _currentProfile:\n | {\n span_id: string;\n profile_id: string;\n startTimestampNs: number;\n }\n | undefined;\n let _currentProfileTimeout: ReturnType<typeof setTimeout> | undefined;\n let isReady: boolean = false;\n\n const setupOnce = (): void => {\n if (isReady) {\n return;\n }\n isReady = true;\n\n if (!isHermesEnabled()) {\n logger.log('[Profiling] Hermes is not enabled, not adding profiling integration.');\n return;\n }\n\n const client = getClient();\n\n if (!client || typeof client.on !== 'function') {\n return;\n }\n\n _startCurrentProfileForActiveTransaction();\n client.on('spanStart', _startCurrentProfile);\n\n client.on('spanEnd', _finishCurrentProfileForSpan);\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: ProfileEvent[] = [];\n for (const profiledTransaction of profiledTransactions) {\n const profile = _createProfileEventFor(profiledTransaction);\n if (profile) {\n profilesToAddToEnvelope.push(profile);\n }\n }\n addProfilesToEnvelope(envelope, profilesToAddToEnvelope);\n });\n };\n\n const _startCurrentProfileForActiveTransaction = (): void => {\n if (_currentProfile) {\n return;\n }\n const activeSpan = getActiveSpan();\n activeSpan && _startCurrentProfile(activeSpan);\n };\n\n const _startCurrentProfile = (activeSpan: Span): void => {\n if (!isRootSpan(activeSpan)) {\n return;\n }\n\n _finishCurrentProfile();\n\n const shouldStartProfiling = _shouldStartProfiling(activeSpan);\n if (!shouldStartProfiling) {\n return;\n }\n\n _currentProfileTimeout = setTimeout(_finishCurrentProfile, MAX_PROFILE_DURATION_MS);\n _startNewProfile(activeSpan);\n };\n\n const _shouldStartProfiling = (activeSpan: Span): boolean => {\n if (!spanIsSampled(activeSpan)) {\n logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n return false;\n }\n\n const client = getClient<ReactNativeClient>();\n const options = client && client.getOptions();\n\n const profilesSampleRate =\n options && typeof options.profilesSampleRate === 'number' ? options.profilesSampleRate : 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 const _startNewProfile = (activeSpan: Span): void => {\n const profileStartTimestampNs = startProfiling(usePlatformProfilers);\n if (!profileStartTimestampNs) {\n return;\n }\n\n _currentProfile = {\n span_id: activeSpan.spanContext().spanId,\n profile_id: uuid4(),\n startTimestampNs: profileStartTimestampNs,\n };\n activeSpan.setAttribute('profile_id', _currentProfile.profile_id);\n logger.log('[Profiling] started profiling: ', _currentProfile.profile_id);\n };\n\n /**\n * Stops current profile if the ending span is the currently profiled span.\n */\n const _finishCurrentProfileForSpan = (span: Span): void => {\n if (!isRootSpan(span)) {\n return;\n }\n\n if (span.spanContext().spanId !== _currentProfile?.span_id) {\n logger.log(\n `[Profiling] Span (${span.spanContext().spanId}) ended is not the currently profiled span (${\n _currentProfile?.span_id\n }). Not stopping profiling.`,\n );\n return;\n }\n\n _finishCurrentProfile();\n };\n\n /**\n * Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.\n */\n const _finishCurrentProfile = (): void => {\n _clearCurrentProfileTimeout();\n if (_currentProfile === undefined) {\n return;\n }\n\n const profile = stopProfiling(_currentProfile.startTimestampNs);\n if (!profile) {\n logger.warn('[Profiling] Stop failed. Cleaning up...');\n _currentProfile = undefined;\n return;\n }\n\n PROFILE_QUEUE.add(_currentProfile.profile_id, profile);\n\n logger.log('[Profiling] finished profiling: ', _currentProfile.profile_id);\n _currentProfile = undefined;\n };\n\n const _createProfileEventFor = (profiledTransaction: Event): ProfileEvent | null => {\n const profile_id = profiledTransaction?.contexts?.trace?.data?.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?.trace?.data?.profile_id) {\n delete profiledTransaction.contexts.trace.data.profile_id;\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 const _clearCurrentProfileTimeout = (): void => {\n _currentProfileTimeout !== undefined && clearTimeout(_currentProfileTimeout);\n _currentProfileTimeout = undefined;\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce,\n };\n};\n\n/**\n * Starts Profilers and returns the timestamp when profiling started in nanoseconds.\n */\nexport function startProfiling(platformProfilers: boolean): number | null {\n const started = NATIVE.startProfiling(platformProfilers);\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(\n profileStartTimestampNs: number,\n): CombinedProfileEvent | AndroidCombinedProfileEvent | null {\n const collectedProfiles = NATIVE.stopProfiling();\n if (!collectedProfiles) {\n return null;\n }\n const profileEndTimestampNs = Date.now() * MS_TO_NS;\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.androidProfile) {\n const durationNs = profileEndTimestampNs - profileStartTimestampNs;\n return createAndroidWithHermesProfile(hermesProfileEvent, collectedProfiles.androidProfile, durationNs);\n } else if (collectedProfiles.nativeProfile) {\n return addNativeProfileToHermesProfile(hermesProfileEvent, collectedProfiles.nativeProfile);\n }\n\n return hermesProfileEvent;\n}\n\n/**\n * Creates Android profile event with attached javascript profile.\n */\nexport function createAndroidWithHermesProfile(\n hermes: HermesProfileEvent,\n nativeAndroid: NativeAndroidProfileEvent,\n durationNs: number,\n): AndroidCombinedProfileEvent {\n return {\n ...nativeAndroid,\n platform: 'android',\n js_profile: hermes.profile,\n duration_ns: durationNs.toString(10),\n active_thread_id: hermes.transaction.active_thread_id,\n };\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"]}
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,O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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 { Envelope, Event, Integration, Span, ThreadCpuProfile } from '@sentry/core';\nimport { getActiveSpan, getClient, logger, spanIsSampled, uuid4 } from '@sentry/core';\nimport { Platform } from 'react-native';\n\nimport type { ReactNativeClient } from '../client';\nimport { isHermesEnabled } from '../utils/environment';\nimport { isRootSpan } from '../utils/span';\nimport { NATIVE } from '../wrapper';\nimport { PROFILE_QUEUE } from './cache';\nimport { MAX_PROFILE_DURATION_MS } from './constants';\nimport { convertToSentryProfile } from './convertHermesProfile';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './nativeTypes';\nimport type { AndroidCombinedProfileEvent, CombinedProfileEvent, HermesProfileEvent, ProfileEvent } from './types';\nimport {\n addProfilesToEnvelope,\n createHermesProfilingEvent,\n enrichCombinedProfileWithEventContext,\n findProfiledTransactionsFromEnvelope,\n} from './utils';\n\nconst INTEGRATION_NAME = 'HermesProfiling';\n\nconst MS_TO_NS: number = 1e6;\n\nexport interface HermesProfilingOptions {\n /**\n * Enable or disable profiling of native (iOS and Android) threads\n *\n * @default true\n */\n platformProfilers?: boolean;\n}\n\nconst defaultOptions: Required<HermesProfilingOptions> = {\n platformProfilers: true,\n};\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @experimental\n */\nexport const hermesProfilingIntegration = (initOptions: HermesProfilingOptions = defaultOptions): Integration => {\n const usePlatformProfilers = initOptions.platformProfilers ?? true;\n let _currentProfile:\n | {\n span_id: string;\n profile_id: string;\n startTimestampNs: number;\n }\n | undefined;\n let _currentProfileTimeout: ReturnType<typeof setTimeout> | undefined;\n let isReady: boolean = false;\n\n const setupOnce = (): void => {\n if (isReady) {\n return;\n }\n isReady = true;\n\n if (!isHermesEnabled()) {\n logger.log('[Profiling] Hermes is not enabled, not adding profiling integration.');\n return;\n }\n\n const client = getClient();\n\n if (!client || typeof client.on !== 'function') {\n return;\n }\n\n _startCurrentProfileForActiveTransaction();\n client.on('spanStart', _startCurrentProfile);\n\n client.on('spanEnd', _finishCurrentProfileForSpan);\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: ProfileEvent[] = [];\n for (const profiledTransaction of profiledTransactions) {\n const profile = _createProfileEventFor(profiledTransaction);\n if (profile) {\n profilesToAddToEnvelope.push(profile);\n }\n }\n addProfilesToEnvelope(envelope, profilesToAddToEnvelope);\n });\n };\n\n const _startCurrentProfileForActiveTransaction = (): void => {\n if (_currentProfile) {\n return;\n }\n const activeSpan = getActiveSpan();\n activeSpan && _startCurrentProfile(activeSpan);\n };\n\n const _startCurrentProfile = (activeSpan: Span): void => {\n if (!isRootSpan(activeSpan)) {\n return;\n }\n\n _finishCurrentProfile();\n\n const shouldStartProfiling = _shouldStartProfiling(activeSpan);\n if (!shouldStartProfiling) {\n return;\n }\n\n _currentProfileTimeout = setTimeout(_finishCurrentProfile, MAX_PROFILE_DURATION_MS);\n _startNewProfile(activeSpan);\n };\n\n const _shouldStartProfiling = (activeSpan: Span): boolean => {\n if (!spanIsSampled(activeSpan)) {\n logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n return false;\n }\n\n const client = getClient<ReactNativeClient>();\n const options = client && client.getOptions();\n\n const profilesSampleRate =\n options && typeof options.profilesSampleRate === 'number' ? options.profilesSampleRate : 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 const _startNewProfile = (activeSpan: Span): void => {\n const profileStartTimestampNs = startProfiling(usePlatformProfilers);\n if (!profileStartTimestampNs) {\n return;\n }\n\n _currentProfile = {\n span_id: activeSpan.spanContext().spanId,\n profile_id: uuid4(),\n startTimestampNs: profileStartTimestampNs,\n };\n activeSpan.setAttribute('profile_id', _currentProfile.profile_id);\n logger.log('[Profiling] started profiling: ', _currentProfile.profile_id);\n };\n\n /**\n * Stops current profile if the ending span is the currently profiled span.\n */\n const _finishCurrentProfileForSpan = (span: Span): void => {\n if (!isRootSpan(span)) {\n return;\n }\n\n if (span.spanContext().spanId !== _currentProfile?.span_id) {\n logger.log(\n `[Profiling] Span (${span.spanContext().spanId}) ended is not the currently profiled span (${\n _currentProfile?.span_id\n }). Not stopping profiling.`,\n );\n return;\n }\n\n _finishCurrentProfile();\n };\n\n /**\n * Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.\n */\n const _finishCurrentProfile = (): void => {\n _clearCurrentProfileTimeout();\n if (_currentProfile === undefined) {\n return;\n }\n\n const profile = stopProfiling(_currentProfile.startTimestampNs);\n if (!profile) {\n logger.warn('[Profiling] Stop failed. Cleaning up...');\n _currentProfile = undefined;\n return;\n }\n\n PROFILE_QUEUE.add(_currentProfile.profile_id, profile);\n\n logger.log('[Profiling] finished profiling: ', _currentProfile.profile_id);\n _currentProfile = undefined;\n };\n\n const _createProfileEventFor = (profiledTransaction: Event): ProfileEvent | null => {\n const profile_id = profiledTransaction?.contexts?.trace?.data?.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?.trace?.data?.profile_id) {\n delete profiledTransaction.contexts.trace.data.profile_id;\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 const _clearCurrentProfileTimeout = (): void => {\n _currentProfileTimeout !== undefined && clearTimeout(_currentProfileTimeout);\n _currentProfileTimeout = undefined;\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce,\n };\n};\n\n/**\n * Starts Profilers and returns the timestamp when profiling started in nanoseconds.\n */\nexport function startProfiling(platformProfilers: boolean): number | null {\n const started = NATIVE.startProfiling(platformProfilers);\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(\n profileStartTimestampNs: number,\n): CombinedProfileEvent | AndroidCombinedProfileEvent | null {\n const collectedProfiles = NATIVE.stopProfiling();\n if (!collectedProfiles) {\n return null;\n }\n const profileEndTimestampNs = Date.now() * MS_TO_NS;\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.androidProfile) {\n const durationNs = profileEndTimestampNs - profileStartTimestampNs;\n return createAndroidWithHermesProfile(hermesProfileEvent, collectedProfiles.androidProfile, durationNs);\n } else if (collectedProfiles.nativeProfile) {\n return addNativeProfileToHermesProfile(hermesProfileEvent, collectedProfiles.nativeProfile);\n }\n\n return hermesProfileEvent;\n}\n\n/**\n * Creates Android profile event with attached javascript profile.\n */\nexport function createAndroidWithHermesProfile(\n hermes: HermesProfileEvent,\n nativeAndroid: NativeAndroidProfileEvent,\n durationNs: number,\n): AndroidCombinedProfileEvent {\n return {\n ...nativeAndroid,\n platform: 'android',\n js_profile: hermes.profile,\n duration_ns: durationNs.toString(10),\n active_thread_id: hermes.transaction.active_thread_id,\n };\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 ...(native.debug_meta?.images ? { debug_meta: { images: native.debug_meta.images } } : {}),\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"]}
@@ -30,7 +30,7 @@ export interface NativeProfileEvent {
30
30
  }[];
31
31
  unit: string;
32
32
  }>;
33
- debug_meta: {
33
+ debug_meta?: {
34
34
  images: {
35
35
  type: 'macho';
36
36
  debug_id: string;
@@ -1 +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;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
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,CAAC,EAAE;QACX,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;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +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\nexport interface NativeAndroidProfileEvent {\n sampled_profile: string;\n android_api_level: number;\n /**\n * Proguard mapping file hash\n */\n build_id?: string;\n}\n"]}
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\nexport interface NativeAndroidProfileEvent {\n sampled_profile: string;\n android_api_level: number;\n /**\n * Proguard mapping file hash\n */\n build_id?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomMask.d.ts","sourceRoot":"","sources":["../../../src/js/replay/CustomMask.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAsB7D,QAAA,MAAM,YAAY,cAAe,SAAS,KAAG,MAAM,YAGlD,CAAC;AAEF,QAAA,MAAM,cAAc,cAAe,SAAS,KAAG,MAAM,YAGpD,CAAC;AAIF,QAAA,MAAM,IAAI,2DAWN,CAAA;AAEJ,QAAA,MAAM,MAAM,2DAWR,CAAC;AAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"CustomMask.d.ts","sourceRoot":"","sources":["../../../src/js/replay/CustomMask.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAwB7D,QAAA,MAAM,YAAY,cAAe,SAAS,KAAG,MAAM,YAGlD,CAAC;AAEF,QAAA,MAAM,cAAc,cAAe,SAAS,KAAG,MAAM,YAGpD,CAAC;AAIF,QAAA,MAAM,IAAI,2DAWN,CAAA;AAEJ,QAAA,MAAM,MAAM,2DAWR,CAAC;AAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { logger } from '@sentry/core';
2
2
  import * as React from 'react';
3
3
  import { UIManager, View } from 'react-native';
4
+ import { isExpoGo } from '../utils/environment';
4
5
  const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
5
6
  const MaskNativeComponentName = 'RNSentryReplayMask';
6
7
  const UnmaskNativeComponentName = 'RNSentryReplayUnmask';
@@ -23,7 +24,7 @@ const UnmaskFallback = (viewProps) => {
23
24
  };
24
25
  const hasViewManagerConfig = (nativeComponentName) => UIManager.hasViewManagerConfig && UIManager.hasViewManagerConfig(nativeComponentName);
25
26
  const Mask = (() => {
26
- if (!hasViewManagerConfig(MaskNativeComponentName)) {
27
+ if (isExpoGo() || !hasViewManagerConfig(MaskNativeComponentName)) {
27
28
  logger.warn(`[SentrySessionReplay] Can't load ${MaskNativeComponentName}.`);
28
29
  return MaskFallback;
29
30
  }
@@ -34,7 +35,7 @@ const Mask = (() => {
34
35
  }));
35
36
  })();
36
37
  const Unmask = (() => {
37
- if (!hasViewManagerConfig(UnmaskNativeComponentName)) {
38
+ if (isExpoGo() || !hasViewManagerConfig(UnmaskNativeComponentName)) {
38
39
  logger.warn(`[SentrySessionReplay] Can't load ${UnmaskNativeComponentName}.`);
39
40
  return UnmaskFallback;
40
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomMask.js","sourceRoot":"","sources":["../../../src/js/replay/CustomMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,uBAAuB,GAGzB,OAAO,CAAC,gEAAgE,CAAC,CAAC;AAE9E,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAEzD,MAAM,WA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AyB,CAAC,EAAE;QACpD,MAAM,CAAC,IAAI,CAAC,oCAAoC,yBAAyB,GAAG,CAAC,CAAC;QAC9E,OAAO,cAAc,CAAC;KACvB;IAED,qDAAqD;IACrD,8KAA8K;IAC9K,OAAO,uBAAuB,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAAC;QACnE,eAAe,EAAE,yBAAyB;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport * as React from 'react';\nimport type { HostComponent, ViewProps } from 'react-native';\nimport { UIManager, View } from 'react-native';\n\nconst NativeComponentRegistry: {\n get<T, C extends Record<string, unknown>>(componentName: string, createViewConfig: () => C): HostComponent<T>;\n// eslint-disable-next-line @typescript-eslint/no-var-requires\n} = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\n\nconst MaskNativeComponentName = 'RNSentryReplayMask';\nconst UnmaskNativeComponentName = 'RNSentryReplayUnmask';\n\nconst warnMessage = (component: string): string => `[SentrySessionReplay] ${component} component is not supported on the current platform. If ${component} should be supported, please ensure that the application build is up to date.`;\n\nconst warn = (component: string): void => {\n setTimeout(() => {\n // Missing mask component could cause leaking PII, we have to ensure that the warning is visible\n // even if the app is running without debug.\n // eslint-disable-next-line no-console\n console.warn(warnMessage(component));\n }, 0);\n};\n\nconst MaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Mask');\n return <View {...viewProps} />;\n};\n\nconst UnmaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Unmask');\n return <View {...viewProps} />;\n};\n\nconst hasViewManagerConfig = (nativeComponentName: string): boolean => UIManager.hasViewManagerConfig && UIManager.hasViewManagerConfig(nativeComponentName);\n\nconst Mask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (!hasViewManagerConfig(MaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${MaskNativeComponentName}.`);\n return MaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(MaskNativeComponentName, () => ({\n uiViewClassName: MaskNativeComponentName,\n }));\n})()\n\nconst Unmask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (!hasViewManagerConfig(UnmaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${UnmaskNativeComponentName}.`);\n return UnmaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(UnmaskNativeComponentName, () => ({\n uiViewClassName: UnmaskNativeComponentName,\n }));\n})();\n\nexport { Mask, Unmask, MaskFallback, UnmaskFallback };\n"]}
1
+ {"version":3,"file":"CustomMask.js","sourceRoot":"","sources":["../../../src/js/replay/CustomMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,uBAAuB,GAGzB,OAAO,CAAC,gEAAgE,CAAC,CAAC;AAE9E,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAEzD,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAU,EAAE,CAAC,yBAAyB,SAAS,2DAA2D,SAAS,+EAA+E,CAAC;AAEzO,MAAM,IAAI,GAAG,C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AC,CAAC;QAC9E,OAAO,cAAc,CAAC;KACvB;IAED,qDAAqD;IACrD,8KAA8K;IAC9K,OAAO,uBAAuB,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAAC;QACnE,eAAe,EAAE,yBAAyB;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport * as React from 'react';\nimport type { HostComponent, ViewProps } from 'react-native';\nimport { UIManager, View } from 'react-native';\n\nimport { isExpoGo } from '../utils/environment';\n\nconst NativeComponentRegistry: {\n get<T, C extends Record<string, unknown>>(componentName: string, createViewConfig: () => C): HostComponent<T>;\n// eslint-disable-next-line @typescript-eslint/no-var-requires\n} = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\n\nconst MaskNativeComponentName = 'RNSentryReplayMask';\nconst UnmaskNativeComponentName = 'RNSentryReplayUnmask';\n\nconst warnMessage = (component: string): string => `[SentrySessionReplay] ${component} component is not supported on the current platform. If ${component} should be supported, please ensure that the application build is up to date.`;\n\nconst warn = (component: string): void => {\n setTimeout(() => {\n // Missing mask component could cause leaking PII, we have to ensure that the warning is visible\n // even if the app is running without debug.\n // eslint-disable-next-line no-console\n console.warn(warnMessage(component));\n }, 0);\n};\n\nconst MaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Mask');\n return <View {...viewProps} />;\n};\n\nconst UnmaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Unmask');\n return <View {...viewProps} />;\n};\n\nconst hasViewManagerConfig = (nativeComponentName: string): boolean => UIManager.hasViewManagerConfig && UIManager.hasViewManagerConfig(nativeComponentName);\n\nconst Mask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (isExpoGo() || !hasViewManagerConfig(MaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${MaskNativeComponentName}.`);\n return MaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(MaskNativeComponentName, () => ({\n uiViewClassName: MaskNativeComponentName,\n }));\n})()\n\nconst Unmask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (isExpoGo() || !hasViewManagerConfig(UnmaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${UnmaskNativeComponentName}.`);\n return UnmaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(UnmaskNativeComponentName, () => ({\n uiViewClassName: UnmaskNativeComponentName,\n }));\n})();\n\nexport { Mask, Unmask, MaskFallback, UnmaskFallback };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"appStart.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,WAAW,EAAoC,MAAM,cAAc,CAAC;AAgCjG,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C,yBAAyB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD,CAAC;AAqBF;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAUzF;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAM7E;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAG9E;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,gBAAiB,MAAM,KAAG,IAGhE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sCAAsC,IAAI,IAAI,CAE7D;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAG9B;;;;;OAKG;iBACU,OAAO;MACb,mBA6OR,CAAC"}
1
+ {"version":3,"file":"appStart.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,WAAW,EAAoC,MAAM,cAAc,CAAC;AAiCjG,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C,yBAAyB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD,CAAC;AAqBF;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAUzF;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAM7E;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAG9E;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,gBAAiB,MAAM,KAAG,IAGhE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sCAAsC,IAAI,IAAI,CAE7D;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAG9B;;;;;OAKG;iBACU,OAAO;MACb,mBA0QR,CAAC"}
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { getCapturedScopesOnSpan, getClient, getCurrentScope, logger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SentryNonRecordingSpan, startInactiveSpan, timestampInSeconds, } from '@sentry/core';
11
+ import { getAppRegistryIntegration } from '../../integrations/appRegistry';
11
12
  import { APP_START_COLD as APP_START_COLD_MEASUREMENT, APP_START_WARM as APP_START_WARM_MEASUREMENT, } from '../../measurements';
12
13
  import { convertSpanToTransaction, isRootSpan, setEndTimeValue } from '../../utils/span';
13
14
  import { NATIVE } from '../../wrapper';
@@ -100,6 +101,7 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
100
101
  let _client = undefined;
101
102
  let isEnabled = true;
102
103
  let appStartDataFlushed = false;
104
+ let afterAllSetupCalled = false;
103
105
  let firstStartedActiveRootSpanId = undefined;
104
106
  const setup = (client) => {
105
107
  _client = client;
@@ -110,8 +112,23 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
110
112
  }
111
113
  client.on('spanStart', recordFirstStartedActiveRootSpanId);
112
114
  };
113
- const afterAllSetup = (_client) => {
115
+ const afterAllSetup = (client) => {
116
+ var _a;
117
+ if (afterAllSetupCalled) {
118
+ return;
119
+ }
120
+ afterAllSetupCalled = true;
114
121
  // TODO: automatically set standalone based on the presence of the native layer navigation integration
122
+ (_a = getAppRegistryIntegration(client)) === null || _a === void 0 ? void 0 : _a.onRunApplication(() => {
123
+ if (appStartDataFlushed) {
124
+ logger.log('[AppStartIntegration] Resetting app start data flushed flag based on runApplication call.');
125
+ appStartDataFlushed = false;
126
+ firstStartedActiveRootSpanId = undefined;
127
+ }
128
+ else {
129
+ logger.log('[AppStartIntegration] Waiting for initial app start was flush, before updating based on runApplication call.');
130
+ }
131
+ });
115
132
  };
116
133
  const processEvent = (event) => __awaiter(void 0, void 0, void 0, function* () {
117
134
  if (!isEnabled || standalone) {
@@ -176,7 +193,7 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
176
193
  function attachAppStartToTransactionEvent(event) {
177
194
  return __awaiter(this, void 0, void 0, function* () {
178
195
  if (appStartDataFlushed) {
179
- // App start data is only relevant for the first transaction
196
+ // App start data is only relevant for the first transaction of the app run
180
197
  return;
181
198
  }
182
199
  if (!firstStartedActiveRootSpanId) {
@@ -210,7 +227,7 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
210
227
  logger.warn('[AppStart] Javascript failed to record app start end. `setAppStartEndTimestampMs` was not called nor could the bundle start be found.');
211
228
  return;
212
229
  }
213
- const isAppStartWithinBounds = !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp - MAX_APP_START_AGE_MS;
230
+ const isAppStartWithinBounds = !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp * 1000 - MAX_APP_START_AGE_MS;
214
231
  if (!__DEV__ && !isAppStartWithinBounds) {
215
232
  logger.warn('[AppStart] App start timestamp is too far in the past to be used for app start span.');
216
233
  return;
@@ -221,6 +238,13 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
221
238
  logger.warn('[AppStart] App start duration is over a minute long, not adding app start span.');
222
239
  return;
223
240
  }
241
+ if (appStartDurationMs < 0) {
242
+ // This can happen when MainActivity on Android is recreated,
243
+ // and the app start end timestamp is not updated, for example
244
+ // due to missing `Sentry.wrap(RootComponent)` call.
245
+ logger.warn('[AppStart] Last recorded app start end timestamp is before the app start timestamp.', 'This is usually caused by missing `Sentry.wrap(RootComponent)` call.');
246
+ return;
247
+ }
224
248
  appStartDataFlushed = true;
225
249
  event.contexts.trace.data = event.contexts.trace.data || {};
226
250
  event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_OP] = UI_LOAD_OP;
@@ -304,18 +328,23 @@ function createJSExecutionStartSpan(parentSpan, rootComponentCreationTimestampMs
304
328
  if (!bundleStartTimestampMs) {
305
329
  return undefined;
306
330
  }
331
+ const bundleStartTimestampSeconds = bundleStartTimestampMs / 1000;
332
+ if (bundleStartTimestampSeconds < parentSpan.start_timestamp) {
333
+ logger.warn('Bundle start timestamp is before the app start span start timestamp. Skipping JS execution span.');
334
+ return undefined;
335
+ }
307
336
  if (!rootComponentCreationTimestampMs) {
308
337
  logger.warn('Missing the root component first constructor call timestamp.');
309
338
  return createChildSpanJSON(parentSpan, {
310
339
  description: 'JS Bundle Execution Start',
311
- start_timestamp: bundleStartTimestampMs / 1000,
312
- timestamp: bundleStartTimestampMs / 1000,
340
+ start_timestamp: bundleStartTimestampSeconds,
341
+ timestamp: bundleStartTimestampSeconds,
313
342
  origin: SPAN_ORIGIN_AUTO_APP_START,
314
343
  });
315
344
  }
316
345
  return createChildSpanJSON(parentSpan, {
317
346
  description: 'JS Bundle Execution Before React Root',
318
- start_timestamp: bundleStartTimestampMs / 1000,
347
+ start_timestamp: bundleStartTimestampSeconds,
319
348
  timestamp: rootComponentCreationTimestampMs / 1000,
320
349
  origin: isRootComponentCreationTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START,
321
350
  });
@@ -324,7 +353,9 @@ function createJSExecutionStartSpan(parentSpan, rootComponentCreationTimestampMs
324
353
  * Adds native spans to the app start span.
325
354
  */
326
355
  function convertNativeSpansToSpanJSON(parentSpan, nativeSpans) {
327
- return nativeSpans.map(span => {
356
+ return nativeSpans
357
+ .filter(span => span.start_timestamp_ms / 1000 >= parentSpan.start_timestamp)
358
+ .map(span => {
328
359
  if (span.description === 'UIKit init') {
329
360
  return setMainThreadInfo(createUIKitSpan(parentSpan, span));
330
361
  }
@@ -1 +1 @@
1
- {"version":3,"file":"appStart.js","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,MAAM,EACN,gCAAgC,EAChC,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,cAAc,IAAI,0BAA0B,EAC5C,cAAc,IAAI,0BAA0B,GAC7C,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,wB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;YAC7B,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,mBAAmB,CAAC,UAAU,EAAE;YACrC,WAAW,EAAE,YAAY;YACzB,eAAe,EAAE,eAAe,CAAC,kBAAkB,GAAG,IAAI;YAC1D,SAAS,EAAE,eAAe,CAAC,gBAAgB,GAAG,IAAI;YAClD,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;KACJ;AACH,CAAC","sourcesContent":["/* eslint-disable complexity, max-lines */\nimport type { Client, Event, Integration, Span, SpanJSON, TransactionEvent } from '@sentry/core';\nimport {\n getCapturedScopesOnSpan,\n getClient,\n getCurrentScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\n\nimport {\n APP_START_COLD as APP_START_COLD_MEASUREMENT,\n APP_START_WARM as APP_START_WARM_MEASUREMENT,\n} from '../../measurements';\nimport type { NativeAppStartResponse } from '../../NativeRNSentry';\nimport type { ReactNativeClientOptions } from '../../options';\nimport { convertSpanToTransaction, isRootSpan, setEndTimeValue } from '../../utils/span';\nimport { NATIVE } from '../../wrapper';\nimport {\n APP_START_COLD as APP_START_COLD_OP,\n APP_START_WARM as APP_START_WARM_OP,\n UI_LOAD as UI_LOAD_OP,\n} from '../ops';\nimport { SPAN_ORIGIN_AUTO_APP_START, SPAN_ORIGIN_MANUAL_APP_START } from '../origin';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '../semanticAttributes';\nimport { setMainThreadInfo } from '../span';\nimport { createChildSpanJSON, createSpanJSON, getBundleStartTimestampMs } from '../utils';\n\nconst INTEGRATION_NAME = 'AppStart';\n\nexport type AppStartIntegration = Integration & {\n captureStandaloneAppStart: () => Promise<void>;\n};\n\n/**\n * We filter out app start more than 60s.\n * This could be due to many different reasons.\n * We've seen app starts with hours, days and even months.\n */\nconst MAX_APP_START_DURATION_MS = 60_000;\n\n/** We filter out App starts which timestamp is 60s and more before the transaction start */\nconst MAX_APP_START_AGE_MS = 60_000;\n\n/** App Start transaction name */\nconst APP_START_TX_NAME = 'App Start';\n\nlet recordedAppStartEndTimestampMs: number | undefined = undefined;\nlet isRecordedAppStartEndTimestampMsManual = false;\n\nlet rootComponentCreationTimestampMs: number | undefined = undefined;\nlet isRootComponentCreationTimestampMsManual = false;\n\n/**\n * Records the application start end.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function captureAppStart(): Promise<void> {\n return _captureAppStart({ isManual: true });\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport async function _captureAppStart({ isManual }: { isManual: boolean }): Promise<void> {\n const client = getClient();\n if (!client) {\n logger.warn('[AppStart] Could not capture App Start, missing client.');\n return;\n }\n\n isRecordedAppStartEndTimestampMsManual = isManual;\n _setAppStartEndTimestampMs(timestampInSeconds() * 1000);\n await client.getIntegrationByName<AppStartIntegration>(INTEGRATION_NAME)?.captureStandaloneAppStart();\n}\n\n/**\n * Sets the root component first constructor call timestamp.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function setRootComponentCreationTimestampMs(timestampMs: number): void {\n recordedAppStartEndTimestampMs &&\n logger.warn('Setting Root component creation timestamp after app start end is set.');\n rootComponentCreationTimestampMs && logger.warn('Overwriting already set root component creation timestamp.');\n rootComponentCreationTimestampMs = timestampMs;\n isRootComponentCreationTimestampMsManual = true;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport function _setRootComponentCreationTimestampMs(timestampMs: number): void {\n setRootComponentCreationTimestampMs(timestampMs);\n isRootComponentCreationTimestampMsManual = false;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport const _setAppStartEndTimestampMs = (timestampMs: number): void => {\n recordedAppStartEndTimestampMs && logger.warn('Overwriting already set app start.');\n recordedAppStartEndTimestampMs = timestampMs;\n};\n\n/**\n * For testing purposes only.\n *\n * @private\n */\nexport function _clearRootComponentCreationTimestampMs(): void {\n rootComponentCreationTimestampMs = undefined;\n}\n\n/**\n * Adds AppStart spans from the native layer to the transaction event.\n */\nexport const appStartIntegration = ({\n standalone = false,\n}: {\n /**\n * Should the integration send App Start as a standalone root span (transaction)?\n * If false, App Start will be added as a child span to the first transaction.\n *\n * @default false\n */\n standalone?: boolean;\n} = {}): AppStartIntegration => {\n let _client: Client | undefined = undefined;\n let isEnabled = true;\n let appStartDataFlushed = false;\n let firstStartedActiveRootSpanId: string | undefined = undefined;\n\n const setup = (client: Client): void => {\n _client = client;\n const { enableAppStartTracking } = client.getOptions() as ReactNativeClientOptions;\n\n if (!enableAppStartTracking) {\n isEnabled = false;\n logger.warn('[AppStart] App start tracking is disabled.');\n }\n\n client.on('spanStart', recordFirstStartedActiveRootSpanId);\n };\n\n const afterAllSetup = (_client: Client): void => {\n // TODO: automatically set standalone based on the presence of the native layer navigation integration\n };\n\n const processEvent = async (event: Event): Promise<Event> => {\n if (!isEnabled || standalone) {\n return event;\n }\n\n if (event.type !== 'transaction') {\n // App start data is only relevant for transactions\n return event;\n }\n\n await attachAppStartToTransactionEvent(event as TransactionEvent);\n\n return event;\n };\n\n const recordFirstStartedActiveRootSpanId = (rootSpan: Span): void => {\n if (firstStartedActiveRootSpanId) {\n return;\n }\n\n if (!isRootSpan(rootSpan)) {\n return;\n }\n\n setFirstStartedActiveRootSpanId(rootSpan.spanContext().spanId);\n };\n\n /**\n * For testing purposes only.\n * @private\n */\n const setFirstStartedActiveRootSpanId = (spanId: string | undefined): void => {\n firstStartedActiveRootSpanId = spanId;\n logger.debug('[AppStart] First started active root span id recorded.', firstStartedActiveRootSpanId);\n };\n\n async function captureStandaloneAppStart(): Promise<void> {\n if (!standalone) {\n logger.debug(\n '[AppStart] App start tracking is enabled. App start will be added to the first transaction as a child span.',\n );\n return;\n }\n\n logger.debug('[AppStart] App start tracking standalone root span (transaction).');\n\n const span = startInactiveSpan({\n forceTransaction: true,\n name: APP_START_TX_NAME,\n op: UI_LOAD_OP,\n });\n if (span instanceof SentryNonRecordingSpan) {\n // Tracing is disabled or the transaction was sampled\n return;\n }\n\n setEndTimeValue(span, timestampInSeconds());\n _client.emit('spanEnd', span);\n\n const event = convertSpanToTransaction(span);\n if (!event) {\n logger.warn('[AppStart] Failed to convert App Start span to transaction.');\n return;\n }\n\n await attachAppStartToTransactionEvent(event);\n if (!event.spans || event.spans.length === 0) {\n // No spans were added to the transaction, so we don't need to send it\n return;\n }\n\n const scope = getCapturedScopesOnSpan(span).scope || getCurrentScope();\n scope.captureEvent(event);\n }\n\n async function attachAppStartToTransactionEvent(event: TransactionEvent): Promise<void> {\n if (appStartDataFlushed) {\n // App start data is only relevant for the first transaction\n return;\n }\n\n if (!firstStartedActiveRootSpanId) {\n logger.warn('[AppStart] No first started active root span id recorded. Can not attach app start.');\n return;\n }\n\n if (!event.contexts || !event.contexts.trace) {\n logger.warn('[AppStart] Transaction event is missing trace context. Can not attach app start.');\n return;\n }\n\n if (firstStartedActiveRootSpanId !== event.contexts.trace.span_id) {\n logger.warn(\n '[AppStart] First started active root span id does not match the transaction event span id. Can not attached app start.',\n );\n return;\n }\n\n const appStart = await NATIVE.fetchNativeAppStart();\n if (!appStart) {\n logger.warn('[AppStart] Failed to retrieve the app start metrics from the native layer.');\n return;\n }\n if (appStart.has_fetched) {\n logger.warn('[AppStart] Measured app start metrics were already reported from the native layer.');\n return;\n }\n\n const appStartTimestampMs = appStart.app_start_timestamp_ms;\n if (!appStartTimestampMs) {\n logger.warn('[AppStart] App start timestamp could not be loaded from the native layer.');\n return;\n }\n\n const appStartEndTimestampMs = recordedAppStartEndTimestampMs || getBundleStartTimestampMs();\n if (!appStartEndTimestampMs) {\n logger.warn(\n '[AppStart] Javascript failed to record app start end. `setAppStartEndTimestampMs` was not called nor could the bundle start be found.',\n );\n return;\n }\n\n const isAppStartWithinBounds =\n !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp - MAX_APP_START_AGE_MS;\n if (!__DEV__ && !isAppStartWithinBounds) {\n logger.warn('[AppStart] App start timestamp is too far in the past to be used for app start span.');\n return;\n }\n\n const appStartDurationMs = appStartEndTimestampMs - appStartTimestampMs;\n if (!__DEV__ && appStartDurationMs >= MAX_APP_START_DURATION_MS) {\n // Dev builds can have long app start waiting over minute for the first bundle to be produced\n logger.warn('[AppStart] App start duration is over a minute long, not adding app start span.');\n return;\n }\n\n appStartDataFlushed = true;\n\n event.contexts.trace.data = event.contexts.trace.data || {};\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_OP] = UI_LOAD_OP;\n event.contexts.trace.op = UI_LOAD_OP;\n\n const origin = isRecordedAppStartEndTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START;\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = origin;\n event.contexts.trace.origin = origin;\n\n const appStartTimestampSeconds = appStartTimestampMs / 1000;\n event.start_timestamp = appStartTimestampSeconds;\n\n event.spans = event.spans || [];\n /** event.spans reference */\n const children: SpanJSON[] = event.spans;\n\n const maybeTtidSpan = children.find(({ op }) => op === 'ui.load.initial_display');\n if (maybeTtidSpan) {\n maybeTtidSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_initial_display', maybeTtidSpan);\n }\n\n const maybeTtfdSpan = children.find(({ op }) => op === 'ui.load.full_display');\n if (maybeTtfdSpan) {\n maybeTtfdSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_full_display', maybeTtfdSpan);\n }\n\n const appStartEndTimestampSeconds = appStartEndTimestampMs / 1000;\n if (event.timestamp && event.timestamp < appStartEndTimestampSeconds) {\n logger.debug(\n '[AppStart] Transaction event timestamp is before app start end. Adjusting transaction event timestamp.',\n );\n event.timestamp = appStartEndTimestampSeconds;\n }\n\n const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;\n const appStartSpanJSON: SpanJSON = createSpanJSON({\n op,\n description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start',\n start_timestamp: appStartTimestampSeconds,\n timestamp: appStartEndTimestampSeconds,\n trace_id: event.contexts.trace.trace_id,\n parent_span_id: event.contexts.trace.span_id,\n origin,\n });\n const jsExecutionSpanJSON = createJSExecutionStartSpan(appStartSpanJSON, rootComponentCreationTimestampMs);\n\n const appStartSpans = [\n appStartSpanJSON,\n ...(jsExecutionSpanJSON ? [jsExecutionSpanJSON] : []),\n ...convertNativeSpansToSpanJSON(appStartSpanJSON, appStart.spans),\n ];\n\n children.push(...appStartSpans);\n logger.debug('[AppStart] Added app start spans to transaction event.', JSON.stringify(appStartSpans, undefined, 2));\n\n const measurementKey = appStart.type === 'cold' ? APP_START_COLD_MEASUREMENT : APP_START_WARM_MEASUREMENT;\n const measurementValue = {\n value: appStartDurationMs,\n unit: 'millisecond',\n };\n event.measurements = event.measurements || {};\n event.measurements[measurementKey] = measurementValue;\n logger.debug(\n `[AppStart] Added app start measurement to transaction event.`,\n JSON.stringify(measurementValue, undefined, 2),\n );\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n afterAllSetup,\n processEvent,\n captureStandaloneAppStart,\n setFirstStartedActiveRootSpanId,\n } as AppStartIntegration;\n};\n\nfunction setSpanDurationAsMeasurementOnTransactionEvent(event: TransactionEvent, label: string, span: SpanJSON): void {\n if (!span.timestamp || !span.start_timestamp) {\n logger.warn('Span is missing start or end timestamp. Cam not set measurement on transaction event.');\n return;\n }\n\n event.measurements = event.measurements || {};\n event.measurements[label] = {\n value: (span.timestamp - span.start_timestamp) * 1000,\n unit: 'millisecond',\n };\n}\n\n/**\n * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.\n */\nfunction createJSExecutionStartSpan(\n parentSpan: SpanJSON,\n rootComponentCreationTimestampMs: number | undefined,\n): SpanJSON | undefined {\n const bundleStartTimestampMs = getBundleStartTimestampMs();\n if (!bundleStartTimestampMs) {\n return undefined;\n }\n\n if (!rootComponentCreationTimestampMs) {\n logger.warn('Missing the root component first constructor call timestamp.');\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Start',\n start_timestamp: bundleStartTimestampMs / 1000,\n timestamp: bundleStartTimestampMs / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Before React Root',\n start_timestamp: bundleStartTimestampMs / 1000,\n timestamp: rootComponentCreationTimestampMs / 1000,\n origin: isRootComponentCreationTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START,\n });\n}\n\n/**\n * Adds native spans to the app start span.\n */\nfunction convertNativeSpansToSpanJSON(parentSpan: SpanJSON, nativeSpans: NativeAppStartResponse['spans']): SpanJSON[] {\n return nativeSpans.map(span => {\n if (span.description === 'UIKit init') {\n return setMainThreadInfo(createUIKitSpan(parentSpan, span));\n }\n\n return setMainThreadInfo(\n createChildSpanJSON(parentSpan, {\n description: span.description,\n start_timestamp: span.start_timestamp_ms / 1000,\n timestamp: span.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n }),\n );\n });\n}\n\n/**\n * UIKit init is measured by the native layers till the native SDK start\n * RN initializes the native SDK later, the end timestamp would be wrong\n */\nfunction createUIKitSpan(parentSpan: SpanJSON, nativeUIKitSpan: NativeAppStartResponse['spans'][number]): SpanJSON {\n const bundleStart = getBundleStartTimestampMs();\n\n // If UIKit init ends after the bundle start, the native SDK was auto-initialized\n // and so the end timestamp is incorrect.\n // The timestamps can't equal, as RN initializes after UIKit.\n if (bundleStart && bundleStart < nativeUIKitSpan.end_timestamp_ms) {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init to JS Exec Start',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: bundleStart / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n } else {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: nativeUIKitSpan.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"appStart.js","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,MAAM,EACN,gCAAgC,EAChC,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,cAAc,IAAI,0BAA0B,EAC5C,cAAc,IAAI,0BAA0B,GAC7C,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,cAAc,IAAI,iBAAiB,EACnC,cAAc,IAAI,iBAAiB,EACnC,OAAO,IAAI,UAAU,GACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1F,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAMpC;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,KAAM,CAAC;AAEzC,4FAA4F;AAC5F,MAAM,oBAAoB,GAAG,KAAM,CAAC;AAEpC,iCAAiC;AACjC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE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W,GAAG,eAAe,CAAC,gBAAgB,EAAE;QACjE,OAAO,mBAAmB,CAAC,UAAU,EAAE;YACrC,WAAW,EAAE,6BAA6B;YAC1C,eAAe,EAAE,eAAe,CAAC,kBAAkB,GAAG,IAAI;YAC1D,SAAS,EAAE,WAAW,GAAG,IAAI;YAC7B,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,mBAAmB,CAAC,UAAU,EAAE;YACrC,WAAW,EAAE,YAAY;YACzB,eAAe,EAAE,eAAe,CAAC,kBAAkB,GAAG,IAAI;YAC1D,SAAS,EAAE,eAAe,CAAC,gBAAgB,GAAG,IAAI;YAClD,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;KACJ;AACH,CAAC","sourcesContent":["/* eslint-disable complexity, max-lines */\nimport type { Client, Event, Integration, Span, SpanJSON, TransactionEvent } from '@sentry/core';\nimport {\n getCapturedScopesOnSpan,\n getClient,\n getCurrentScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\n\nimport { getAppRegistryIntegration } from '../../integrations/appRegistry';\nimport {\n APP_START_COLD as APP_START_COLD_MEASUREMENT,\n APP_START_WARM as APP_START_WARM_MEASUREMENT,\n} from '../../measurements';\nimport type { NativeAppStartResponse } from '../../NativeRNSentry';\nimport type { ReactNativeClientOptions } from '../../options';\nimport { convertSpanToTransaction, isRootSpan, setEndTimeValue } from '../../utils/span';\nimport { NATIVE } from '../../wrapper';\nimport {\n APP_START_COLD as APP_START_COLD_OP,\n APP_START_WARM as APP_START_WARM_OP,\n UI_LOAD as UI_LOAD_OP,\n} from '../ops';\nimport { SPAN_ORIGIN_AUTO_APP_START, SPAN_ORIGIN_MANUAL_APP_START } from '../origin';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '../semanticAttributes';\nimport { setMainThreadInfo } from '../span';\nimport { createChildSpanJSON, createSpanJSON, getBundleStartTimestampMs } from '../utils';\n\nconst INTEGRATION_NAME = 'AppStart';\n\nexport type AppStartIntegration = Integration & {\n captureStandaloneAppStart: () => Promise<void>;\n};\n\n/**\n * We filter out app start more than 60s.\n * This could be due to many different reasons.\n * We've seen app starts with hours, days and even months.\n */\nconst MAX_APP_START_DURATION_MS = 60_000;\n\n/** We filter out App starts which timestamp is 60s and more before the transaction start */\nconst MAX_APP_START_AGE_MS = 60_000;\n\n/** App Start transaction name */\nconst APP_START_TX_NAME = 'App Start';\n\nlet recordedAppStartEndTimestampMs: number | undefined = undefined;\nlet isRecordedAppStartEndTimestampMsManual = false;\n\nlet rootComponentCreationTimestampMs: number | undefined = undefined;\nlet isRootComponentCreationTimestampMsManual = false;\n\n/**\n * Records the application start end.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function captureAppStart(): Promise<void> {\n return _captureAppStart({ isManual: true });\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport async function _captureAppStart({ isManual }: { isManual: boolean }): Promise<void> {\n const client = getClient();\n if (!client) {\n logger.warn('[AppStart] Could not capture App Start, missing client.');\n return;\n }\n\n isRecordedAppStartEndTimestampMsManual = isManual;\n _setAppStartEndTimestampMs(timestampInSeconds() * 1000);\n await client.getIntegrationByName<AppStartIntegration>(INTEGRATION_NAME)?.captureStandaloneAppStart();\n}\n\n/**\n * Sets the root component first constructor call timestamp.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function setRootComponentCreationTimestampMs(timestampMs: number): void {\n recordedAppStartEndTimestampMs &&\n logger.warn('Setting Root component creation timestamp after app start end is set.');\n rootComponentCreationTimestampMs && logger.warn('Overwriting already set root component creation timestamp.');\n rootComponentCreationTimestampMs = timestampMs;\n isRootComponentCreationTimestampMsManual = true;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport function _setRootComponentCreationTimestampMs(timestampMs: number): void {\n setRootComponentCreationTimestampMs(timestampMs);\n isRootComponentCreationTimestampMsManual = false;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport const _setAppStartEndTimestampMs = (timestampMs: number): void => {\n recordedAppStartEndTimestampMs && logger.warn('Overwriting already set app start.');\n recordedAppStartEndTimestampMs = timestampMs;\n};\n\n/**\n * For testing purposes only.\n *\n * @private\n */\nexport function _clearRootComponentCreationTimestampMs(): void {\n rootComponentCreationTimestampMs = undefined;\n}\n\n/**\n * Adds AppStart spans from the native layer to the transaction event.\n */\nexport const appStartIntegration = ({\n standalone = false,\n}: {\n /**\n * Should the integration send App Start as a standalone root span (transaction)?\n * If false, App Start will be added as a child span to the first transaction.\n *\n * @default false\n */\n standalone?: boolean;\n} = {}): AppStartIntegration => {\n let _client: Client | undefined = undefined;\n let isEnabled = true;\n let appStartDataFlushed = false;\n let afterAllSetupCalled = false;\n let firstStartedActiveRootSpanId: string | undefined = undefined;\n\n const setup = (client: Client): void => {\n _client = client;\n const { enableAppStartTracking } = client.getOptions() as ReactNativeClientOptions;\n\n if (!enableAppStartTracking) {\n isEnabled = false;\n logger.warn('[AppStart] App start tracking is disabled.');\n }\n\n client.on('spanStart', recordFirstStartedActiveRootSpanId);\n };\n\n const afterAllSetup = (client: Client): void => {\n if (afterAllSetupCalled) {\n return;\n }\n afterAllSetupCalled = true;\n\n // TODO: automatically set standalone based on the presence of the native layer navigation integration\n\n getAppRegistryIntegration(client)?.onRunApplication(() => {\n if (appStartDataFlushed) {\n logger.log('[AppStartIntegration] Resetting app start data flushed flag based on runApplication call.');\n appStartDataFlushed = false;\n firstStartedActiveRootSpanId = undefined;\n } else {\n logger.log(\n '[AppStartIntegration] Waiting for initial app start was flush, before updating based on runApplication call.',\n );\n }\n });\n };\n\n const processEvent = async (event: Event): Promise<Event> => {\n if (!isEnabled || standalone) {\n return event;\n }\n\n if (event.type !== 'transaction') {\n // App start data is only relevant for transactions\n return event;\n }\n\n await attachAppStartToTransactionEvent(event as TransactionEvent);\n\n return event;\n };\n\n const recordFirstStartedActiveRootSpanId = (rootSpan: Span): void => {\n if (firstStartedActiveRootSpanId) {\n return;\n }\n\n if (!isRootSpan(rootSpan)) {\n return;\n }\n\n setFirstStartedActiveRootSpanId(rootSpan.spanContext().spanId);\n };\n\n /**\n * For testing purposes only.\n * @private\n */\n const setFirstStartedActiveRootSpanId = (spanId: string | undefined): void => {\n firstStartedActiveRootSpanId = spanId;\n logger.debug('[AppStart] First started active root span id recorded.', firstStartedActiveRootSpanId);\n };\n\n async function captureStandaloneAppStart(): Promise<void> {\n if (!standalone) {\n logger.debug(\n '[AppStart] App start tracking is enabled. App start will be added to the first transaction as a child span.',\n );\n return;\n }\n\n logger.debug('[AppStart] App start tracking standalone root span (transaction).');\n\n const span = startInactiveSpan({\n forceTransaction: true,\n name: APP_START_TX_NAME,\n op: UI_LOAD_OP,\n });\n if (span instanceof SentryNonRecordingSpan) {\n // Tracing is disabled or the transaction was sampled\n return;\n }\n\n setEndTimeValue(span, timestampInSeconds());\n _client.emit('spanEnd', span);\n\n const event = convertSpanToTransaction(span);\n if (!event) {\n logger.warn('[AppStart] Failed to convert App Start span to transaction.');\n return;\n }\n\n await attachAppStartToTransactionEvent(event);\n if (!event.spans || event.spans.length === 0) {\n // No spans were added to the transaction, so we don't need to send it\n return;\n }\n\n const scope = getCapturedScopesOnSpan(span).scope || getCurrentScope();\n scope.captureEvent(event);\n }\n\n async function attachAppStartToTransactionEvent(event: TransactionEvent): Promise<void> {\n if (appStartDataFlushed) {\n // App start data is only relevant for the first transaction of the app run\n return;\n }\n\n if (!firstStartedActiveRootSpanId) {\n logger.warn('[AppStart] No first started active root span id recorded. Can not attach app start.');\n return;\n }\n\n if (!event.contexts || !event.contexts.trace) {\n logger.warn('[AppStart] Transaction event is missing trace context. Can not attach app start.');\n return;\n }\n\n if (firstStartedActiveRootSpanId !== event.contexts.trace.span_id) {\n logger.warn(\n '[AppStart] First started active root span id does not match the transaction event span id. Can not attached app start.',\n );\n return;\n }\n\n const appStart = await NATIVE.fetchNativeAppStart();\n if (!appStart) {\n logger.warn('[AppStart] Failed to retrieve the app start metrics from the native layer.');\n return;\n }\n if (appStart.has_fetched) {\n logger.warn('[AppStart] Measured app start metrics were already reported from the native layer.');\n return;\n }\n\n const appStartTimestampMs = appStart.app_start_timestamp_ms;\n if (!appStartTimestampMs) {\n logger.warn('[AppStart] App start timestamp could not be loaded from the native layer.');\n return;\n }\n\n const appStartEndTimestampMs = recordedAppStartEndTimestampMs || getBundleStartTimestampMs();\n if (!appStartEndTimestampMs) {\n logger.warn(\n '[AppStart] Javascript failed to record app start end. `setAppStartEndTimestampMs` was not called nor could the bundle start be found.',\n );\n return;\n }\n\n const isAppStartWithinBounds =\n !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp * 1_000 - MAX_APP_START_AGE_MS;\n if (!__DEV__ && !isAppStartWithinBounds) {\n logger.warn('[AppStart] App start timestamp is too far in the past to be used for app start span.');\n return;\n }\n\n const appStartDurationMs = appStartEndTimestampMs - appStartTimestampMs;\n if (!__DEV__ && appStartDurationMs >= MAX_APP_START_DURATION_MS) {\n // Dev builds can have long app start waiting over minute for the first bundle to be produced\n logger.warn('[AppStart] App start duration is over a minute long, not adding app start span.');\n return;\n }\n\n if (appStartDurationMs < 0) {\n // This can happen when MainActivity on Android is recreated,\n // and the app start end timestamp is not updated, for example\n // due to missing `Sentry.wrap(RootComponent)` call.\n logger.warn(\n '[AppStart] Last recorded app start end timestamp is before the app start timestamp.',\n 'This is usually caused by missing `Sentry.wrap(RootComponent)` call.',\n );\n return;\n }\n\n appStartDataFlushed = true;\n\n event.contexts.trace.data = event.contexts.trace.data || {};\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_OP] = UI_LOAD_OP;\n event.contexts.trace.op = UI_LOAD_OP;\n\n const origin = isRecordedAppStartEndTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START;\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = origin;\n event.contexts.trace.origin = origin;\n\n const appStartTimestampSeconds = appStartTimestampMs / 1000;\n event.start_timestamp = appStartTimestampSeconds;\n\n event.spans = event.spans || [];\n /** event.spans reference */\n const children: SpanJSON[] = event.spans;\n\n const maybeTtidSpan = children.find(({ op }) => op === 'ui.load.initial_display');\n if (maybeTtidSpan) {\n maybeTtidSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_initial_display', maybeTtidSpan);\n }\n\n const maybeTtfdSpan = children.find(({ op }) => op === 'ui.load.full_display');\n if (maybeTtfdSpan) {\n maybeTtfdSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_full_display', maybeTtfdSpan);\n }\n\n const appStartEndTimestampSeconds = appStartEndTimestampMs / 1000;\n if (event.timestamp && event.timestamp < appStartEndTimestampSeconds) {\n logger.debug(\n '[AppStart] Transaction event timestamp is before app start end. Adjusting transaction event timestamp.',\n );\n event.timestamp = appStartEndTimestampSeconds;\n }\n\n const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;\n const appStartSpanJSON: SpanJSON = createSpanJSON({\n op,\n description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start',\n start_timestamp: appStartTimestampSeconds,\n timestamp: appStartEndTimestampSeconds,\n trace_id: event.contexts.trace.trace_id,\n parent_span_id: event.contexts.trace.span_id,\n origin,\n });\n const jsExecutionSpanJSON = createJSExecutionStartSpan(appStartSpanJSON, rootComponentCreationTimestampMs);\n\n const appStartSpans = [\n appStartSpanJSON,\n ...(jsExecutionSpanJSON ? [jsExecutionSpanJSON] : []),\n ...convertNativeSpansToSpanJSON(appStartSpanJSON, appStart.spans),\n ];\n\n children.push(...appStartSpans);\n logger.debug('[AppStart] Added app start spans to transaction event.', JSON.stringify(appStartSpans, undefined, 2));\n\n const measurementKey = appStart.type === 'cold' ? APP_START_COLD_MEASUREMENT : APP_START_WARM_MEASUREMENT;\n const measurementValue = {\n value: appStartDurationMs,\n unit: 'millisecond',\n };\n event.measurements = event.measurements || {};\n event.measurements[measurementKey] = measurementValue;\n logger.debug(\n `[AppStart] Added app start measurement to transaction event.`,\n JSON.stringify(measurementValue, undefined, 2),\n );\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n afterAllSetup,\n processEvent,\n captureStandaloneAppStart,\n setFirstStartedActiveRootSpanId,\n } as AppStartIntegration;\n};\n\nfunction setSpanDurationAsMeasurementOnTransactionEvent(event: TransactionEvent, label: string, span: SpanJSON): void {\n if (!span.timestamp || !span.start_timestamp) {\n logger.warn('Span is missing start or end timestamp. Cam not set measurement on transaction event.');\n return;\n }\n\n event.measurements = event.measurements || {};\n event.measurements[label] = {\n value: (span.timestamp - span.start_timestamp) * 1000,\n unit: 'millisecond',\n };\n}\n\n/**\n * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.\n */\nfunction createJSExecutionStartSpan(\n parentSpan: SpanJSON,\n rootComponentCreationTimestampMs: number | undefined,\n): SpanJSON | undefined {\n const bundleStartTimestampMs = getBundleStartTimestampMs();\n if (!bundleStartTimestampMs) {\n return undefined;\n }\n\n const bundleStartTimestampSeconds = bundleStartTimestampMs / 1000;\n if (bundleStartTimestampSeconds < parentSpan.start_timestamp) {\n logger.warn('Bundle start timestamp is before the app start span start timestamp. Skipping JS execution span.');\n return undefined;\n }\n\n if (!rootComponentCreationTimestampMs) {\n logger.warn('Missing the root component first constructor call timestamp.');\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Start',\n start_timestamp: bundleStartTimestampSeconds,\n timestamp: bundleStartTimestampSeconds,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Before React Root',\n start_timestamp: bundleStartTimestampSeconds,\n timestamp: rootComponentCreationTimestampMs / 1000,\n origin: isRootComponentCreationTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START,\n });\n}\n\n/**\n * Adds native spans to the app start span.\n */\nfunction convertNativeSpansToSpanJSON(parentSpan: SpanJSON, nativeSpans: NativeAppStartResponse['spans']): SpanJSON[] {\n return nativeSpans\n .filter(span => span.start_timestamp_ms / 1000 >= parentSpan.start_timestamp)\n .map(span => {\n if (span.description === 'UIKit init') {\n return setMainThreadInfo(createUIKitSpan(parentSpan, span));\n }\n\n return setMainThreadInfo(\n createChildSpanJSON(parentSpan, {\n description: span.description,\n start_timestamp: span.start_timestamp_ms / 1000,\n timestamp: span.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n }),\n );\n });\n}\n\n/**\n * UIKit init is measured by the native layers till the native SDK start\n * RN initializes the native SDK later, the end timestamp would be wrong\n */\nfunction createUIKitSpan(parentSpan: SpanJSON, nativeUIKitSpan: NativeAppStartResponse['spans'][number]): SpanJSON {\n const bundleStart = getBundleStartTimestampMs();\n\n // If UIKit init ends after the bundle start, the native SDK was auto-initialized\n // and so the end timestamp is incorrect.\n // The timestamps can't equal, as RN initializes after UIKit.\n if (bundleStart && bundleStart < nativeUIKitSpan.end_timestamp_ms) {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init to JS Exec Start',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: bundleStart / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n } else {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: nativeUIKitSpan.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { Integration } from '@sentry/core';
2
+ export declare const INTEGRATION_NAME = "TimeToDisplay";
3
+ export declare const timeToDisplayIntegration: () => Integration;
4
+ //# sourceMappingURL=timeToDisplayIntegration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeToDisplayIntegration.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/timeToDisplayIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,WAAW,EAAY,MAAM,cAAc,CAAC;AAYjE,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAKhD,eAAO,MAAM,wBAAwB,QAAO,WAsE3C,CAAC"}