@sentry/browser 11.0.0-alpha.0 → 11.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/build/npm/cjs/dev/index.js +1 -0
  2. package/build/npm/cjs/dev/index.js.map +1 -1
  3. package/build/npm/cjs/dev/integrations/graphqlClient.js +3 -3
  4. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  5. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  6. package/build/npm/cjs/dev/profiling/integration.js +21 -91
  7. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  8. package/build/npm/cjs/dev/profiling/utils.js +0 -283
  9. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  10. package/build/npm/cjs/dev/tracing/backgroundtab.js +5 -1
  11. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  12. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +5 -9
  13. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  14. package/build/npm/cjs/dev/tracing/linkedTraces.js +3 -2
  15. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  16. package/build/npm/cjs/dev/tracing/request.js +2 -4
  17. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  18. package/build/npm/cjs/prod/index.js +1 -0
  19. package/build/npm/cjs/prod/index.js.map +1 -1
  20. package/build/npm/cjs/prod/integrations/graphqlClient.js +3 -3
  21. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  22. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  23. package/build/npm/cjs/prod/profiling/integration.js +21 -91
  24. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  25. package/build/npm/cjs/prod/profiling/utils.js +0 -283
  26. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  27. package/build/npm/cjs/prod/tracing/backgroundtab.js +5 -1
  28. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  29. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +5 -9
  30. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  31. package/build/npm/cjs/prod/tracing/linkedTraces.js +3 -2
  32. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  33. package/build/npm/cjs/prod/tracing/request.js +2 -4
  34. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  35. package/build/npm/esm/dev/index.js +1 -1
  36. package/build/npm/esm/dev/integrations/graphqlClient.js +5 -5
  37. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  38. package/build/npm/esm/dev/package.json +1 -1
  39. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  40. package/build/npm/esm/dev/profiling/integration.js +22 -92
  41. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  42. package/build/npm/esm/dev/profiling/utils.js +2 -272
  43. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  44. package/build/npm/esm/dev/tracing/backgroundtab.js +5 -1
  45. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  46. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +6 -10
  47. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  48. package/build/npm/esm/dev/tracing/linkedTraces.js +3 -2
  49. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  50. package/build/npm/esm/dev/tracing/request.js +2 -4
  51. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  52. package/build/npm/esm/prod/index.js +1 -1
  53. package/build/npm/esm/prod/integrations/graphqlClient.js +5 -5
  54. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  55. package/build/npm/esm/prod/package.json +1 -1
  56. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  57. package/build/npm/esm/prod/profiling/integration.js +22 -92
  58. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  59. package/build/npm/esm/prod/profiling/utils.js +2 -272
  60. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  61. package/build/npm/esm/prod/tracing/backgroundtab.js +5 -1
  62. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  63. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +6 -10
  64. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  65. package/build/npm/esm/prod/tracing/linkedTraces.js +3 -2
  66. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  67. package/build/npm/esm/prod/tracing/request.js +2 -4
  68. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  69. package/build/npm/types/exports.d.ts +1 -1
  70. package/build/npm/types/exports.d.ts.map +1 -1
  71. package/build/npm/types/index.bundle.d.ts +2 -2
  72. package/build/npm/types/index.bundle.d.ts.map +1 -1
  73. package/build/npm/types/index.bundle.feedback.d.ts +2 -2
  74. package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
  75. package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
  76. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  77. package/build/npm/types/index.bundle.replay.d.ts +2 -2
  78. package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
  79. package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
  80. package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
  81. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
  82. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  83. package/build/npm/types/index.bundle.tracing.d.ts +2 -2
  84. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  85. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -1
  86. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  87. package/build/npm/types/index.bundle.tracing.replay.d.ts +2 -2
  88. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  89. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +2 -2
  90. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  91. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  92. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  93. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -1
  94. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  95. package/build/npm/types/index.d.ts +1 -2
  96. package/build/npm/types/index.d.ts.map +1 -1
  97. package/build/npm/types/integrations/graphqlClient.d.ts.map +1 -1
  98. package/build/npm/types/profiling/index.d.ts.map +1 -1
  99. package/build/npm/types/profiling/integration.d.ts.map +1 -1
  100. package/build/npm/types/profiling/utils.d.ts +1 -74
  101. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  102. package/build/npm/types/tracing/backgroundtab.d.ts.map +1 -1
  103. package/build/npm/types/tracing/browserTracingIntegration.d.ts +0 -10
  104. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  105. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
  106. package/build/npm/types/tracing/request.d.ts +0 -13
  107. package/build/npm/types/tracing/request.d.ts.map +1 -1
  108. package/package.json +8 -8
  109. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +0 -91
  110. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +0 -1
  111. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +0 -91
  112. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +0 -1
  113. package/build/npm/esm/dev/profiling/startProfileForSpan.js +0 -89
  114. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +0 -1
  115. package/build/npm/esm/prod/profiling/startProfileForSpan.js +0 -89
  116. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +0 -1
  117. package/build/npm/types/profiling/startProfileForSpan.d.ts +0 -8
  118. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +0 -1
@@ -41,19 +41,6 @@ export interface RequestInstrumentationOptions {
41
41
  * Default: true
42
42
  */
43
43
  traceXHR: boolean;
44
- /**
45
- * Flag to disable tracking of long-lived streams, like server-sent events (SSE) via fetch.
46
- * Do not enable this in case you have live streams or very long running streams.
47
- *
48
- * Disabled by default since it can lead to issues with streams using the `cancel()` api
49
- * (https://github.com/getsentry/sentry-javascript/issues/13950)
50
- *
51
- * Default: false
52
- *
53
- * @deprecated Use `fetchStreamPerformanceIntegration()` instead. Add it to your `integrations` array
54
- * to track the duration of streamed fetch response bodies.
55
- */
56
- trackFetchStreamPerformance: boolean;
57
44
  /**
58
45
  * If true, Sentry will capture http timings and add them to the corresponding http spans.
59
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/tracing/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EAEN,eAAe,EACf,gBAAgB,EAEhB,IAAI,EAEL,MAAM,sBAAsB,CAAC;AAsC9B,0CAA0C;AAC1C,MAAM,WAAW,6BAA6B;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,uBAAuB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEjD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;OAWG;IACH,2BAA2B,EAAE,OAAO,CAAC;IAErC;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;;;OAKG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE9D;;OAEG;IACH,kBAAkB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,eAAe,GAAG,IAAI,CAAC;IAE3E;;OAEG;IACH,gBAAgB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,mBA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AA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAAG,IAAI,CAyElH;AAiED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,uBAAuB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,GACvD,OAAO,CAqCT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/browser",
3
- "version": "11.0.0-alpha.0",
3
+ "version": "11.0.0-alpha.1",
4
4
  "description": "Official Sentry SDK for browsers",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -38,15 +38,15 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@sentry/browser-utils": "11.0.0-alpha.0",
42
- "@sentry/conventions": "^0.16.0",
43
- "@sentry/feedback": "11.0.0-alpha.0",
44
- "@sentry/replay": "11.0.0-alpha.0",
45
- "@sentry/replay-canvas": "11.0.0-alpha.0",
46
- "@sentry/core": "11.0.0-alpha.0"
41
+ "@sentry/browser-utils": "11.0.0-alpha.1",
42
+ "@sentry/conventions": "^0.19.0",
43
+ "@sentry/feedback": "11.0.0-alpha.1",
44
+ "@sentry/replay": "11.0.0-alpha.1",
45
+ "@sentry/replay-canvas": "11.0.0-alpha.1",
46
+ "@sentry/core": "11.0.0-alpha.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@sentry-internal/integration-shims": "11.0.0-alpha.0",
49
+ "@sentry-internal/integration-shims": "11.0.0-alpha.1",
50
50
  "fake-indexeddb": "^6.2.4"
51
51
  },
52
52
  "scripts": {
@@ -1,91 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const browser = require('@sentry/core/browser');
4
- const debugBuild = require('../debug-build.js');
5
- const helpers = require('../helpers.js');
6
- const utils = require('./utils.js');
7
-
8
- function startProfileForSpan(span) {
9
- let startTimestamp;
10
- if (utils.isAutomatedPageLoadSpan(span)) {
11
- startTimestamp = browser.timestampInSeconds() * 1e3;
12
- }
13
- const profiler = utils.startJSSelfProfile();
14
- if (!profiler) {
15
- return;
16
- }
17
- if (debugBuild.DEBUG_BUILD) {
18
- browser.debug.log(`[Profiling] started profiling span: ${browser.spanToJSON(span).description}`);
19
- }
20
- const profileId = browser.uuid4();
21
- let processedProfile = null;
22
- browser.getCurrentScope().setContext("profile", {
23
- profile_id: profileId,
24
- start_timestamp: startTimestamp
25
- });
26
- utils.PROFILED_ROOT_SPANS.add(span);
27
- utils.setThreadAttributes(span);
28
- async function onProfileHandler() {
29
- if (!span) {
30
- return;
31
- }
32
- if (!profiler) {
33
- return;
34
- }
35
- if (processedProfile) {
36
- if (debugBuild.DEBUG_BUILD) {
37
- browser.debug.log("[Profiling] profile for:", browser.spanToJSON(span).description, "already exists, returning early");
38
- }
39
- return;
40
- }
41
- return profiler.stop().then((profile) => {
42
- if (maxDurationTimeoutID) {
43
- helpers.WINDOW.clearTimeout(maxDurationTimeoutID);
44
- maxDurationTimeoutID = void 0;
45
- }
46
- if (debugBuild.DEBUG_BUILD) {
47
- browser.debug.log(`[Profiling] stopped profiling of span: ${browser.spanToJSON(span).description}`);
48
- }
49
- if (!profile) {
50
- if (debugBuild.DEBUG_BUILD) {
51
- browser.debug.log(
52
- `[Profiling] profiler returned null profile for: ${browser.spanToJSON(span).description}`,
53
- "this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started"
54
- );
55
- }
56
- return;
57
- }
58
- processedProfile = profile;
59
- utils.addProfileToGlobalCache(profileId, profile);
60
- }).catch((error) => {
61
- if (debugBuild.DEBUG_BUILD) {
62
- browser.debug.log("[Profiling] error while stopping profiler:", error);
63
- }
64
- });
65
- }
66
- let maxDurationTimeoutID = helpers.WINDOW.setTimeout(() => {
67
- if (debugBuild.DEBUG_BUILD) {
68
- browser.debug.log("[Profiling] max profile duration elapsed, stopping profiling for:", browser.spanToJSON(span).description);
69
- }
70
- onProfileHandler();
71
- }, utils.MAX_PROFILE_DURATION_MS);
72
- const originalEnd = span.end.bind(span);
73
- function profilingWrappedSpanEnd() {
74
- if (!span) {
75
- return originalEnd();
76
- }
77
- void onProfileHandler().then(
78
- () => {
79
- originalEnd();
80
- },
81
- () => {
82
- originalEnd();
83
- }
84
- );
85
- return span;
86
- }
87
- span.end = profilingWrappedSpanEnd;
88
- }
89
-
90
- exports.startProfileForSpan = startProfileForSpan;
91
- //# sourceMappingURL=startProfileForSpan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startProfileForSpan.js","sources":["../../../../../src/profiling/startProfileForSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { debug, getCurrentScope, spanToJSON, timestampInSeconds, uuid4 } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile } from './jsSelfProfiling';\nimport {\n addProfileToGlobalCache,\n isAutomatedPageLoadSpan,\n MAX_PROFILE_DURATION_MS,\n PROFILED_ROOT_SPANS,\n setThreadAttributes,\n startJSSelfProfile,\n} from './utils';\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nexport function startProfileForSpan(span: Span): void {\n // Start the profiler and get the profiler instance.\n let startTimestamp: number | undefined;\n if (isAutomatedPageLoadSpan(span)) {\n startTimestamp = timestampInSeconds() * 1000;\n }\n\n const profiler = startJSSelfProfile();\n\n // We failed to construct the profiler, so we skip.\n // No need to log anything as this has already been logged in startProfile.\n if (!profiler) {\n return;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);\n }\n\n // We create \"unique\" span names to avoid concurrent spans with same names\n // from being ignored by the profiler. From here on, only this span name should be used when\n // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n const profileId = uuid4();\n\n // A couple of important things to note here:\n // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n // Whichever of the two (span.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n // will be processed when the original span is finished. Since onProfileHandler can be invoked multiple times in the\n // event of an error or user mistake (calling span.finish multiple times), it is important that the behavior of onProfileHandler\n // is idempotent as we do not want any timings or profiles to be overridden by the last call to onProfileHandler.\n // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n let processedProfile: JSSelfProfile | null = null;\n\n getCurrentScope().setContext('profile', {\n profile_id: profileId,\n start_timestamp: startTimestamp,\n });\n\n PROFILED_ROOT_SPANS.add(span);\n setThreadAttributes(span);\n\n /**\n * Idempotent handler for profile stop\n */\n async function onProfileHandler(): Promise<void> {\n // Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times.\n if (!span) {\n return;\n }\n // Satisfy the type checker, but profiler will always be defined here.\n if (!profiler) {\n return;\n }\n if (processedProfile) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] profile for:', spanToJSON(span).description, 'already exists, returning early');\n }\n return;\n }\n\n return profiler\n .stop()\n .then((profile: JSSelfProfile): void => {\n if (maxDurationTimeoutID) {\n WINDOW.clearTimeout(maxDurationTimeoutID);\n maxDurationTimeoutID = undefined;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);\n }\n\n // In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.\n if (!profile) {\n if (DEBUG_BUILD) {\n debug.log(\n `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,\n 'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',\n );\n }\n return;\n }\n\n processedProfile = profile;\n addProfileToGlobalCache(profileId, profile);\n })\n .catch(error => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] error while stopping profiler:', error);\n }\n });\n }\n\n // Enqueue a timeout to prevent profiles from running over max duration.\n let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', spanToJSON(span).description);\n }\n // If the timeout exceeds, we want to stop profiling, but not finish the span\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n onProfileHandler();\n }, MAX_PROFILE_DURATION_MS);\n\n // We need to reference the original end call to avoid creating an infinite loop\n const originalEnd = span.end.bind(span);\n\n /**\n * Wraps span `end()` with profiling related logic.\n * startProfiling is called after the call to spanStart in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd.\n */\n function profilingWrappedSpanEnd(): Span {\n if (!span) {\n return originalEnd();\n }\n // onProfileHandler should always return the same profile even if this is called multiple times.\n // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n void onProfileHandler().then(\n () => {\n originalEnd();\n },\n () => {\n // If onProfileHandler fails, we still want to call the original finish method.\n originalEnd();\n },\n );\n\n return span;\n }\n\n span.end = profilingWrappedSpanEnd;\n}\n"],"names":["isAutomatedPageLoadSpan","timestampInSeconds","startJSSelfProfile","DEBUG_BUILD","debug","spanToJSON","uuid4","getCurrentScope","PROFILED_ROOT_SPANS","setThreadAttributes","WINDOW","addProfileToGlobalCache","MAX_PROFILE_DURATION_MS"],"mappings":";;;;;;;AAmBO,SAAS,oBAAoB,IAAA,EAAkB;AAEpD,EAAA,IAAI,cAAA;AACJ,EAAA,IAAIA,6BAAA,CAAwB,IAAI,CAAA,EAAG;AACjC,IAAA,cAAA,GAAiBC,4BAAmB,GAAI,GAAA;AAAA,EAC1C;AAEA,EAAA,MAAM,WAAWC,wBAAA,EAAmB;AAIpC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AAEA,EAAA,IAAIC,sBAAA,EAAa;AACf,IAAAC,aAAA,CAAM,IAAI,CAAA,oCAAA,EAAuCC,kBAAA,CAAW,IAAI,CAAA,CAAE,WAAW,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AACA,QAAA;AAAA,MACF;AAEA,MAAA,gBAAA,GAAmB,OAAA;AACnB,MAAAM,6BAAA,CAAwB,WAAW,OAAO,CAAA;AAAA,IAC5C,CAAC,CAAA,CACA,KAAA,CAAM,CAAA,KAAA,KAAS;AACd,MAAA,IAAIR,sBAAA,EAAa;AACf,QAAAC,aAAA,CAAM,GAAA,CAAI,8CAA8C,KAAK,CAAA;AAAA,MAC/D;AAAA,IACF,CAAC,CAAA;AAAA,EACL;AAGA,EAAA,IAAI,oBAAA,GAA2CM,cAAA,CAAO,UAAA,CAAW,MAAM;AACrE,IAAA,IAAIP,sBAAA,EAAa;AACf,MAAAC,aAAA,CAAM,GAAA,CAAI,mEAAA,EAAqEC,kBAAA,CAAW,IAAI,EAAE,WAAW,CAAA;AAAA,IAC7G;AAGA,IAAA,gBAAA,EAAiB;AAAA,EACnB,GAAGO,6BAAuB,CAAA;AAG1B,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAOtC,EAAA,SAAS,uBAAA,GAAgC;AACvC,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,OAAO,WAAA,EAAY;AAAA,IACrB;AAGA,IAAA,KAAK,kBAAiB,CAAE,IAAA;AAAA,MACtB,MAAM;AACJ,QAAA,WAAA,EAAY;AAAA,MACd,CAAA;AAAA,MACA,MAAM;AAEJ,QAAA,WAAA,EAAY;AAAA,MACd;AAAA,KACF;AAEA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAA,CAAK,GAAA,GAAM,uBAAA;AACb;;;;"}
@@ -1,91 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const browser = require('@sentry/core/browser');
4
- const debugBuild = require('../debug-build.js');
5
- const helpers = require('../helpers.js');
6
- const utils = require('./utils.js');
7
-
8
- function startProfileForSpan(span) {
9
- let startTimestamp;
10
- if (utils.isAutomatedPageLoadSpan(span)) {
11
- startTimestamp = browser.timestampInSeconds() * 1e3;
12
- }
13
- const profiler = utils.startJSSelfProfile();
14
- if (!profiler) {
15
- return;
16
- }
17
- if (debugBuild.DEBUG_BUILD) {
18
- browser.debug.log(`[Profiling] started profiling span: ${browser.spanToJSON(span).description}`);
19
- }
20
- const profileId = browser.uuid4();
21
- let processedProfile = null;
22
- browser.getCurrentScope().setContext("profile", {
23
- profile_id: profileId,
24
- start_timestamp: startTimestamp
25
- });
26
- utils.PROFILED_ROOT_SPANS.add(span);
27
- utils.setThreadAttributes(span);
28
- async function onProfileHandler() {
29
- if (!span) {
30
- return;
31
- }
32
- if (!profiler) {
33
- return;
34
- }
35
- if (processedProfile) {
36
- if (debugBuild.DEBUG_BUILD) {
37
- browser.debug.log("[Profiling] profile for:", browser.spanToJSON(span).description, "already exists, returning early");
38
- }
39
- return;
40
- }
41
- return profiler.stop().then((profile) => {
42
- if (maxDurationTimeoutID) {
43
- helpers.WINDOW.clearTimeout(maxDurationTimeoutID);
44
- maxDurationTimeoutID = void 0;
45
- }
46
- if (debugBuild.DEBUG_BUILD) {
47
- browser.debug.log(`[Profiling] stopped profiling of span: ${browser.spanToJSON(span).description}`);
48
- }
49
- if (!profile) {
50
- if (debugBuild.DEBUG_BUILD) {
51
- browser.debug.log(
52
- `[Profiling] profiler returned null profile for: ${browser.spanToJSON(span).description}`,
53
- "this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started"
54
- );
55
- }
56
- return;
57
- }
58
- processedProfile = profile;
59
- utils.addProfileToGlobalCache(profileId, profile);
60
- }).catch((error) => {
61
- if (debugBuild.DEBUG_BUILD) {
62
- browser.debug.log("[Profiling] error while stopping profiler:", error);
63
- }
64
- });
65
- }
66
- let maxDurationTimeoutID = helpers.WINDOW.setTimeout(() => {
67
- if (debugBuild.DEBUG_BUILD) {
68
- browser.debug.log("[Profiling] max profile duration elapsed, stopping profiling for:", browser.spanToJSON(span).description);
69
- }
70
- onProfileHandler();
71
- }, utils.MAX_PROFILE_DURATION_MS);
72
- const originalEnd = span.end.bind(span);
73
- function profilingWrappedSpanEnd() {
74
- if (!span) {
75
- return originalEnd();
76
- }
77
- void onProfileHandler().then(
78
- () => {
79
- originalEnd();
80
- },
81
- () => {
82
- originalEnd();
83
- }
84
- );
85
- return span;
86
- }
87
- span.end = profilingWrappedSpanEnd;
88
- }
89
-
90
- exports.startProfileForSpan = startProfileForSpan;
91
- //# sourceMappingURL=startProfileForSpan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startProfileForSpan.js","sources":["../../../../../src/profiling/startProfileForSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { debug, getCurrentScope, spanToJSON, timestampInSeconds, uuid4 } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile } from './jsSelfProfiling';\nimport {\n addProfileToGlobalCache,\n isAutomatedPageLoadSpan,\n MAX_PROFILE_DURATION_MS,\n PROFILED_ROOT_SPANS,\n setThreadAttributes,\n startJSSelfProfile,\n} from './utils';\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nexport function startProfileForSpan(span: Span): void {\n // Start the profiler and get the profiler instance.\n let startTimestamp: number | undefined;\n if (isAutomatedPageLoadSpan(span)) {\n startTimestamp = timestampInSeconds() * 1000;\n }\n\n const profiler = startJSSelfProfile();\n\n // We failed to construct the profiler, so we skip.\n // No need to log anything as this has already been logged in startProfile.\n if (!profiler) {\n return;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);\n }\n\n // We create \"unique\" span names to avoid concurrent spans with same names\n // from being ignored by the profiler. From here on, only this span name should be used when\n // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n const profileId = uuid4();\n\n // A couple of important things to note here:\n // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n // Whichever of the two (span.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n // will be processed when the original span is finished. Since onProfileHandler can be invoked multiple times in the\n // event of an error or user mistake (calling span.finish multiple times), it is important that the behavior of onProfileHandler\n // is idempotent as we do not want any timings or profiles to be overridden by the last call to onProfileHandler.\n // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n let processedProfile: JSSelfProfile | null = null;\n\n getCurrentScope().setContext('profile', {\n profile_id: profileId,\n start_timestamp: startTimestamp,\n });\n\n PROFILED_ROOT_SPANS.add(span);\n setThreadAttributes(span);\n\n /**\n * Idempotent handler for profile stop\n */\n async function onProfileHandler(): Promise<void> {\n // Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times.\n if (!span) {\n return;\n }\n // Satisfy the type checker, but profiler will always be defined here.\n if (!profiler) {\n return;\n }\n if (processedProfile) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] profile for:', spanToJSON(span).description, 'already exists, returning early');\n }\n return;\n }\n\n return profiler\n .stop()\n .then((profile: JSSelfProfile): void => {\n if (maxDurationTimeoutID) {\n WINDOW.clearTimeout(maxDurationTimeoutID);\n maxDurationTimeoutID = undefined;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);\n }\n\n // In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.\n if (!profile) {\n if (DEBUG_BUILD) {\n debug.log(\n `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,\n 'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',\n );\n }\n return;\n }\n\n processedProfile = profile;\n addProfileToGlobalCache(profileId, profile);\n })\n .catch(error => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] error while stopping profiler:', error);\n }\n });\n }\n\n // Enqueue a timeout to prevent profiles from running over max duration.\n let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', spanToJSON(span).description);\n }\n // If the timeout exceeds, we want to stop profiling, but not finish the span\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n onProfileHandler();\n }, MAX_PROFILE_DURATION_MS);\n\n // We need to reference the original end call to avoid creating an infinite loop\n const originalEnd = span.end.bind(span);\n\n /**\n * Wraps span `end()` with profiling related logic.\n * startProfiling is called after the call to spanStart in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd.\n */\n function profilingWrappedSpanEnd(): Span {\n if (!span) {\n return originalEnd();\n }\n // onProfileHandler should always return the same profile even if this is called multiple times.\n // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n void onProfileHandler().then(\n () => {\n originalEnd();\n },\n () => {\n // If onProfileHandler fails, we still want to call the original finish method.\n originalEnd();\n },\n );\n\n return span;\n }\n\n span.end = profilingWrappedSpanEnd;\n}\n"],"names":["isAutomatedPageLoadSpan","timestampInSeconds","startJSSelfProfile","DEBUG_BUILD","debug","spanToJSON","uuid4","getCurrentScope","PROFILED_ROOT_SPANS","setThreadAttributes","WINDOW","addProfileToGlobalCache","MAX_PROFILE_DURATION_MS"],"mappings":";;;;;;;AAmBO,SAAS,oBAAoB,IAAA,EAAkB;AAEpD,EAAA,IAAI,cAAA;AACJ,EAAA,IAAIA,6BAAA,CAAwB,IAAI,CAAA,EAAG;AACjC,IAAA,cAAA,GAAiBC,4BAAmB,GAAI,GAAA;AAAA,EAC1C;AAEA,EAAA,MAAM,WAAWC,wBAAA,EAAmB;AAIpC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AAEA,EAAA,IAAIC,sBAAA,EAAa;AACf,IAAAC,aAAA,CAAM,IAAI,CAAA,oCAAA,EAAuCC,kBAAA,CAAW,IAAI,CAAA,CAAE,WAAW,CAAA,CAAE,CAAA;AAAA,EACjF;AAKA,EAAA,MAAM,YAAYC,aAAA,EAAM;AASxB,EAAA,IAAI,gBA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AAO,CAAA;AAAA,IAC5C,CAAC,CAAA,CACA,KAAA,CAAM,CAAA,KAAA,KAAS;AACd,MAAA,IAAIR,sBAAA,EAAa;AACf,QAAAC,aAAA,CAAM,GAAA,CAAI,8CAA8C,KAAK,CAAA;AAAA,MAC/D;AAAA,IACF,CAAC,CAAA;AAAA,EACL;AAGA,EAAA,IAAI,oBAAA,GAA2CM,cAAA,CAAO,UAAA,CAAW,MAAM;AACrE,IAAA,IAAIP,sBAAA,EAAa;AACf,MAAAC,aAAA,CAAM,GAAA,CAAI,mEAAA,EAAqEC,kBAAA,CAAW,IAAI,EAAE,WAAW,CAAA;AAAA,IAC7G;AAGA,IAAA,gBAAA,EAAiB;AAAA,EACnB,GAAGO,6BAAuB,CAAA;AAG1B,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAOtC,EAAA,SAAS,uBAAA,GAAgC;AACvC,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,OAAO,WAAA,EAAY;AAAA,IACrB;AAGA,IAAA,KAAK,kBAAiB,CAAE,IAAA;AAAA,MACtB,MAAM;AACJ,QAAA,WAAA,EAAY;AAAA,MACd,CAAA;AAAA,MACA,MAAM;AAEJ,QAAA,WAAA,EAAY;AAAA,MACd;AAAA,KACF;AAEA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAA,CAAK,GAAA,GAAM,uBAAA;AACb;;;;"}
@@ -1,89 +0,0 @@
1
- import { timestampInSeconds, debug, spanToJSON, uuid4, getCurrentScope } from '@sentry/core/browser';
2
- import { DEBUG_BUILD } from '../debug-build.js';
3
- import { WINDOW } from '../helpers.js';
4
- import { isAutomatedPageLoadSpan, startJSSelfProfile, PROFILED_ROOT_SPANS, setThreadAttributes, MAX_PROFILE_DURATION_MS, addProfileToGlobalCache } from './utils.js';
5
-
6
- function startProfileForSpan(span) {
7
- let startTimestamp;
8
- if (isAutomatedPageLoadSpan(span)) {
9
- startTimestamp = timestampInSeconds() * 1e3;
10
- }
11
- const profiler = startJSSelfProfile();
12
- if (!profiler) {
13
- return;
14
- }
15
- if (DEBUG_BUILD) {
16
- debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);
17
- }
18
- const profileId = uuid4();
19
- let processedProfile = null;
20
- getCurrentScope().setContext("profile", {
21
- profile_id: profileId,
22
- start_timestamp: startTimestamp
23
- });
24
- PROFILED_ROOT_SPANS.add(span);
25
- setThreadAttributes(span);
26
- async function onProfileHandler() {
27
- if (!span) {
28
- return;
29
- }
30
- if (!profiler) {
31
- return;
32
- }
33
- if (processedProfile) {
34
- if (DEBUG_BUILD) {
35
- debug.log("[Profiling] profile for:", spanToJSON(span).description, "already exists, returning early");
36
- }
37
- return;
38
- }
39
- return profiler.stop().then((profile) => {
40
- if (maxDurationTimeoutID) {
41
- WINDOW.clearTimeout(maxDurationTimeoutID);
42
- maxDurationTimeoutID = void 0;
43
- }
44
- if (DEBUG_BUILD) {
45
- debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);
46
- }
47
- if (!profile) {
48
- if (DEBUG_BUILD) {
49
- debug.log(
50
- `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,
51
- "this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started"
52
- );
53
- }
54
- return;
55
- }
56
- processedProfile = profile;
57
- addProfileToGlobalCache(profileId, profile);
58
- }).catch((error) => {
59
- if (DEBUG_BUILD) {
60
- debug.log("[Profiling] error while stopping profiler:", error);
61
- }
62
- });
63
- }
64
- let maxDurationTimeoutID = WINDOW.setTimeout(() => {
65
- if (DEBUG_BUILD) {
66
- debug.log("[Profiling] max profile duration elapsed, stopping profiling for:", spanToJSON(span).description);
67
- }
68
- onProfileHandler();
69
- }, MAX_PROFILE_DURATION_MS);
70
- const originalEnd = span.end.bind(span);
71
- function profilingWrappedSpanEnd() {
72
- if (!span) {
73
- return originalEnd();
74
- }
75
- void onProfileHandler().then(
76
- () => {
77
- originalEnd();
78
- },
79
- () => {
80
- originalEnd();
81
- }
82
- );
83
- return span;
84
- }
85
- span.end = profilingWrappedSpanEnd;
86
- }
87
-
88
- export { startProfileForSpan };
89
- //# sourceMappingURL=startProfileForSpan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startProfileForSpan.js","sources":["../../../../../src/profiling/startProfileForSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { debug, getCurrentScope, spanToJSON, timestampInSeconds, uuid4 } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile } from './jsSelfProfiling';\nimport {\n addProfileToGlobalCache,\n isAutomatedPageLoadSpan,\n MAX_PROFILE_DURATION_MS,\n PROFILED_ROOT_SPANS,\n setThreadAttributes,\n startJSSelfProfile,\n} from './utils';\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nexport function startProfileForSpan(span: Span): void {\n // Start the profiler and get the profiler instance.\n let startTimestamp: number | undefined;\n if (isAutomatedPageLoadSpan(span)) {\n startTimestamp = timestampInSeconds() * 1000;\n }\n\n const profiler = startJSSelfProfile();\n\n // We failed to construct the profiler, so we skip.\n // No need to log anything as this has already been logged in startProfile.\n if (!profiler) {\n return;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);\n }\n\n // We create \"unique\" span names to avoid concurrent spans with same names\n // from being ignored by the profiler. From here on, only this span name should be used when\n // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n const profileId = uuid4();\n\n // A couple of important things to note here:\n // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n // Whichever of the two (span.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n // will be processed when the original span is finished. Since onProfileHandler can be invoked multiple times in the\n // event of an error or user mistake (calling span.finish multiple times), it is important that the behavior of onProfileHandler\n // is idempotent as we do not want any timings or profiles to be overridden by the last call to onProfileHandler.\n // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n let processedProfile: JSSelfProfile | null = null;\n\n getCurrentScope().setContext('profile', {\n profile_id: profileId,\n start_timestamp: startTimestamp,\n });\n\n PROFILED_ROOT_SPANS.add(span);\n setThreadAttributes(span);\n\n /**\n * Idempotent handler for profile stop\n */\n async function onProfileHandler(): Promise<void> {\n // Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times.\n if (!span) {\n return;\n }\n // Satisfy the type checker, but profiler will always be defined here.\n if (!profiler) {\n return;\n }\n if (processedProfile) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] profile for:', spanToJSON(span).description, 'already exists, returning early');\n }\n return;\n }\n\n return profiler\n .stop()\n .then((profile: JSSelfProfile): void => {\n if (maxDurationTimeoutID) {\n WINDOW.clearTimeout(maxDurationTimeoutID);\n maxDurationTimeoutID = undefined;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);\n }\n\n // In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.\n if (!profile) {\n if (DEBUG_BUILD) {\n debug.log(\n `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,\n 'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',\n );\n }\n return;\n }\n\n processedProfile = profile;\n addProfileToGlobalCache(profileId, profile);\n })\n .catch(error => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] error while stopping profiler:', error);\n }\n });\n }\n\n // Enqueue a timeout to prevent profiles from running over max duration.\n let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', spanToJSON(span).description);\n }\n // If the timeout exceeds, we want to stop profiling, but not finish the span\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n onProfileHandler();\n }, MAX_PROFILE_DURATION_MS);\n\n // We need to reference the original end call to avoid creating an infinite loop\n const originalEnd = span.end.bind(span);\n\n /**\n * Wraps span `end()` with profiling related logic.\n * startProfiling is called after the call to spanStart in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd.\n */\n function profilingWrappedSpanEnd(): Span {\n if (!span) {\n return originalEnd();\n }\n // onProfileHandler should always return the same profile even if this is called multiple times.\n // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n void onProfileHandler().then(\n () => {\n originalEnd();\n },\n () => {\n // If onProfileHandler fails, we still want to call the original finish method.\n originalEnd();\n },\n );\n\n return span;\n }\n\n span.end = profilingWrappedSpanEnd;\n}\n"],"names":[],"mappings":";;;;;AAmBO,SAAS,oBAAoB,IAAA,EAAkB;AAEpD,EAAA,IAAI,cAAA;AACJ,EAAA,IAAI,uBAAA,CAAwB,IAAI,CAAA,EAAG;AACjC,IAAA,cAAA,GAAiB,oBAAmB,GAAI,GAAA;AAAA,EAC1C;AAEA,EAAA,MAAM,WAAW,kBAAA,EAAmB;AAIpC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,KAAA,CAAM,IAAI,CAAA,oCAAA,EAAuC,UAAA,CAAW,IAAI,CAAA,CAAE,WAAW,CAAA,CAAE,CAAA;AAAA,EACjF;AAKA,EAAA,MAAM,YAAY,KAAA,EAAM;AASxB,EAAA,IAAI,gBAAA,GAAyC,IAAA;AAE7C,EAAA,eAAA,EAAgB,CAAE,WAAW,SAAA,EAAW;AAAA,IACtC,UAAA,EAAY,SAAA;AAAA,IACZ,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,mBAAA,CAAoB,IAAI,IAAI,CAAA;AAC5B,EAAA,mBAAA,CAAoB,IAAI,CAAA;AAKxB,EAAA,eAAe,gBAAA,GAAkC;AAE/C,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAA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,mEAAA,EAAqE,UAAA,CAAW,IAAI,EAAE,WAAW,CAAA;AAAA,IAC7G;AAGA,IAAA,gBAAA,EAAiB;AAAA,EACnB,GAAG,uBAAuB,CAAA;AAG1B,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAOtC,EAAA,SAAS,uBAAA,GAAgC;AACvC,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,OAAO,WAAA,EAAY;AAAA,IACrB;AAGA,IAAA,KAAK,kBAAiB,CAAE,IAAA;AAAA,MACtB,MAAM;AACJ,QAAA,WAAA,EAAY;AAAA,MACd,CAAA;AAAA,MACA,MAAM;AAEJ,QAAA,WAAA,EAAY;AAAA,MACd;AAAA,KACF;AAEA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAA,CAAK,GAAA,GAAM,uBAAA;AACb;;;;"}
@@ -1,89 +0,0 @@
1
- import { timestampInSeconds, debug, spanToJSON, uuid4, getCurrentScope } from '@sentry/core/browser';
2
- import { DEBUG_BUILD } from '../debug-build.js';
3
- import { WINDOW } from '../helpers.js';
4
- import { isAutomatedPageLoadSpan, startJSSelfProfile, PROFILED_ROOT_SPANS, setThreadAttributes, MAX_PROFILE_DURATION_MS, addProfileToGlobalCache } from './utils.js';
5
-
6
- function startProfileForSpan(span) {
7
- let startTimestamp;
8
- if (isAutomatedPageLoadSpan(span)) {
9
- startTimestamp = timestampInSeconds() * 1e3;
10
- }
11
- const profiler = startJSSelfProfile();
12
- if (!profiler) {
13
- return;
14
- }
15
- if (DEBUG_BUILD) {
16
- debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);
17
- }
18
- const profileId = uuid4();
19
- let processedProfile = null;
20
- getCurrentScope().setContext("profile", {
21
- profile_id: profileId,
22
- start_timestamp: startTimestamp
23
- });
24
- PROFILED_ROOT_SPANS.add(span);
25
- setThreadAttributes(span);
26
- async function onProfileHandler() {
27
- if (!span) {
28
- return;
29
- }
30
- if (!profiler) {
31
- return;
32
- }
33
- if (processedProfile) {
34
- if (DEBUG_BUILD) {
35
- debug.log("[Profiling] profile for:", spanToJSON(span).description, "already exists, returning early");
36
- }
37
- return;
38
- }
39
- return profiler.stop().then((profile) => {
40
- if (maxDurationTimeoutID) {
41
- WINDOW.clearTimeout(maxDurationTimeoutID);
42
- maxDurationTimeoutID = void 0;
43
- }
44
- if (DEBUG_BUILD) {
45
- debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);
46
- }
47
- if (!profile) {
48
- if (DEBUG_BUILD) {
49
- debug.log(
50
- `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,
51
- "this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started"
52
- );
53
- }
54
- return;
55
- }
56
- processedProfile = profile;
57
- addProfileToGlobalCache(profileId, profile);
58
- }).catch((error) => {
59
- if (DEBUG_BUILD) {
60
- debug.log("[Profiling] error while stopping profiler:", error);
61
- }
62
- });
63
- }
64
- let maxDurationTimeoutID = WINDOW.setTimeout(() => {
65
- if (DEBUG_BUILD) {
66
- debug.log("[Profiling] max profile duration elapsed, stopping profiling for:", spanToJSON(span).description);
67
- }
68
- onProfileHandler();
69
- }, MAX_PROFILE_DURATION_MS);
70
- const originalEnd = span.end.bind(span);
71
- function profilingWrappedSpanEnd() {
72
- if (!span) {
73
- return originalEnd();
74
- }
75
- void onProfileHandler().then(
76
- () => {
77
- originalEnd();
78
- },
79
- () => {
80
- originalEnd();
81
- }
82
- );
83
- return span;
84
- }
85
- span.end = profilingWrappedSpanEnd;
86
- }
87
-
88
- export { startProfileForSpan };
89
- //# sourceMappingURL=startProfileForSpan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startProfileForSpan.js","sources":["../../../../../src/profiling/startProfileForSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { debug, getCurrentScope, spanToJSON, timestampInSeconds, uuid4 } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile } from './jsSelfProfiling';\nimport {\n addProfileToGlobalCache,\n isAutomatedPageLoadSpan,\n MAX_PROFILE_DURATION_MS,\n PROFILED_ROOT_SPANS,\n setThreadAttributes,\n startJSSelfProfile,\n} from './utils';\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nexport function startProfileForSpan(span: Span): void {\n // Start the profiler and get the profiler instance.\n let startTimestamp: number | undefined;\n if (isAutomatedPageLoadSpan(span)) {\n startTimestamp = timestampInSeconds() * 1000;\n }\n\n const profiler = startJSSelfProfile();\n\n // We failed to construct the profiler, so we skip.\n // No need to log anything as this has already been logged in startProfile.\n if (!profiler) {\n return;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);\n }\n\n // We create \"unique\" span names to avoid concurrent spans with same names\n // from being ignored by the profiler. From here on, only this span name should be used when\n // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n const profileId = uuid4();\n\n // A couple of important things to note here:\n // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n // Whichever of the two (span.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n // will be processed when the original span is finished. Since onProfileHandler can be invoked multiple times in the\n // event of an error or user mistake (calling span.finish multiple times), it is important that the behavior of onProfileHandler\n // is idempotent as we do not want any timings or profiles to be overridden by the last call to onProfileHandler.\n // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n let processedProfile: JSSelfProfile | null = null;\n\n getCurrentScope().setContext('profile', {\n profile_id: profileId,\n start_timestamp: startTimestamp,\n });\n\n PROFILED_ROOT_SPANS.add(span);\n setThreadAttributes(span);\n\n /**\n * Idempotent handler for profile stop\n */\n async function onProfileHandler(): Promise<void> {\n // Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times.\n if (!span) {\n return;\n }\n // Satisfy the type checker, but profiler will always be defined here.\n if (!profiler) {\n return;\n }\n if (processedProfile) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] profile for:', spanToJSON(span).description, 'already exists, returning early');\n }\n return;\n }\n\n return profiler\n .stop()\n .then((profile: JSSelfProfile): void => {\n if (maxDurationTimeoutID) {\n WINDOW.clearTimeout(maxDurationTimeoutID);\n maxDurationTimeoutID = undefined;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);\n }\n\n // In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.\n if (!profile) {\n if (DEBUG_BUILD) {\n debug.log(\n `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,\n 'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',\n );\n }\n return;\n }\n\n processedProfile = profile;\n addProfileToGlobalCache(profileId, profile);\n })\n .catch(error => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] error while stopping profiler:', error);\n }\n });\n }\n\n // Enqueue a timeout to prevent profiles from running over max duration.\n let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', spanToJSON(span).description);\n }\n // If the timeout exceeds, we want to stop profiling, but not finish the span\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n onProfileHandler();\n }, MAX_PROFILE_DURATION_MS);\n\n // We need to reference the original end call to avoid creating an infinite loop\n const originalEnd = span.end.bind(span);\n\n /**\n * Wraps span `end()` with profiling related logic.\n * startProfiling is called after the call to spanStart in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd.\n */\n function profilingWrappedSpanEnd(): Span {\n if (!span) {\n return originalEnd();\n }\n // onProfileHandler should always return the same profile even if this is called multiple times.\n // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n void onProfileHandler().then(\n () => {\n originalEnd();\n },\n () => {\n // If onProfileHandler fails, we still want to call the original finish method.\n originalEnd();\n },\n );\n\n return span;\n }\n\n span.end = profilingWrappedSpanEnd;\n}\n"],"names":[],"mappings":";;;;;AAmBO,SAAS,oBAAoB,IAAA,EAAkB;AAEpD,EAAA,IAAI,cAAA;AACJ,EAAA,IAAI,uBAAA,CAAwB,IAAI,CAAA,EAAG;AACjC,IAAA,cAAA,GAAiB,oBAAmB,GAAI,GAAA;AAAA,EAC1C;AAEA,EAAA,MAAM,WAAW,kBAAA,EAAmB;AAIpC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,KAAA,CAAM,IAAI,CAAA,oCAAA,EAAuC,UAAA,CAAW,IAAI,CAAA,CAAE,WAAW,CAAA,CAAE,CAAA;AAAA,EACjF;AAKA,EAAA,MAAM,YAAY,KAAA,EAAM;AASxB,EAAA,IAAI,gBAAA,GAAyC,IAAA;AAE7C,EAAA,eAAA,EAAgB,CAAE,WAAW,SAAA,EAAW;AAAA,IACtC,UAAA,EAAY,SAAA;AAAA,IACZ,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,mBAAA,CAAoB,IAAI,IAAI,CAAA;AAC5B,EAAA,mBAAA,CAAoB,IAAI,CAAA;AAKxB,EAAA,eAAe,gBAAA,GAAkC;AAE/C,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA;AAAA,IACF;AAEA,IAAA,IAAI,CAAC,QAAA,EAAU;AACb,MAAA;AAAA,IACF;AACA,IAAA,IAAI,gBAAA,EAAkB;AACpB,MAAA,IAAI,WAAA,EAAa;AACf,QAAA,KAAA,CAAM,IAAI,0BAAA,EAA4B,UAAA,CAAW,IAAI,CAAA,CAAE,aAAa,iCAAiC,CAAA;AAAA,MACvG;AACA,MAAA;AAAA,IACF;AAEA,IAAA,OAAO,QAAA,CACJ,IAAA,EAAK,CACL,IAAA,CAAK,CAAC,OAAA,KAAiC;AAC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CAAE,IAAA;AAAA,MACtB,MAAM;AACJ,QAAA,WAAA,EAAY;AAAA,MACd,CAAA;AAAA,MACA,MAAM;AAEJ,QAAA,WAAA,EAAY;AAAA,MACd;AAAA,KACF;AAEA,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAA,CAAK,GAAA,GAAM,uBAAA;AACb;;;;"}
@@ -1,8 +0,0 @@
1
- import type { Span } from '@sentry/core/browser';
2
- /**
3
- * Wraps startTransaction and stopTransaction with profiling related logic.
4
- * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from
5
- * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.
6
- */
7
- export declare function startProfileForSpan(span: Span): void;
8
- //# sourceMappingURL=startProfileForSpan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startProfileForSpan.d.ts","sourceRoot":"","sources":["../../../../src/profiling/startProfileForSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAcjD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAmIpD"}