@sentry/profiling-node 8.9.2 → 8.10.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 (153) hide show
  1. package/bindings/cpu_profiler.cc +2 -2
  2. package/lib/cjs/index.js +743 -33
  3. package/lib/cjs/index.js.map +1 -1
  4. package/lib/esm/index.js +744 -34
  5. package/lib/esm/index.js.map +1 -1
  6. package/lib/sentry_cpu_profiler-darwin-arm64-108.node +0 -0
  7. package/lib/sentry_cpu_profiler-darwin-arm64-115.node +0 -0
  8. package/lib/sentry_cpu_profiler-darwin-arm64-127.node +0 -0
  9. package/lib/sentry_cpu_profiler-darwin-arm64-93.node +0 -0
  10. package/lib/sentry_cpu_profiler-darwin-x64-108.node +0 -0
  11. package/lib/sentry_cpu_profiler-darwin-x64-115.node +0 -0
  12. package/lib/sentry_cpu_profiler-darwin-x64-127.node +0 -0
  13. package/lib/sentry_cpu_profiler-darwin-x64-93.node +0 -0
  14. package/lib/sentry_cpu_profiler-linux-arm64-glibc-108.node +0 -0
  15. package/lib/sentry_cpu_profiler-linux-arm64-glibc-115.node +0 -0
  16. package/lib/sentry_cpu_profiler-linux-arm64-glibc-127.node +0 -0
  17. package/lib/sentry_cpu_profiler-linux-arm64-glibc-93.node +0 -0
  18. package/lib/sentry_cpu_profiler-linux-arm64-musl-108.node +0 -0
  19. package/lib/sentry_cpu_profiler-linux-arm64-musl-115.node +0 -0
  20. package/lib/sentry_cpu_profiler-linux-arm64-musl-127.node +0 -0
  21. package/lib/sentry_cpu_profiler-linux-arm64-musl-93.node +0 -0
  22. package/lib/sentry_cpu_profiler-linux-x64-glibc-108.node +0 -0
  23. package/lib/sentry_cpu_profiler-linux-x64-glibc-115.node +0 -0
  24. package/lib/sentry_cpu_profiler-linux-x64-glibc-127.node +0 -0
  25. package/lib/sentry_cpu_profiler-linux-x64-glibc-93.node +0 -0
  26. package/lib/sentry_cpu_profiler-linux-x64-musl-108.node +0 -0
  27. package/lib/sentry_cpu_profiler-linux-x64-musl-115.node +0 -0
  28. package/lib/sentry_cpu_profiler-linux-x64-musl-127.node +0 -0
  29. package/lib/sentry_cpu_profiler-linux-x64-musl-93.node +0 -0
  30. package/lib/sentry_cpu_profiler-win32-x64-108.node +0 -0
  31. package/lib/sentry_cpu_profiler-win32-x64-115.node +0 -0
  32. package/lib/sentry_cpu_profiler-win32-x64-127.node +0 -0
  33. package/lib/sentry_cpu_profiler-win32-x64-93.node +0 -0
  34. package/lib/types/core/src/asyncContext/index.d.ts +14 -0
  35. package/lib/types/core/src/asyncContext/index.d.ts.map +1 -0
  36. package/lib/types/core/src/asyncContext/stackStrategy.d.ts +52 -0
  37. package/lib/types/core/src/asyncContext/stackStrategy.d.ts.map +1 -0
  38. package/lib/types/core/src/asyncContext/types.d.ts +47 -0
  39. package/lib/types/core/src/asyncContext/types.d.ts.map +1 -0
  40. package/lib/types/core/src/carrier.d.ts +37 -0
  41. package/lib/types/core/src/carrier.d.ts.map +1 -0
  42. package/lib/types/core/src/constants.d.ts +2 -0
  43. package/lib/types/core/src/constants.d.ts.map +1 -0
  44. package/lib/types/core/src/currentScopes.d.ts +55 -0
  45. package/lib/types/core/src/currentScopes.d.ts.map +1 -0
  46. package/lib/types/core/src/debug-build.d.ts.map +1 -0
  47. package/lib/types/core/src/defaultScopes.d.ts +6 -0
  48. package/lib/types/core/src/defaultScopes.d.ts.map +1 -0
  49. package/lib/types/core/src/envelope.d.ts +15 -0
  50. package/lib/types/core/src/envelope.d.ts.map +1 -0
  51. package/lib/types/core/src/metrics/constants.d.ts +19 -0
  52. package/lib/types/core/src/metrics/constants.d.ts.map +1 -0
  53. package/lib/types/core/src/metrics/metric-summary.d.ts +13 -0
  54. package/lib/types/core/src/metrics/metric-summary.d.ts.map +1 -0
  55. package/lib/types/core/src/metrics/types.d.ts +5 -0
  56. package/lib/types/core/src/metrics/types.d.ts.map +1 -0
  57. package/lib/types/core/src/scope.d.ts +211 -0
  58. package/lib/types/core/src/scope.d.ts.map +1 -0
  59. package/lib/types/core/src/semanticAttributes.d.ts +33 -0
  60. package/lib/types/core/src/semanticAttributes.d.ts.map +1 -0
  61. package/lib/types/core/src/session.d.ts +35 -0
  62. package/lib/types/core/src/session.d.ts.map +1 -0
  63. package/lib/types/core/src/tracing/dynamicSamplingContext.d.ts +24 -0
  64. package/lib/types/core/src/tracing/dynamicSamplingContext.d.ts.map +1 -0
  65. package/lib/types/core/src/tracing/logSpans.d.ts +10 -0
  66. package/lib/types/core/src/tracing/logSpans.d.ts.map +1 -0
  67. package/lib/types/core/src/tracing/measurement.d.ts +10 -0
  68. package/lib/types/core/src/tracing/measurement.d.ts.map +1 -0
  69. package/lib/types/core/src/tracing/sampling.d.ts +9 -0
  70. package/lib/types/core/src/tracing/sampling.d.ts.map +1 -0
  71. package/lib/types/core/src/tracing/sentryNonRecordingSpan.d.ts +26 -0
  72. package/lib/types/core/src/tracing/sentryNonRecordingSpan.d.ts.map +1 -0
  73. package/lib/types/core/src/tracing/sentrySpan.d.ts +86 -0
  74. package/lib/types/core/src/tracing/sentrySpan.d.ts.map +1 -0
  75. package/lib/types/core/src/tracing/spanstatus.d.ts +17 -0
  76. package/lib/types/core/src/tracing/spanstatus.d.ts.map +1 -0
  77. package/lib/types/core/src/tracing/trace.d.ts +76 -0
  78. package/lib/types/core/src/tracing/trace.d.ts.map +1 -0
  79. package/lib/types/core/src/tracing/utils.d.ts +13 -0
  80. package/lib/types/core/src/tracing/utils.d.ts.map +1 -0
  81. package/lib/types/core/src/utils/handleCallbackErrors.d.ts +13 -0
  82. package/lib/types/core/src/utils/handleCallbackErrors.d.ts.map +1 -0
  83. package/lib/types/core/src/utils/hasTracingEnabled.d.ts +8 -0
  84. package/lib/types/core/src/utils/hasTracingEnabled.d.ts.map +1 -0
  85. package/lib/types/core/src/utils/parseSampleRate.d.ts +9 -0
  86. package/lib/types/core/src/utils/parseSampleRate.d.ts.map +1 -0
  87. package/lib/types/core/src/utils/spanOnScope.d.ts +17 -0
  88. package/lib/types/core/src/utils/spanOnScope.d.ts.map +1 -0
  89. package/lib/types/core/src/utils/spanUtils.d.ts +74 -0
  90. package/lib/types/core/src/utils/spanUtils.d.ts.map +1 -0
  91. package/lib/types/profiling-node/src/cpu_profiler.d.ts.map +1 -0
  92. package/lib/types/profiling-node/src/debug-build.d.ts +7 -0
  93. package/lib/types/profiling-node/src/debug-build.d.ts.map +1 -0
  94. package/lib/types/profiling-node/src/index.d.ts.map +1 -0
  95. package/lib/types/{integration.d.ts → profiling-node/src/integration.d.ts} +18 -0
  96. package/lib/types/profiling-node/src/integration.d.ts.map +1 -0
  97. package/lib/types/profiling-node/src/nodeVersion.d.ts.map +1 -0
  98. package/lib/types/profiling-node/src/spanProfileUtils.d.ts.map +1 -0
  99. package/lib/types/profiling-node/src/types.d.ts.map +1 -0
  100. package/lib/types/{utils.d.ts → profiling-node/src/utils.d.ts} +3 -1
  101. package/lib/types/profiling-node/src/utils.d.ts.map +1 -0
  102. package/lib/types-ts3.8/core/src/asyncContext/index.d.ts +14 -0
  103. package/lib/types-ts3.8/core/src/asyncContext/stackStrategy.d.ts +52 -0
  104. package/lib/types-ts3.8/core/src/asyncContext/types.d.ts +47 -0
  105. package/lib/types-ts3.8/core/src/carrier.d.ts +37 -0
  106. package/lib/types-ts3.8/core/src/constants.d.ts +2 -0
  107. package/lib/types-ts3.8/core/src/currentScopes.d.ts +55 -0
  108. package/lib/types-ts3.8/core/src/defaultScopes.d.ts +6 -0
  109. package/lib/types-ts3.8/core/src/envelope.d.ts +18 -0
  110. package/lib/types-ts3.8/core/src/metrics/constants.d.ts +19 -0
  111. package/lib/types-ts3.8/core/src/metrics/metric-summary.d.ts +13 -0
  112. package/lib/types-ts3.8/core/src/metrics/types.d.ts +5 -0
  113. package/lib/types-ts3.8/core/src/scope.d.ts +211 -0
  114. package/lib/types-ts3.8/core/src/semanticAttributes.d.ts +33 -0
  115. package/lib/types-ts3.8/core/src/session.d.ts +35 -0
  116. package/lib/types-ts3.8/core/src/tracing/dynamicSamplingContext.d.ts +24 -0
  117. package/lib/types-ts3.8/core/src/tracing/logSpans.d.ts +10 -0
  118. package/lib/types-ts3.8/core/src/tracing/measurement.d.ts +10 -0
  119. package/lib/types-ts3.8/core/src/tracing/sampling.d.ts +12 -0
  120. package/lib/types-ts3.8/core/src/tracing/sentryNonRecordingSpan.d.ts +26 -0
  121. package/lib/types-ts3.8/core/src/tracing/sentrySpan.d.ts +86 -0
  122. package/lib/types-ts3.8/core/src/tracing/spanstatus.d.ts +17 -0
  123. package/lib/types-ts3.8/core/src/tracing/trace.d.ts +76 -0
  124. package/lib/types-ts3.8/core/src/tracing/utils.d.ts +13 -0
  125. package/lib/types-ts3.8/core/src/utils/handleCallbackErrors.d.ts +13 -0
  126. package/lib/types-ts3.8/core/src/utils/hasTracingEnabled.d.ts +8 -0
  127. package/lib/types-ts3.8/core/src/utils/parseSampleRate.d.ts +9 -0
  128. package/lib/types-ts3.8/core/src/utils/spanOnScope.d.ts +17 -0
  129. package/lib/types-ts3.8/core/src/utils/spanUtils.d.ts +74 -0
  130. package/lib/types-ts3.8/profiling-node/src/debug-build.d.ts +7 -0
  131. package/lib/types-ts3.8/{integration.d.ts → profiling-node/src/integration.d.ts} +18 -0
  132. package/lib/types-ts3.8/{utils.d.ts → profiling-node/src/utils.d.ts} +3 -1
  133. package/package.json +5 -5
  134. package/lib/types/cpu_profiler.d.ts.map +0 -1
  135. package/lib/types/debug-build.d.ts.map +0 -1
  136. package/lib/types/index.d.ts.map +0 -1
  137. package/lib/types/integration.d.ts.map +0 -1
  138. package/lib/types/nodeVersion.d.ts.map +0 -1
  139. package/lib/types/spanProfileUtils.d.ts.map +0 -1
  140. package/lib/types/types.d.ts.map +0 -1
  141. package/lib/types/utils.d.ts.map +0 -1
  142. /package/lib/types/{debug-build.d.ts → core/src/debug-build.d.ts} +0 -0
  143. /package/lib/types/{cpu_profiler.d.ts → profiling-node/src/cpu_profiler.d.ts} +0 -0
  144. /package/lib/types/{index.d.ts → profiling-node/src/index.d.ts} +0 -0
  145. /package/lib/types/{nodeVersion.d.ts → profiling-node/src/nodeVersion.d.ts} +0 -0
  146. /package/lib/types/{spanProfileUtils.d.ts → profiling-node/src/spanProfileUtils.d.ts} +0 -0
  147. /package/lib/types/{types.d.ts → profiling-node/src/types.d.ts} +0 -0
  148. /package/lib/types-ts3.8/{debug-build.d.ts → core/src/debug-build.d.ts} +0 -0
  149. /package/lib/types-ts3.8/{cpu_profiler.d.ts → profiling-node/src/cpu_profiler.d.ts} +0 -0
  150. /package/lib/types-ts3.8/{index.d.ts → profiling-node/src/index.d.ts} +0 -0
  151. /package/lib/types-ts3.8/{nodeVersion.d.ts → profiling-node/src/nodeVersion.d.ts} +0 -0
  152. /package/lib/types-ts3.8/{spanProfileUtils.d.ts → profiling-node/src/spanProfileUtils.d.ts} +0 -0
  153. /package/lib/types-ts3.8/{types.d.ts → profiling-node/src/types.d.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ import type { Span, SpanStatus } from '@sentry/types';
2
+ export declare const SPAN_STATUS_UNSET = 0;
3
+ export declare const SPAN_STATUS_OK = 1;
4
+ export declare const SPAN_STATUS_ERROR = 2;
5
+ /**
6
+ * Converts a HTTP status code into a sentry status with a message.
7
+ *
8
+ * @param httpStatus The HTTP response status code.
9
+ * @returns The span status or unknown_error.
10
+ */
11
+ export declare function getSpanStatusFromHttpCode(httpStatus: number): SpanStatus;
12
+ /**
13
+ * Sets the Http status attributes on the current span based on the http code.
14
+ * Additionally, the span's status is updated, depending on the http code.
15
+ */
16
+ export declare function setHttpStatus(span: Span, httpStatus: number): void;
17
+ //# sourceMappingURL=spanstatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanstatus.d.ts","sourceRoot":"","sources":["../../../../../../core/src/tracing/spanstatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;GAKG;AAEH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAwCxE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAOlE"}
@@ -0,0 +1,76 @@
1
+ import type { Scope, Span, StartSpanOptions } from '@sentry/types';
2
+ import { propagationContextFromHeaders } from '@sentry/utils';
3
+ /**
4
+ * Wraps a function with a transaction/span and finishes the span after the function is done.
5
+ * The created span is the active span and will be used as parent by other spans created inside the function
6
+ * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
7
+ *
8
+ * If you want to create a span that is not set as active, use {@link startInactiveSpan}.
9
+ *
10
+ * You'll always get a span passed to the callback,
11
+ * it may just be a non-recording span if the span is not sampled or if tracing is disabled.
12
+ */
13
+ export declare function startSpan<T>(context: StartSpanOptions, callback: (span: Span) => T): T;
14
+ /**
15
+ * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span
16
+ * after the function is done automatically. You'll have to call `span.end()` manually.
17
+ *
18
+ * The created span is the active span and will be used as parent by other spans created inside the function
19
+ * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
20
+ *
21
+ * You'll always get a span passed to the callback,
22
+ * it may just be a non-recording span if the span is not sampled or if tracing is disabled.
23
+ */
24
+ export declare function startSpanManual<T>(context: StartSpanOptions, callback: (span: Span, finish: () => void) => T): T;
25
+ /**
26
+ * Creates a span. This span is not set as active, so will not get automatic instrumentation spans
27
+ * as children or be able to be accessed via `Sentry.getActiveSpan()`.
28
+ *
29
+ * If you want to create a span that is set as active, use {@link startSpan}.
30
+ *
31
+ * This function will always return a span,
32
+ * it may just be a non-recording span if the span is not sampled or if tracing is disabled.
33
+ */
34
+ export declare function startInactiveSpan(context: StartSpanOptions): Span;
35
+ /**
36
+ * Continue a trace from `sentry-trace` and `baggage` values.
37
+ * These values can be obtained from incoming request headers, or in the browser from `<meta name="sentry-trace">`
38
+ * and `<meta name="baggage">` HTML tags.
39
+ *
40
+ * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically
41
+ * be attached to the incoming trace.
42
+ */
43
+ export declare const continueTrace: <V>({ sentryTrace, baggage, }: {
44
+ sentryTrace: Parameters<typeof propagationContextFromHeaders>[0];
45
+ baggage: Parameters<typeof propagationContextFromHeaders>[1];
46
+ }, callback: () => V) => V;
47
+ /**
48
+ * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be
49
+ * passed `null` to start an entirely new span tree.
50
+ *
51
+ * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,
52
+ * spans started within the callback will not be attached to a parent span.
53
+ * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.
54
+ * @returns the value returned from the provided callback function.
55
+ */
56
+ export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
57
+ /** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */
58
+ export declare function suppressTracing<T>(callback: () => T): T;
59
+ /**
60
+ * Starts a new trace for the duration of the provided callback. Spans started within the
61
+ * callback will be part of the new trace instead of a potentially previously started trace.
62
+ *
63
+ * Important: Only use this function if you want to override the default trace lifetime and
64
+ * propagation mechanism of the SDK for the duration and scope of the provided callback.
65
+ * The newly created trace will also be the root of a new distributed trace, for example if
66
+ * you make http requests within the callback.
67
+ * This function might be useful if the operation you want to instrument should not be part
68
+ * of a potentially ongoing trace.
69
+ *
70
+ * Default behavior:
71
+ * - Server-side: A new trace is started for each incoming request.
72
+ * - Browser: A new trace is started for each page our route. Navigating to a new route
73
+ * or page will automatically create a new trace.
74
+ */
75
+ export declare function startNewTrace<T>(callback: () => T): T;
76
+ //# sourceMappingURL=trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../../../../core/src/tracing/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,KAAK,EAAuB,IAAI,EAAiB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAsC,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAuBlG;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAmCtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAsChH;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAuBjE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;iBAKT,WAAW,oCAAoC,CAAC,CAAC,CAAC,CAAC;aACvD,WAAW,oCAAoC,CAAC,CAAC,CAAC,CAAC;0BAS/D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAUrF;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAWvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAMrD"}
@@ -0,0 +1,13 @@
1
+ import type { Span } from '@sentry/types';
2
+ import type { Scope } from '@sentry/types';
3
+ export { stripUrlQueryAndFragment } from '@sentry/utils';
4
+ /** Store the scope & isolation scope for a span, which can the be used when it is finished. */
5
+ export declare function setCapturedScopesOnSpan(span: Span | undefined, scope: Scope, isolationScope: Scope): void;
6
+ /**
7
+ * Grabs the scope and isolation scope off a span that were active when the span was started.
8
+ */
9
+ export declare function getCapturedScopesOnSpan(span: Span): {
10
+ scope?: Scope;
11
+ isolationScope?: Scope;
12
+ };
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../core/src/tracing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAUzD,+FAA+F;AAC/F,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,GAAG,IAAI,CAKzG;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,cAAc,CAAC,EAAE,KAAK,CAAA;CAAE,CAK7F"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Wrap a callback function with error handling.
3
+ * If an error is thrown, it will be passed to the `onError` callback and re-thrown.
4
+ *
5
+ * If the return value of the function is a promise, it will be handled with `maybeHandlePromiseRejection`.
6
+ *
7
+ * If an `onFinally` callback is provided, this will be called when the callback has finished
8
+ * - so if it returns a promise, once the promise resolved/rejected,
9
+ * else once the callback has finished executing.
10
+ * The `onFinally` callback will _always_ be called, no matter if an error was thrown or not.
11
+ */
12
+ export declare function handleCallbackErrors<Fn extends () => any>(fn: Fn, onError: (error: unknown) => void, onFinally?: () => void): ReturnType<Fn>;
13
+ //# sourceMappingURL=handleCallbackErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleCallbackErrors.d.ts","sourceRoot":"","sources":["../../../../../../core/src/utils/handleCallbackErrors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAElC,EAAE,SAAS,MAAM,GAAG,EAEpB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAEjC,SAAS,GAAE,MAAM,IAAe,GAC/B,UAAU,CAAC,EAAE,CAAC,CAWhB"}
@@ -0,0 +1,8 @@
1
+ import type { Options } from '@sentry/types';
2
+ /**
3
+ * Determines if tracing is currently enabled.
4
+ *
5
+ * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.
6
+ */
7
+ export declare function hasTracingEnabled(maybeOptions?: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined): boolean;
8
+ //# sourceMappingURL=hasTracingEnabled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasTracingEnabled.d.ts","sourceRoot":"","sources":["../../../../../../core/src/utils/hasTracingEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAM7C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,kBAAkB,GAAG,eAAe,GAAG,eAAe,CAAC,GAAG,SAAS,GAC/F,OAAO,CAOT"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Parse a sample rate from a given value.
3
+ * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1).
4
+ * If a string is passed, we try to convert it to a number.
5
+ *
6
+ * Any invalid sample rate will return `undefined`.
7
+ */
8
+ export declare function parseSampleRate(sampleRate: unknown): number | undefined;
9
+ //# sourceMappingURL=parseSampleRate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseSampleRate.d.ts","sourceRoot":"","sources":["../../../../../../core/src/utils/parseSampleRate.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAiBvE"}
@@ -0,0 +1,17 @@
1
+ import type { Scope, Span } from '@sentry/types';
2
+ declare const SCOPE_SPAN_FIELD = "_sentrySpan";
3
+ type ScopeWithMaybeSpan = Scope & {
4
+ [SCOPE_SPAN_FIELD]?: Span;
5
+ };
6
+ /**
7
+ * Set the active span for a given scope.
8
+ * NOTE: This should NOT be used directly, but is only used internally by the trace methods.
9
+ */
10
+ export declare function _setSpanForScope(scope: Scope, span: Span | undefined): void;
11
+ /**
12
+ * Get the active span for a given scope.
13
+ * NOTE: This should NOT be used directly, but is only used internally by the trace methods.
14
+ */
15
+ export declare function _getSpanForScope(scope: ScopeWithMaybeSpan): Span | undefined;
16
+ export {};
17
+ //# sourceMappingURL=spanOnScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanOnScope.d.ts","sourceRoot":"","sources":["../../../../../../core/src/utils/spanOnScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGjD,QAAA,MAAM,gBAAgB,gBAAgB,CAAC;AAEvC,KAAK,kBAAkB,GAAG,KAAK,GAAG;IAChC,CAAC,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAO3E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAE5E"}
@@ -0,0 +1,74 @@
1
+ import type { MeasurementUnit, Primitive, Span, SpanAttributes, SpanJSON, SpanStatus, SpanTimeInput, TraceContext } from '@sentry/types';
2
+ import type { MetricType } from '../metrics/types';
3
+ export declare const TRACE_FLAG_NONE = 0;
4
+ export declare const TRACE_FLAG_SAMPLED = 1;
5
+ /**
6
+ * Convert a span to a trace context, which can be sent as the `trace` context in an event.
7
+ * By default, this will only include trace_id, span_id & parent_span_id.
8
+ * If `includeAllData` is true, it will also include data, op, status & origin.
9
+ */
10
+ export declare function spanToTransactionTraceContext(span: Span): TraceContext;
11
+ /**
12
+ * Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event.
13
+ */
14
+ export declare function spanToTraceContext(span: Span): TraceContext;
15
+ /**
16
+ * Convert a Span to a Sentry trace header.
17
+ */
18
+ export declare function spanToTraceHeader(span: Span): string;
19
+ /**
20
+ * Convert a span time input intp a timestamp in seconds.
21
+ */
22
+ export declare function spanTimeInputToSeconds(input: SpanTimeInput | undefined): number;
23
+ /**
24
+ * Convert a span to a JSON representation.
25
+ */
26
+ export declare function spanToJSON(span: Span): Partial<SpanJSON>;
27
+ /** Exported only for tests. */
28
+ export interface OpenTelemetrySdkTraceBaseSpan extends Span {
29
+ attributes: SpanAttributes;
30
+ startTime: SpanTimeInput;
31
+ name: string;
32
+ status: SpanStatus;
33
+ endTime: SpanTimeInput;
34
+ parentSpanId?: string;
35
+ }
36
+ /**
37
+ * Returns true if a span is sampled.
38
+ * In most cases, you should just use `span.isRecording()` instead.
39
+ * However, this has a slightly different semantic, as it also returns false if the span is finished.
40
+ * So in the case where this distinction is important, use this method.
41
+ */
42
+ export declare function spanIsSampled(span: Span): boolean;
43
+ /** Get the status message to use for a JSON representation of a span. */
44
+ export declare function getStatusMessage(status: SpanStatus | undefined): string | undefined;
45
+ declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
46
+ declare const ROOT_SPAN_FIELD = "_sentryRootSpan";
47
+ type SpanWithPotentialChildren = Span & {
48
+ [CHILD_SPANS_FIELD]?: Set<Span>;
49
+ [ROOT_SPAN_FIELD]?: Span;
50
+ };
51
+ /**
52
+ * Adds an opaque child span reference to a span.
53
+ */
54
+ export declare function addChildSpanToSpan(span: SpanWithPotentialChildren, childSpan: Span): void;
55
+ /** This is only used internally by Idle Spans. */
56
+ export declare function removeChildSpanFromSpan(span: SpanWithPotentialChildren, childSpan: Span): void;
57
+ /**
58
+ * Returns an array of the given span and all of its descendants.
59
+ */
60
+ export declare function getSpanDescendants(span: SpanWithPotentialChildren): Span[];
61
+ /**
62
+ * Returns the root span of a given span.
63
+ */
64
+ export declare function getRootSpan(span: SpanWithPotentialChildren): Span;
65
+ /**
66
+ * Returns the currently active span.
67
+ */
68
+ export declare function getActiveSpan(): Span | undefined;
69
+ /**
70
+ * Updates the metric summary on the currently active span
71
+ */
72
+ export declare function updateMetricSummaryOnActiveSpan(metricType: MetricType, sanitizedName: string, value: number, unit: MeasurementUnit, tags: Record<string, Primitive>, bucketKey: string): void;
73
+ export {};
74
+ //# sourceMappingURL=spanUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanUtils.d.ts","sourceRoot":"","sources":["../../../../../../core/src/utils/spanUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,IAAI,EACJ,cAAc,EACd,QAAQ,EAER,UAAU,EACV,aAAa,EACb,YAAY,EACb,MAAM,eAAe,CAAC;AAWvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAOnD,eAAO,MAAM,eAAe,IAAM,CAAC;AACnC,eAAO,MAAM,kBAAkB,IAAM,CAAC;AAEtC;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAatE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAK3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAIpD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG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CAQhD;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/B,SAAS,EAAE,MAAM,GAChB,IAAI,CAKN"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu_profiler.d.ts","sourceRoot":"","sources":["../../../../src/cpu_profiler.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAU7C;;GAEG;AAEH,wBAAgB,uBAAuB,IAAI,4BAA4B,CA+HtE;AAED,QAAA,MAAM,0BAA0B,EAAE,4BAAwD,CAAC;AAE3F,cAAM,QAAS,YAAW,qBAAqB;IACtC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IASlC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,mBAAmB,GAAG,IAAI;IACrF,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,GAAG,kBAAkB,GAAG,IAAI;CAkB3F;AAED,QAAA,MAAM,mBAAmB,UAAiB,CAAC;AAE3C,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
3
+ *
4
+ * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
5
+ */
6
+ export declare const DEBUG_BUILD: boolean;
7
+ //# sourceMappingURL=debug-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../../src/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC"}
@@ -27,15 +27,33 @@ declare class ContinuousProfiler {
27
27
  * @param chunk
28
28
  */
29
29
  private _flush;
30
+ /**
31
+ * Stops the profile and clears chunk instrumentation from global scope
32
+ * @returns void
33
+ */
34
+ private _stopChunkProfiling;
30
35
  /**
31
36
  * Starts the profiler and registers the flush timer for a given chunk.
32
37
  * @param chunk
33
38
  */
34
39
  private _startChunkProfiling;
40
+ /**
41
+ * Attaches profiling information to spans that were started
42
+ * during a profiling session.
43
+ */
44
+ private _setupSpanChunkInstrumentation;
45
+ /**
46
+ * Clear profiling information from global context when a profile is not running.
47
+ */
48
+ private _teardownSpanChunkInstrumentation;
35
49
  /**
36
50
  * Initializes new profile chunk metadata
37
51
  */
38
52
  private _initializeChunk;
53
+ /**
54
+ * Assigns thread_id and thread name context to a profiled event.
55
+ */
56
+ private _assignThreadIdContext;
39
57
  /**
40
58
  * Resets the current chunk state.
41
59
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../src/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAS,WAAW,EAA8C,MAAM,eAAe,CAAC;AAuJpG,cAAM,kBAAkB;IACtB,OAAO,CAAC,WAAW,CAAW;IAC9B,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,UAAU,CAAoC;IAEtD;;;;OAIG;IACI,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAI3C;;;;;OAKG;IACI,KAAK,IAAI,IAAI;IAsBpB;;;OAGG;IACI,IAAI,IAAI,IAAI;IAgDnB;;;OAGG;IACH,OAAO,CAAC,MAAM;IAuBd;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAK3B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IActC;;OAEG;IACH,OAAO,CAAC,iCAAiC;IAKzC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAqB9B;;OAEG;IACH,OAAO,CAAC,MAAM;CAGf;AAED,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAED,+BAA+B;AAC/B,eAAO,MAAM,yBAAyB,QAAQ,oBAwCpB,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,mBAA+C,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeVersion.d.ts","sourceRoot":"","sources":["../../../../src/nodeVersion.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;WAAkD,MAAM;WAAS,MAAM;WAAS,MAAM;CAAE,CAAC;AAClH,eAAO,MAAM,UAAU,QAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanProfileUtils.d.ts","sourceRoot":"","sources":["../../../../src/spanProfileUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAKjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,uBAAuB,QAAY,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,IAAI,EAAE,IA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MAAM,EAAE,WAAW,CAAC,CAAC;CAC3C;AACD,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,CAAC,MAAM,EAC5B,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,OAAO,GACxB,mBAAmB,GAAG,IAAI,CAAC;IAC9B,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,CAAC,KAAK,EAC3B,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,OAAO,GACxB,kBAAkB,GAAG,IAAI,CAAC;IAG7B,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1C;AAED,oBAAY,aAAa;IACvB,MAAM,IAAI;IACV,KAAK,IAAI;CACV;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAAC;IACtF,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,GAAG,kBAAkB,GAAG,IAAI,CAAC;CACrF"}
@@ -1,5 +1,7 @@
1
1
  import type { Client, ContinuousThreadCpuProfile, DebugImage, DsnComponents, Envelope, Event, EventEnvelopeHeaders, Profile, ProfileChunk, ProfileChunkEnvelope, SdkInfo, ThreadCpuProfile } from '@sentry/types';
2
2
  import type { RawChunkCpuProfile, RawThreadCpuProfile } from './types';
3
+ export declare const PROFILER_THREAD_ID_STRING: string;
4
+ export declare const PROFILER_THREAD_NAME: string;
3
5
  /**
4
6
  * Enriches the profile with threadId of the current thread.
5
7
  * This is done in node as we seem to not be able to get the info from C native code.
@@ -18,7 +20,7 @@ export declare function createProfilingEvent(client: Client, profile: RawThreadC
18
20
  /**
19
21
  * Creates a profiling chunk envelope item, if the profile does not pass validation, returns null.
20
22
  */
21
- export declare function createProfilingChunkEvent(start_timestamp: number, client: Client, options: {
23
+ export declare function createProfilingChunkEvent(client: Client, options: {
22
24
  release?: string;
23
25
  environment?: string;
24
26
  }, profile: RawChunkCpuProfile, identifiers: {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EAEN,0BAA0B,EAC1B,UAAU,EACV,aAAa,EACb,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,oBAAoB,EAEpB,OAAO,EAGP,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAIvE,eAAO,MAAM,yBAAyB,QAAmB,CAAC;AAC1D,eAAO,MAAM,oBAAoB,QAAmC,CAAC;AA2BrE;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,0BAA0B,GAAG,kBAAkB,GAChG,gBAAgB,GAAG,0BAA0B,CAe/C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAc/G;AA8HD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CA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import { Carrier } from './../carrier';
2
+ import { AsyncContextStrategy } from './types';
3
+ /**
4
+ * @private Private API with no semver guarantees!
5
+ *
6
+ * Sets the global async context strategy
7
+ */
8
+ export declare function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void;
9
+ /**
10
+ * Get the current async context strategy.
11
+ * If none has been setup, the default will be used.
12
+ */
13
+ export declare function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,52 @@
1
+ import { Client, Scope as ScopeInterface } from '@sentry/types';
2
+ import { AsyncContextStrategy } from './types';
3
+ interface Layer {
4
+ client?: Client;
5
+ scope: ScopeInterface;
6
+ }
7
+ /**
8
+ * This is an object that holds a stack of scopes.
9
+ */
10
+ export declare class AsyncContextStack {
11
+ private readonly _stack;
12
+ private _isolationScope;
13
+ constructor(scope?: ScopeInterface, isolationScope?: ScopeInterface);
14
+ /**
15
+ * Fork a scope for the stack.
16
+ */
17
+ withScope<T>(callback: (scope: ScopeInterface) => T): T;
18
+ /**
19
+ * Get the client of the stack.
20
+ */
21
+ getClient<C extends Client>(): C | undefined;
22
+ /**
23
+ * Returns the scope of the top stack.
24
+ */
25
+ getScope(): ScopeInterface;
26
+ /**
27
+ * Get the isolation scope for the stack.
28
+ */
29
+ getIsolationScope(): ScopeInterface;
30
+ /**
31
+ * Returns the scope stack for domains or the process.
32
+ */
33
+ getStack(): Layer[];
34
+ /**
35
+ * Returns the topmost scope layer in the order domain > local > process.
36
+ */
37
+ getStackTop(): Layer;
38
+ /**
39
+ * Push a scope to the stack.
40
+ */
41
+ private _pushScope;
42
+ /**
43
+ * Pop a scope from the stack.
44
+ */
45
+ private _popScope;
46
+ }
47
+ /**
48
+ * Get the stack-based async context strategy.
49
+ */
50
+ export declare function getStackAsyncContextStrategy(): AsyncContextStrategy;
51
+ export {};
52
+ //# sourceMappingURL=stackStrategy.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { Scope } from '@sentry/types';
2
+ import { startInactiveSpan, startSpan, startSpanManual, suppressTracing, withActiveSpan } from './../tracing/trace';
3
+ import { getActiveSpan } from './../utils/spanUtils';
4
+ /**
5
+ * @private Private API with no semver guarantees!
6
+ *
7
+ * Strategy used to track async context.
8
+ */
9
+ export interface AsyncContextStrategy {
10
+ /**
11
+ * Fork the isolation scope inside of the provided callback.
12
+ */
13
+ withIsolationScope: <T>(callback: (isolationScope: Scope) => T) => T;
14
+ /**
15
+ * Fork the current scope inside of the provided callback.
16
+ */
17
+ withScope: <T>(callback: (isolationScope: Scope) => T) => T;
18
+ /**
19
+ * Set the provided scope as the current scope inside of the provided callback.
20
+ */
21
+ withSetScope: <T>(scope: Scope, callback: (scope: Scope) => T) => T;
22
+ /**
23
+ * Set the provided isolation as the current isolation scope inside of the provided callback.
24
+ */
25
+ withSetIsolationScope: <T>(isolationScope: Scope, callback: (isolationScope: Scope) => T) => T;
26
+ /**
27
+ * Get the currently active scope.
28
+ */
29
+ getCurrentScope: () => Scope;
30
+ /**
31
+ * Get the currently active isolation scope.
32
+ */
33
+ getIsolationScope: () => Scope;
34
+ /** Start an active span. */
35
+ startSpan?: typeof startSpan;
36
+ /** Start an inactive span. */
37
+ startInactiveSpan?: typeof startInactiveSpan;
38
+ /** Start an active manual span. */
39
+ startSpanManual?: typeof startSpanManual;
40
+ /** Get the currently active span. */
41
+ getActiveSpan?: typeof getActiveSpan;
42
+ /** Make a span the active span in the context of the callback. */
43
+ withActiveSpan?: typeof withActiveSpan;
44
+ /** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */
45
+ suppressTracing?: typeof suppressTracing;
46
+ }
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { Client, Integration, MetricsAggregator, Scope } from '@sentry/types';
2
+ import { AsyncContextStack } from './asyncContext/stackStrategy';
3
+ import { AsyncContextStrategy } from './asyncContext/types';
4
+ /**
5
+ * An object that contains globally accessible properties and maintains a scope stack.
6
+ * @hidden
7
+ */
8
+ export interface Carrier {
9
+ __SENTRY__?: VersionedCarrier;
10
+ }
11
+ type VersionedCarrier = {
12
+ version?: string;
13
+ } & Record<Exclude<string, 'version'>, SentryCarrier>;
14
+ interface SentryCarrier {
15
+ acs?: AsyncContextStrategy;
16
+ stack?: AsyncContextStack;
17
+ globalScope?: Scope;
18
+ defaultIsolationScope?: Scope;
19
+ defaultCurrentScope?: Scope;
20
+ globalMetricsAggregators?: WeakMap<Client, MetricsAggregator> | undefined;
21
+ integrations?: Integration[];
22
+ extensions?: {
23
+ [key: string]: Function;
24
+ };
25
+ }
26
+ /**
27
+ * Returns the global shim registry.
28
+ *
29
+ * FIXME: This function is problematic, because despite always returning a valid Carrier,
30
+ * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
31
+ * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
32
+ **/
33
+ export declare function getMainCarrier(): Carrier;
34
+ /** Will either get the existing sentry carrier, or create a new one. */
35
+ export declare function getSentryCarrier(carrier: Carrier): SentryCarrier;
36
+ export {};
37
+ //# sourceMappingURL=carrier.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_ENVIRONMENT = "production";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { Scope } from '@sentry/types';
2
+ import { Client } from '@sentry/types';
3
+ /**
4
+ * Get the currently active scope.
5
+ */
6
+ export declare function getCurrentScope(): Scope;
7
+ /**
8
+ * Get the currently active isolation scope.
9
+ * The isolation scope is active for the current exection context.
10
+ */
11
+ export declare function getIsolationScope(): Scope;
12
+ /**
13
+ * Get the global scope.
14
+ * This scope is applied to _all_ events.
15
+ */
16
+ export declare function getGlobalScope(): Scope;
17
+ /**
18
+ * Creates a new scope with and executes the given operation within.
19
+ * The scope is automatically removed once the operation
20
+ * finishes or throws.
21
+ */
22
+ export declare function withScope<T>(callback: (scope: Scope) => T): T;
23
+ /**
24
+ * Set the given scope as the active scope in the callback.
25
+ */
26
+ export declare function withScope<T>(scope: Scope | undefined, callback: (scope: Scope) => T): T;
27
+ /**
28
+ * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no
29
+ * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the
30
+ * case, for example, in the browser).
31
+ *
32
+ * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.
33
+ *
34
+ * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal"
35
+ * applications directly because it comes with pitfalls. Use at your own risk!
36
+ */
37
+ export declare function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T;
38
+ /**
39
+ * Set the provided isolation scope as active in the given callback. If no
40
+ * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the
41
+ * case, for example, in the browser).
42
+ *
43
+ * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.
44
+ *
45
+ * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal"
46
+ * applications directly because it comes with pitfalls. Use at your own risk!
47
+ *
48
+ * If you pass in `undefined` as a scope, it will fork a new isolation scope, the same as if no scope is passed.
49
+ */
50
+ export declare function withIsolationScope<T>(isolationScope: Scope | undefined, callback: (isolationScope: Scope) => T): T;
51
+ /**
52
+ * Get the currently active client.
53
+ */
54
+ export declare function getClient<C extends Client>(): C | undefined;
55
+ //# sourceMappingURL=currentScopes.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { Scope } from '@sentry/types';
2
+ /** Get the default current scope. */
3
+ export declare function getDefaultCurrentScope(): Scope;
4
+ /** Get the default isolation scope. */
5
+ export declare function getDefaultIsolationScope(): Scope;
6
+ //# sourceMappingURL=defaultScopes.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { Client, DsnComponents, Event, EventEnvelope, SdkMetadata, Session, SessionAggregates, SessionEnvelope, SpanEnvelope } from '@sentry/types';
2
+ import { SentrySpan } from './tracing/sentrySpan';
3
+ /** Creates an envelope from a Session */
4
+ export declare function createSessionEnvelope(session: Session | SessionAggregates, dsn?: DsnComponents, metadata?: SdkMetadata, tunnel?: string): SessionEnvelope;
5
+ /**
6
+ * Create an Envelope from an event.
7
+ */
8
+ export declare function createEventEnvelope(event: Event, dsn?: DsnComponents, metadata?: SdkMetadata, tunnel?: string): EventEnvelope;
9
+ /**
10
+ * Create envelope from Span item.
11
+ *
12
+ * Takes an optional client and runs spans through `beforeSendSpan` if available.
13
+ */
14
+ export declare function createSpanEnvelope(spans: [
15
+ SentrySpan,
16
+ ...SentrySpan[]
17
+ ], client?: Client): SpanEnvelope;
18
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1,19 @@
1
+ export declare const COUNTER_METRIC_TYPE: "c";
2
+ export declare const GAUGE_METRIC_TYPE: "g";
3
+ export declare const SET_METRIC_TYPE: "s";
4
+ export declare const DISTRIBUTION_METRIC_TYPE: "d";
5
+ /**
6
+ * This does not match spec in https://develop.sentry.dev/sdk/metrics
7
+ * but was chosen to optimize for the most common case in browser environments.
8
+ */
9
+ export declare const DEFAULT_BROWSER_FLUSH_INTERVAL = 5000;
10
+ /**
11
+ * SDKs are required to bucket into 10 second intervals (rollup in seconds)
12
+ * which is the current lower bound of metric accuracy.
13
+ */
14
+ export declare const DEFAULT_FLUSH_INTERVAL = 10000;
15
+ /**
16
+ * The maximum number of metrics that should be stored in memory.
17
+ */
18
+ export declare const MAX_WEIGHT = 10000;
19
+ //# sourceMappingURL=constants.d.ts.map