@sentry/opentelemetry 8.0.0-alpha.2 → 8.0.0-alpha.3

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 (176) hide show
  1. package/README.md +2 -1
  2. package/cjs/index.js +2120 -55
  3. package/cjs/index.js.map +1 -1
  4. package/esm/index.js +2091 -23
  5. package/esm/index.js.map +1 -1
  6. package/esm/package.json +1 -0
  7. package/package.json +18 -5
  8. package/types/asyncContextStrategy.d.ts.map +1 -1
  9. package/types/constants.d.ts +2 -3
  10. package/types/constants.d.ts.map +1 -1
  11. package/types/contextManager.d.ts.map +1 -1
  12. package/types/custom/getCurrentHub.d.ts.map +1 -1
  13. package/types/index.d.ts +4 -6
  14. package/types/index.d.ts.map +1 -1
  15. package/types/propagator.d.ts +16 -1
  16. package/types/propagator.d.ts.map +1 -1
  17. package/types/sampler.d.ts.map +1 -1
  18. package/types/semanticAttributes.d.ts +2 -7
  19. package/types/semanticAttributes.d.ts.map +1 -1
  20. package/types/setupEventContextTrace.d.ts.map +1 -1
  21. package/types/spanExporter.d.ts.map +1 -1
  22. package/types/spanProcessor.d.ts.map +1 -1
  23. package/types/trace.d.ts +14 -1
  24. package/types/trace.d.ts.map +1 -1
  25. package/types/types.d.ts +3 -4
  26. package/types/types.d.ts.map +1 -1
  27. package/types/utils/captureExceptionForTimedEvent.d.ts +1 -2
  28. package/types/utils/captureExceptionForTimedEvent.d.ts.map +1 -1
  29. package/types/utils/contextData.d.ts +1 -11
  30. package/types/utils/contextData.d.ts.map +1 -1
  31. package/types/utils/dynamicSamplingContext.d.ts.map +1 -1
  32. package/types/utils/getActiveSpan.d.ts +0 -5
  33. package/types/utils/getActiveSpan.d.ts.map +1 -1
  34. package/types/utils/groupSpansWithParents.d.ts.map +1 -1
  35. package/types/utils/spanData.d.ts +1 -14
  36. package/types/utils/spanData.d.ts.map +1 -1
  37. package/types-ts3.8/constants.d.ts +2 -3
  38. package/types-ts3.8/index.d.ts +4 -6
  39. package/types-ts3.8/propagator.d.ts +16 -1
  40. package/types-ts3.8/semanticAttributes.d.ts +2 -7
  41. package/types-ts3.8/trace.d.ts +14 -1
  42. package/types-ts3.8/types.d.ts +3 -4
  43. package/types-ts3.8/utils/captureExceptionForTimedEvent.d.ts +1 -2
  44. package/types-ts3.8/utils/contextData.d.ts +1 -11
  45. package/types-ts3.8/utils/getActiveSpan.d.ts +0 -5
  46. package/types-ts3.8/utils/spanData.d.ts +1 -14
  47. package/cjs/asyncContextStrategy.js +0 -114
  48. package/cjs/asyncContextStrategy.js.map +0 -1
  49. package/cjs/constants.js +0 -30
  50. package/cjs/constants.js.map +0 -1
  51. package/cjs/contextManager.js +0 -87
  52. package/cjs/contextManager.js.map +0 -1
  53. package/cjs/custom/client.js +0 -64
  54. package/cjs/custom/client.js.map +0 -1
  55. package/cjs/custom/getCurrentHub.js +0 -106
  56. package/cjs/custom/getCurrentHub.js.map +0 -1
  57. package/cjs/custom/hub.js +0 -13
  58. package/cjs/custom/hub.js.map +0 -1
  59. package/cjs/custom/hubextensions.js +0 -37
  60. package/cjs/custom/hubextensions.js.map +0 -1
  61. package/cjs/custom/transaction.js +0 -26
  62. package/cjs/custom/transaction.js.map +0 -1
  63. package/cjs/debug-build.js +0 -11
  64. package/cjs/debug-build.js.map +0 -1
  65. package/cjs/propagator.js +0 -217
  66. package/cjs/propagator.js.map +0 -1
  67. package/cjs/sampler.js +0 -188
  68. package/cjs/sampler.js.map +0 -1
  69. package/cjs/semanticAttributes.js +0 -12
  70. package/cjs/semanticAttributes.js.map +0 -1
  71. package/cjs/setupEventContextTrace.js +0 -40
  72. package/cjs/setupEventContextTrace.js.map +0 -1
  73. package/cjs/spanExporter.js +0 -307
  74. package/cjs/spanExporter.js.map +0 -1
  75. package/cjs/spanProcessor.js +0 -98
  76. package/cjs/spanProcessor.js.map +0 -1
  77. package/cjs/trace.js +0 -222
  78. package/cjs/trace.js.map +0 -1
  79. package/cjs/utils/addOriginToSpan.js +0 -11
  80. package/cjs/utils/addOriginToSpan.js.map +0 -1
  81. package/cjs/utils/captureExceptionForTimedEvent.js +0 -59
  82. package/cjs/utils/captureExceptionForTimedEvent.js.map +0 -1
  83. package/cjs/utils/contextData.js +0 -61
  84. package/cjs/utils/contextData.js.map +0 -1
  85. package/cjs/utils/convertOtelTimeToSeconds.js +0 -9
  86. package/cjs/utils/convertOtelTimeToSeconds.js.map +0 -1
  87. package/cjs/utils/dynamicSamplingContext.js +0 -64
  88. package/cjs/utils/dynamicSamplingContext.js.map +0 -1
  89. package/cjs/utils/getActiveSpan.js +0 -29
  90. package/cjs/utils/getActiveSpan.js.map +0 -1
  91. package/cjs/utils/getRequestSpanData.js +0 -48
  92. package/cjs/utils/getRequestSpanData.js.map +0 -1
  93. package/cjs/utils/getSpanKind.js +0 -21
  94. package/cjs/utils/getSpanKind.js.map +0 -1
  95. package/cjs/utils/groupSpansWithParents.js +0 -74
  96. package/cjs/utils/groupSpansWithParents.js.map +0 -1
  97. package/cjs/utils/isSentryRequest.js +0 -29
  98. package/cjs/utils/isSentryRequest.js.map +0 -1
  99. package/cjs/utils/mapStatus.js +0 -77
  100. package/cjs/utils/mapStatus.js.map +0 -1
  101. package/cjs/utils/parseSpanDescription.js +0 -158
  102. package/cjs/utils/parseSpanDescription.js.map +0 -1
  103. package/cjs/utils/setupCheck.js +0 -17
  104. package/cjs/utils/setupCheck.js.map +0 -1
  105. package/cjs/utils/spanData.js +0 -72
  106. package/cjs/utils/spanData.js.map +0 -1
  107. package/cjs/utils/spanTypes.js +0 -77
  108. package/cjs/utils/spanTypes.js.map +0 -1
  109. package/esm/asyncContextStrategy.js +0 -112
  110. package/esm/asyncContextStrategy.js.map +0 -1
  111. package/esm/constants.js +0 -20
  112. package/esm/constants.js.map +0 -1
  113. package/esm/contextManager.js +0 -82
  114. package/esm/contextManager.js.map +0 -1
  115. package/esm/custom/client.js +0 -59
  116. package/esm/custom/client.js.map +0 -1
  117. package/esm/custom/getCurrentHub.js +0 -101
  118. package/esm/custom/getCurrentHub.js.map +0 -1
  119. package/esm/custom/hub.js +0 -11
  120. package/esm/custom/hub.js.map +0 -1
  121. package/esm/custom/hubextensions.js +0 -35
  122. package/esm/custom/hubextensions.js.map +0 -1
  123. package/esm/custom/transaction.js +0 -24
  124. package/esm/custom/transaction.js.map +0 -1
  125. package/esm/debug-build.js +0 -9
  126. package/esm/debug-build.js.map +0 -1
  127. package/esm/propagator.js +0 -210
  128. package/esm/propagator.js.map +0 -1
  129. package/esm/sampler.js +0 -186
  130. package/esm/sampler.js.map +0 -1
  131. package/esm/semanticAttributes.js +0 -10
  132. package/esm/semanticAttributes.js.map +0 -1
  133. package/esm/setupEventContextTrace.js +0 -38
  134. package/esm/setupEventContextTrace.js.map +0 -1
  135. package/esm/spanExporter.js +0 -305
  136. package/esm/spanExporter.js.map +0 -1
  137. package/esm/spanProcessor.js +0 -96
  138. package/esm/spanProcessor.js.map +0 -1
  139. package/esm/trace.js +0 -217
  140. package/esm/trace.js.map +0 -1
  141. package/esm/utils/addOriginToSpan.js +0 -9
  142. package/esm/utils/addOriginToSpan.js.map +0 -1
  143. package/esm/utils/captureExceptionForTimedEvent.js +0 -57
  144. package/esm/utils/captureExceptionForTimedEvent.js.map +0 -1
  145. package/esm/utils/contextData.js +0 -54
  146. package/esm/utils/contextData.js.map +0 -1
  147. package/esm/utils/convertOtelTimeToSeconds.js +0 -7
  148. package/esm/utils/convertOtelTimeToSeconds.js.map +0 -1
  149. package/esm/utils/dynamicSamplingContext.js +0 -59
  150. package/esm/utils/dynamicSamplingContext.js.map +0 -1
  151. package/esm/utils/getActiveSpan.js +0 -26
  152. package/esm/utils/getActiveSpan.js.map +0 -1
  153. package/esm/utils/getRequestSpanData.js +0 -46
  154. package/esm/utils/getRequestSpanData.js.map +0 -1
  155. package/esm/utils/getSpanKind.js +0 -19
  156. package/esm/utils/getSpanKind.js.map +0 -1
  157. package/esm/utils/groupSpansWithParents.js +0 -72
  158. package/esm/utils/groupSpansWithParents.js.map +0 -1
  159. package/esm/utils/isSentryRequest.js +0 -27
  160. package/esm/utils/isSentryRequest.js.map +0 -1
  161. package/esm/utils/mapStatus.js +0 -75
  162. package/esm/utils/mapStatus.js.map +0 -1
  163. package/esm/utils/parseSpanDescription.js +0 -154
  164. package/esm/utils/parseSpanDescription.js.map +0 -1
  165. package/esm/utils/setupCheck.js +0 -14
  166. package/esm/utils/setupCheck.js.map +0 -1
  167. package/esm/utils/spanData.js +0 -63
  168. package/esm/utils/spanData.js.map +0 -1
  169. package/esm/utils/spanTypes.js +0 -70
  170. package/esm/utils/spanTypes.js.map +0 -1
  171. package/types/custom/hubextensions.d.ts +0 -5
  172. package/types/custom/hubextensions.d.ts.map +0 -1
  173. package/types/custom/transaction.d.ts +0 -8
  174. package/types/custom/transaction.d.ts.map +0 -1
  175. package/types-ts3.8/custom/hubextensions.d.ts +0 -5
  176. package/types-ts3.8/custom/transaction.d.ts +0 -8
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sentry/opentelemetry",
3
- "version": "8.0.0-alpha.2",
3
+ "version": "8.0.0-alpha.3",
4
4
  "description": "Official Sentry utilities for OpenTelemetry",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/opentelemetry",
7
7
  "author": "Sentry",
8
8
  "license": "MIT",
9
9
  "engines": {
10
- "node": ">=14.8"
10
+ "node": ">=14.18"
11
11
  },
12
12
  "files": [
13
13
  "cjs",
@@ -18,6 +18,19 @@
18
18
  "main": "cjs/index.js",
19
19
  "module": "esm/index.js",
20
20
  "types": "types/index.d.ts",
21
+ "exports": {
22
+ "./package.json": "./package.json",
23
+ ".": {
24
+ "import": {
25
+ "types": "./types/index.d.ts",
26
+ "default": "./esm/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./types/index.d.ts",
30
+ "default": "./cjs/index.js"
31
+ }
32
+ }
33
+ },
21
34
  "typesVersions": {
22
35
  "<4.9": {
23
36
  "types/index.d.ts": [
@@ -29,9 +42,9 @@
29
42
  "access": "public"
30
43
  },
31
44
  "dependencies": {
32
- "@sentry/core": "8.0.0-alpha.2",
33
- "@sentry/types": "8.0.0-alpha.2",
34
- "@sentry/utils": "8.0.0-alpha.2"
45
+ "@sentry/core": "8.0.0-alpha.3",
46
+ "@sentry/types": "8.0.0-alpha.3",
47
+ "@sentry/utils": "8.0.0-alpha.3"
35
48
  },
36
49
  "peerDependencies": {
37
50
  "@opentelemetry/api": "^1.0.0",
@@ -1 +1 @@
1
- {"version":3,"file":"asyncContextStrategy.d.ts","sourceRoot":"","sources":["../../src/asyncContextStrategy.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wBAAgB,2CAA2C,IAAI,IAAI,CAkGlE"}
1
+ {"version":3,"file":"asyncContextStrategy.d.ts","sourceRoot":"","sources":["../../src/asyncContextStrategy.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAgB,2CAA2C,IAAI,IAAI,CAyGlE"}
@@ -1,9 +1,8 @@
1
1
  export declare const SENTRY_TRACE_HEADER = "sentry-trace";
2
2
  export declare const SENTRY_BAGGAGE_HEADER = "baggage";
3
- export declare const SENTRY_TRACE_STATE_DSC = "sentry.trace";
3
+ export declare const SENTRY_TRACE_STATE_DSC = "sentry.dsc";
4
4
  export declare const SENTRY_TRACE_STATE_PARENT_SPAN_ID = "sentry.parent_span_id";
5
- /** Context Key to hold a Hub. */
6
- export declare const SENTRY_HUB_CONTEXT_KEY: symbol;
5
+ export declare const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording";
7
6
  export declare const SENTRY_SCOPES_CONTEXT_KEY: symbol;
8
7
  export declare const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY: symbol;
9
8
  export declare const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY: symbol;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AAEzE,iCAAiC;AACjC,eAAO,MAAM,sBAAsB,QAAiC,CAAC;AAErE,eAAO,MAAM,yBAAyB,QAAoC,CAAC;AAE3E,eAAO,MAAM,uCAAuC,QAAkD,CAAC;AAEvG,eAAO,MAAM,iCAAiC,QAA4C,CAAC;AAE3F,eAAO,MAAM,2CAA2C,QAAsD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AACzE,eAAO,MAAM,wCAAwC,iCAAiC,CAAC;AAEvF,eAAO,MAAM,yBAAyB,QAAoC,CAAC;AAE3E,eAAO,MAAM,uCAAuC,QAAkD,CAAC;AAEvG,eAAO,MAAM,iCAAiC,QAA4C,CAAC;AAE3F,eAAO,MAAM,2CAA2C,QAAsD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contextManager.d.ts","sourceRoot":"","sources":["../../src/contextManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAalE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,sBAAsB,SAAS,cAAc,EACnF,mBAAmB,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,sBAAsB,GACtE,OAAO,mBAAmB,CA6D5B"}
1
+ {"version":3,"file":"contextManager.d.ts","sourceRoot":"","sources":["../../src/contextManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAYlE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,sBAAsB,SAAS,cAAc,EACnF,mBAAmB,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,sBAAsB,GACtE,OAAO,mBAAmB,CAqD5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"getCurrentHub.d.ts","sourceRoot":"","sources":["../../../src/custom/getCurrentHub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,GAAG,EAMJ,MAAM,eAAe,CAAC;AAmBvB;;;GAGG;AACH,wBAAgB,aAAa,IAAI,GAAG,CA6EnC"}
1
+ {"version":3,"file":"getCurrentHub.d.ts","sourceRoot":"","sources":["../../../src/custom/getCurrentHub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,GAAG,EAAuD,MAAM,eAAe,CAAC;AAmBjH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAiEnC"}
package/types/index.d.ts CHANGED
@@ -1,18 +1,17 @@
1
- import { addOriginToSpan } from './utils/addOriginToSpan';
2
1
  import { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';
3
2
  import { getRequestSpanData } from './utils/getRequestSpanData';
4
3
  export type { OpenTelemetryClient } from './types';
5
4
  export { wrapClientClass } from './custom/client';
6
5
  export { getSpanKind } from './utils/getSpanKind';
7
- export { getSpanHub, getSpanMetadata, getSpanParent, setSpanMetadata, getSpanScopes, } from './utils/spanData';
6
+ export { getSpanScopes } from './utils/spanData';
8
7
  export { getScopesFromContext } from './utils/contextData';
9
8
  export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
9
+ export { getDynamicSamplingContextFromSpan } from './utils/dynamicSamplingContext';
10
10
  export { isSentryRequestSpan } from './utils/isSentryRequest';
11
- export { getActiveSpan, getRootSpan } from './utils/getActiveSpan';
12
- export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan } from './trace';
11
+ export { getActiveSpan } from './utils/getActiveSpan';
12
+ export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan, continueTrace } from './trace';
13
13
  export { setupGlobalHub } from './custom/hub';
14
14
  export { getCurrentHub } from './custom/getCurrentHub';
15
- export { addTracingExtensions } from './custom/hubextensions';
16
15
  export { setupEventContextTrace } from './setupEventContextTrace';
17
16
  export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
18
17
  export { wrapContextManagerClass } from './contextManager';
@@ -26,7 +25,6 @@ export { getClient } from '@sentry/core';
26
25
  * @hidden
27
26
  */
28
27
  declare const _INTERNAL: {
29
- readonly addOriginToSpan: typeof addOriginToSpan;
30
28
  readonly maybeCaptureExceptionForTimedEvent: typeof maybeCaptureExceptionForTimedEvent;
31
29
  readonly getRequestSpanData: typeof getRequestSpanData;
32
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGxF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,2CAA2C,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,QAAA,MAAM,SAAS;;;;CAIL,CAAC;AAEX,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGvG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,2CAA2C,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,QAAA,MAAM,SAAS;;;CAGL,CAAC;AAEX,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Context, SpanContext, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
2
2
  import { TraceState, W3CBaggagePropagator } from '@opentelemetry/core';
3
+ import type { continueTrace } from '@sentry/core';
3
4
  import type { DynamicSamplingContext, PropagationContext } from '@sentry/types';
4
5
  /** Get the Sentry propagation context from a span context. */
5
6
  export declare function getPropagationContextFromSpanContext(spanContext: SpanContext): PropagationContext;
@@ -22,8 +23,22 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
22
23
  fields(): string[];
23
24
  }
24
25
  /** Exported for tests. */
25
- export declare function makeTraceState({ parentSpanId, dsc, }: {
26
+ export declare function makeTraceState({ parentSpanId, dsc, sampled, }: {
26
27
  parentSpanId?: string;
27
28
  dsc?: Partial<DynamicSamplingContext>;
29
+ sampled?: boolean;
28
30
  }): TraceState | undefined;
31
+ /**
32
+ * Takes trace strings and propagates them as a remote active span.
33
+ * This should be used in addition to `continueTrace` in OTEL-powered environments.
34
+ */
35
+ export declare function continueTraceAsRemoteSpan<T>(ctx: Context, options: Parameters<typeof continueTrace>[0], callback: () => T): T;
36
+ /**
37
+ * OpenTelemetry only knows about SAMPLED or NONE decision,
38
+ * but for us it is important to differentiate between unset and unsampled.
39
+ *
40
+ * Both of these are identified as `traceFlags === TracegFlags.NONE`,
41
+ * but we additionally look at a special trace state to differentiate between them.
42
+ */
43
+ export declare function getSamplingDecision(spanContext: SpanContext): boolean | undefined;
29
44
  //# sourceMappingURL=propagator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;AAE5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAkBhF,8DAA8D;AAC9D,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,WAAW,GAAG,kBAAkB,CAejG;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;;IAMxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAuB9E;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;IAwClF;;OAEG;IACI,MAAM,IAAI,MAAM,EAAE;CAG1B;AAED,0BAA0B;AAC1B,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,GAAG,GACJ,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAAE,GAAG,UAAU,GAAG,SAAS,CAa3F"}
1
+ {"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGtG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAmBhF,8DAA8D;AAC9D,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,WAAW,GAAG,kBAAkB,CAgBjG;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;;IAMxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAuB9E;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;IA0BlF;;OAEG;IACI,MAAM,IAAI,MAAM,EAAE;CAG1B;AAED,0BAA0B;AAC1B,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,GAAG,EACH,OAAO,GACR,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,UAAU,GAAG,SAAS,CAiBzB;AAyGD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,EAC5C,QAAQ,EAAE,MAAM,CAAC,GAChB,CAAC,CAIH;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,GAAG,SAAS,CA6BjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"sampler.d.ts","sourceRoot":"","sources":["../../src/sampler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,OAAO,EAAe,MAAM,oBAAoB,CAAC;AAE3E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG7E,OAAO,KAAK,EAAE,MAAM,EAAkC,MAAM,eAAe,CAAC;AAQ5E;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC3C,OAAO,CAAC,OAAO,CAAS;gBAEL,MAAM,EAAE,MAAM;IAKjC,kBAAkB;IACX,YAAY,CACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,GACd,cAAc;IA+FjB,4EAA4E;IACrE,QAAQ,IAAI,MAAM;CAG1B"}
1
+ {"version":3,"file":"sampler.d.ts","sourceRoot":"","sources":["../../src/sampler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,OAAO,EAAe,MAAM,oBAAoB,CAAC;AAG3E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG7E,OAAO,KAAK,EAAE,MAAM,EAAkC,MAAM,eAAe,CAAC;AAQ5E;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC3C,OAAO,CAAC,OAAO,CAAS;gBAEL,MAAM,EAAE,MAAM;IAKjC,kBAAkB;IACX,YAAY,CACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,GACd,cAAc;IA+FjB,4EAA4E;IACrE,QAAQ,IAAI,MAAM;CAG1B"}
@@ -1,8 +1,3 @@
1
- /**
2
- * These are internal and are not supposed to be used/depended on by external parties.
3
- * No guarantees apply to these attributes, and the may change/disappear at any time.
4
- */
5
- export declare const InternalSentrySemanticAttributes: {
6
- readonly PARENT_SAMPLED: "sentry.parentSampled";
7
- };
1
+ /** If this attribute is true, it means that the parent is a remote span. */
2
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote";
8
3
  //# sourceMappingURL=semanticAttributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;CAEnC,CAAC"}
1
+ {"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,eAAO,MAAM,0CAA0C,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"setupEventContextTrace.d.ts","sourceRoot":"","sources":["../../src/setupEventContextTrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA6B3D"}
1
+ {"version":3,"file":"setupEventContextTrace.d.ts","sourceRoot":"","sources":["../../src/setupEventContextTrace.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA6B3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA2BhF;;GAEG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAU;;IAO1B,kBAAkB;IACX,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAoC1F,kBAAkB;IACX,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC,kBAAkB;IACX,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAKnC"}
1
+ {"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA0BhF;;GAEG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAU;;IAO1B,kBAAkB;IACX,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAoC1F,kBAAkB;IACX,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC,kBAAkB;IACX,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAKnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"spanProcessor.d.ts","sourceRoot":"","sources":["../../src/spanProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAiDnE;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,kBAAmB,YAAW,sBAAsB;;IAO3F;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IAQxD,kBAAkB;IACX,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAa9B;;;OAGG;IACH,SAAS,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAGxD"}
1
+ {"version":3,"file":"spanProcessor.d.ts","sourceRoot":"","sources":["../../src/spanProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAwDnE;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,kBAAmB,YAAW,sBAAsB;;IAO3F;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IAWxD,kBAAkB;IACX,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAa9B;;;OAGG;IACH,SAAS,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAGxD"}
package/types/trace.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Span } from '@opentelemetry/api';
2
+ import { continueTrace as baseContinueTrace } from '@sentry/core';
2
3
  import type { Scope } from '@sentry/types';
3
4
  import type { OpenTelemetrySpanContext } from './types';
4
5
  /**
@@ -20,7 +21,7 @@ export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback
20
21
  *
21
22
  * Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
22
23
  */
23
- export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
24
+ export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span, finish: () => void) => T): T;
24
25
  /**
25
26
  * @deprecated Use {@link startSpan} instead.
26
27
  */
@@ -46,4 +47,16 @@ export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Sp
46
47
  * @returns the value returned from the provided callback function.
47
48
  */
48
49
  export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
50
+ /**
51
+ * Continue a trace from `sentry-trace` and `baggage` values.
52
+ * These values can be obtained from incoming request headers, or in the browser from `<meta name="sentry-trace">`
53
+ * and `<meta name="baggage">` HTML tags.
54
+ *
55
+ * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically
56
+ * be attached to the incoming trace.
57
+ *
58
+ * This is a custom version of `continueTrace` that is used in OTEL-powered environments.
59
+ * It propagates the trace as a remote span, in addition to setting it on the propagation context.
60
+ */
61
+ export declare function continueTrace<T>(options: Parameters<typeof baseContinueTrace>[0], callback: () => T): T;
49
62
  //# sourceMappingURL=trace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAoC,MAAM,oBAAoB,CAAC;AAc1F,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,KAAK,EAAuB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAM7E;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAsB9F;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAqBpG;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,kBAAY,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAgBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAGrF"}
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAoC,MAAM,oBAAoB,CAAC;AAK1F,OAAO,EAGL,aAAa,IAAI,iBAAiB,EAMnC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAuB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAI7E;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAsB9F;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,GAC9C,CAAC,CAqBH;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,kBAAY,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAgBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAGrF;AAuHD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAIvG"}
package/types/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
2
- import type { BasicTracerProvider, ReadableSpan, Span } from '@opentelemetry/sdk-trace-base';
3
- import type { Scope, StartSpanOptions } from '@sentry/types';
2
+ import type { BasicTracerProvider, ReadableSpan } from '@opentelemetry/sdk-trace-base';
3
+ import type { Scope, Span, StartSpanOptions } from '@sentry/types';
4
4
  export interface OpenTelemetryClient {
5
5
  tracer: Tracer;
6
6
  traceProvider: BasicTracerProvider | undefined;
@@ -17,8 +17,7 @@ export interface OpenTelemetrySpanContext extends StartSpanOptions {
17
17
  * Note that technically, the `Span` exported from `@opentelemwetry/sdk-trace-base` matches this,
18
18
  * but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
19
19
  */
20
- export type AbstractSpan = WriteableSpan | ReadableSpan;
21
- export type { Span };
20
+ export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
22
21
  export interface CurrentScopes {
23
22
  scope: Scope;
24
23
  isolationScope: Scope;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAEhE,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAExD,YAAY,EAAE,IAAI,EAAE,CAAC;AAErB,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAEhE,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB"}
@@ -1,8 +1,7 @@
1
1
  import type { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
2
- import type { Hub } from '@sentry/types';
3
2
  /**
4
3
  * Maybe capture a Sentry exception for an OTEL timed event.
5
4
  * This will check if the event is exception-like and in that case capture it as an exception.
6
5
  */
7
- export declare function maybeCaptureExceptionForTimedEvent(hub: Hub, event: TimedEvent, otelSpan?: OtelSpan): void;
6
+ export declare function maybeCaptureExceptionForTimedEvent(event: TimedEvent, otelSpan?: OtelSpan): void;
8
7
  //# sourceMappingURL=captureExceptionForTimedEvent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"captureExceptionForTimedEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CA8CzG"}
1
+ {"version":3,"file":"captureExceptionForTimedEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAKlF;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CA6C/F"}
@@ -1,16 +1,6 @@
1
1
  import type { Context } from '@opentelemetry/api';
2
- import type { Hub, Scope } from '@sentry/types';
2
+ import type { Scope } from '@sentry/types';
3
3
  import type { CurrentScopes } from '../types';
4
- /**
5
- * Try to get the Hub from the given OTEL context.
6
- * This requires a Context Manager that was wrapped with getWrappedContextManager.
7
- */
8
- export declare function getHubFromContext(context: Context): Hub | undefined;
9
- /**
10
- * Set a Hub on an OTEL context..
11
- * This will return a forked context with the Propagation Context set.
12
- */
13
- export declare function setHubOnContext(context: Context, hub: Hub): Context;
14
4
  /**
15
5
  * Try to get the current scopes from the given OTEL context.
16
6
  * This requires a Context Manager that was wrapped with getWrappedContextManager.
@@ -1 +1 @@
1
- {"version":3,"file":"contextData.d.ts","sourceRoot":"","sources":["../../../src/utils/contextData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,SAAS,CAEnE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAEnE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAEhF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAEnF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAEtE;AAED;;;KAGK;AACL,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CAErE"}
1
+ {"version":3,"file":"contextData.d.ts","sourceRoot":"","sources":["../../../src/utils/contextData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAEhF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAEnF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAEtE;AAED;;;KAGK;AACL,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CAErE"}
@@ -1 +1 @@
1
- {"version":3,"file":"dynamicSamplingContext.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamicSamplingContext.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAyC/G"}
1
+ {"version":3,"file":"dynamicSamplingContext.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamicSamplingContext.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAyC/G"}
@@ -3,9 +3,4 @@ import type { Span } from '@opentelemetry/api';
3
3
  * Returns the currently active span.
4
4
  */
5
5
  export declare function getActiveSpan(): Span | undefined;
6
- /**
7
- * Get the root span for the given span.
8
- * The given span may be the root span itself.
9
- */
10
- export declare function getRootSpan(span: Span): Span;
11
6
  //# sourceMappingURL=getActiveSpan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getActiveSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/getActiveSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAK/C;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,GAAG,SAAS,CAEhD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAQ5C"}
1
+ {"version":3,"file":"getActiveSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/getActiveSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,GAAG,SAAS,CAEhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"groupSpansWithParents.d.ts","sourceRoot":"","sources":["../../../src/utils/groupSpansWithParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAIlE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,CAUvE"}
1
+ {"version":3,"file":"groupSpansWithParents.d.ts","sourceRoot":"","sources":["../../../src/utils/groupSpansWithParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,CAUvE"}
@@ -1,18 +1,5 @@
1
- import type { Span } from '@opentelemetry/api';
2
- import type { Hub, Scope, TransactionMetadata } from '@sentry/types';
1
+ import type { Scope } from '@sentry/types';
3
2
  import type { AbstractSpan } from '../types';
4
- /** Set the Sentry hub on an OTEL span. */
5
- export declare function setSpanHub(span: AbstractSpan, hub: Hub): void;
6
- /** Get the Sentry hub of an OTEL span. */
7
- export declare function getSpanHub(span: AbstractSpan): Hub | undefined;
8
- /** Set the parent OTEL span on an OTEL span. */
9
- export declare function setSpanParent(span: AbstractSpan, parentSpan: Span): void;
10
- /** Get the parent OTEL span of an OTEL span. */
11
- export declare function getSpanParent(span: AbstractSpan): Span | undefined;
12
- /** Set metadata for an OTEL span. */
13
- export declare function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void;
14
- /** Get metadata for an OTEL span. */
15
- export declare function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined;
16
3
  /**
17
4
  * Set the Sentry scope to be used for finishing a given OTEL span.
18
5
  * This is different from `setCapturedScopesOnSpan`, as that works on _sentry_ spans,
@@ -1 +1 @@
1
- {"version":3,"file":"spanData.d.ts","sourceRoot":"","sources":["../../../src/utils/spanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAgB7C,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CAE7D;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAE9D;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,CAExE;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAElE;AAED,qCAAqC;AACrC,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAEhG;AAED,qCAAqC;AACrC,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAE5F;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE;IACN,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB,GACA,IAAI,CAEN;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAC5C;IACE,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB,GACD,SAAS,CAEZ"}
1
+ {"version":3,"file":"spanData.d.ts","sourceRoot":"","sources":["../../../src/utils/spanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAa7C;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE;IACN,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB,GACA,IAAI,CAEN;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAC5C;IACE,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB,GACD,SAAS,CAEZ"}
@@ -1,9 +1,8 @@
1
1
  export declare const SENTRY_TRACE_HEADER = "sentry-trace";
2
2
  export declare const SENTRY_BAGGAGE_HEADER = "baggage";
3
- export declare const SENTRY_TRACE_STATE_DSC = "sentry.trace";
3
+ export declare const SENTRY_TRACE_STATE_DSC = "sentry.dsc";
4
4
  export declare const SENTRY_TRACE_STATE_PARENT_SPAN_ID = "sentry.parent_span_id";
5
- /** Context Key to hold a Hub. */
6
- export declare const SENTRY_HUB_CONTEXT_KEY: symbol;
5
+ export declare const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording";
7
6
  export declare const SENTRY_SCOPES_CONTEXT_KEY: symbol;
8
7
  export declare const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY: symbol;
9
8
  export declare const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY: symbol;
@@ -1,18 +1,17 @@
1
- import { addOriginToSpan } from './utils/addOriginToSpan';
2
1
  import { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';
3
2
  import { getRequestSpanData } from './utils/getRequestSpanData';
4
3
  export { OpenTelemetryClient } from './types';
5
4
  export { wrapClientClass } from './custom/client';
6
5
  export { getSpanKind } from './utils/getSpanKind';
7
- export { getSpanHub, getSpanMetadata, getSpanParent, setSpanMetadata, getSpanScopes, } from './utils/spanData';
6
+ export { getSpanScopes } from './utils/spanData';
8
7
  export { getScopesFromContext } from './utils/contextData';
9
8
  export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
9
+ export { getDynamicSamplingContextFromSpan } from './utils/dynamicSamplingContext';
10
10
  export { isSentryRequestSpan } from './utils/isSentryRequest';
11
- export { getActiveSpan, getRootSpan } from './utils/getActiveSpan';
12
- export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan } from './trace';
11
+ export { getActiveSpan } from './utils/getActiveSpan';
12
+ export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan, continueTrace } from './trace';
13
13
  export { setupGlobalHub } from './custom/hub';
14
14
  export { getCurrentHub } from './custom/getCurrentHub';
15
- export { addTracingExtensions } from './custom/hubextensions';
16
15
  export { setupEventContextTrace } from './setupEventContextTrace';
17
16
  export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
18
17
  export { wrapContextManagerClass } from './contextManager';
@@ -26,7 +25,6 @@ export { getClient } from '@sentry/core';
26
25
  * @hidden
27
26
  */
28
27
  declare const _INTERNAL: {
29
- readonly addOriginToSpan: typeof addOriginToSpan;
30
28
  readonly maybeCaptureExceptionForTimedEvent: typeof maybeCaptureExceptionForTimedEvent;
31
29
  readonly getRequestSpanData: typeof getRequestSpanData;
32
30
  };
@@ -1,5 +1,6 @@
1
1
  import { Context, SpanContext, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
2
2
  import { TraceState, W3CBaggagePropagator } from '@opentelemetry/core';
3
+ import { continueTrace } from '@sentry/core';
3
4
  import { DynamicSamplingContext, PropagationContext } from '@sentry/types';
4
5
  /** Get the Sentry propagation context from a span context. */
5
6
  export declare function getPropagationContextFromSpanContext(spanContext: SpanContext): PropagationContext;
@@ -22,8 +23,22 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
22
23
  fields(): string[];
23
24
  }
24
25
  /** Exported for tests. */
25
- export declare function makeTraceState({ parentSpanId, dsc, }: {
26
+ export declare function makeTraceState({ parentSpanId, dsc, sampled, }: {
26
27
  parentSpanId?: string;
27
28
  dsc?: Partial<DynamicSamplingContext>;
29
+ sampled?: boolean;
28
30
  }): TraceState | undefined;
31
+ /**
32
+ * Takes trace strings and propagates them as a remote active span.
33
+ * This should be used in addition to `continueTrace` in OTEL-powered environments.
34
+ */
35
+ export declare function continueTraceAsRemoteSpan<T>(ctx: Context, options: Parameters<typeof continueTrace>[0], callback: () => T): T;
36
+ /**
37
+ * OpenTelemetry only knows about SAMPLED or NONE decision,
38
+ * but for us it is important to differentiate between unset and unsampled.
39
+ *
40
+ * Both of these are identified as `traceFlags === TracegFlags.NONE`,
41
+ * but we additionally look at a special trace state to differentiate between them.
42
+ */
43
+ export declare function getSamplingDecision(spanContext: SpanContext): boolean | undefined;
29
44
  //# sourceMappingURL=propagator.d.ts.map
@@ -1,8 +1,3 @@
1
- /**
2
- * These are internal and are not supposed to be used/depended on by external parties.
3
- * No guarantees apply to these attributes, and the may change/disappear at any time.
4
- */
5
- export declare const InternalSentrySemanticAttributes: {
6
- readonly PARENT_SAMPLED: "sentry.parentSampled";
7
- };
1
+ /** If this attribute is true, it means that the parent is a remote span. */
2
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote";
8
3
  //# sourceMappingURL=semanticAttributes.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { Span } from '@opentelemetry/api';
2
+ import { continueTrace as baseContinueTrace } from '@sentry/core';
2
3
  import { Scope } from '@sentry/types';
3
4
  import { OpenTelemetrySpanContext } from './types';
4
5
  /**
@@ -20,7 +21,7 @@ export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback
20
21
  *
21
22
  * Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
22
23
  */
23
- export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
24
+ export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span, finish: () => void) => T): T;
24
25
  /**
25
26
  * @deprecated Use {@link startSpan} instead.
26
27
  */
@@ -46,4 +47,16 @@ export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Sp
46
47
  * @returns the value returned from the provided callback function.
47
48
  */
48
49
  export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
50
+ /**
51
+ * Continue a trace from `sentry-trace` and `baggage` values.
52
+ * These values can be obtained from incoming request headers, or in the browser from `<meta name="sentry-trace">`
53
+ * and `<meta name="baggage">` HTML tags.
54
+ *
55
+ * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically
56
+ * be attached to the incoming trace.
57
+ *
58
+ * This is a custom version of `continueTrace` that is used in OTEL-powered environments.
59
+ * It propagates the trace as a remote span, in addition to setting it on the propagation context.
60
+ */
61
+ export declare function continueTrace<T>(options: Parameters<typeof baseContinueTrace>[0], callback: () => T): T;
49
62
  //# sourceMappingURL=trace.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
2
- import { BasicTracerProvider, ReadableSpan, Span } from '@opentelemetry/sdk-trace-base';
3
- import { Scope, StartSpanOptions } from '@sentry/types';
2
+ import { BasicTracerProvider, ReadableSpan } from '@opentelemetry/sdk-trace-base';
3
+ import { Scope, Span, StartSpanOptions } from '@sentry/types';
4
4
  export interface OpenTelemetryClient {
5
5
  tracer: Tracer;
6
6
  traceProvider: BasicTracerProvider | undefined;
@@ -17,8 +17,7 @@ export interface OpenTelemetrySpanContext extends StartSpanOptions {
17
17
  * Note that technically, the `Span` exported from `@opentelemwetry/sdk-trace-base` matches this,
18
18
  * but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
19
19
  */
20
- export type AbstractSpan = WriteableSpan | ReadableSpan;
21
- export { Span };
20
+ export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
22
21
  export interface CurrentScopes {
23
22
  scope: Scope;
24
23
  isolationScope: Scope;
@@ -1,8 +1,7 @@
1
1
  import { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
2
- import { Hub } from '@sentry/types';
3
2
  /**
4
3
  * Maybe capture a Sentry exception for an OTEL timed event.
5
4
  * This will check if the event is exception-like and in that case capture it as an exception.
6
5
  */
7
- export declare function maybeCaptureExceptionForTimedEvent(hub: Hub, event: TimedEvent, otelSpan?: OtelSpan): void;
6
+ export declare function maybeCaptureExceptionForTimedEvent(event: TimedEvent, otelSpan?: OtelSpan): void;
8
7
  //# sourceMappingURL=captureExceptionForTimedEvent.d.ts.map
@@ -1,16 +1,6 @@
1
1
  import { Context } from '@opentelemetry/api';
2
- import { Hub, Scope } from '@sentry/types';
2
+ import { Scope } from '@sentry/types';
3
3
  import { CurrentScopes } from '../types';
4
- /**
5
- * Try to get the Hub from the given OTEL context.
6
- * This requires a Context Manager that was wrapped with getWrappedContextManager.
7
- */
8
- export declare function getHubFromContext(context: Context): Hub | undefined;
9
- /**
10
- * Set a Hub on an OTEL context..
11
- * This will return a forked context with the Propagation Context set.
12
- */
13
- export declare function setHubOnContext(context: Context, hub: Hub): Context;
14
4
  /**
15
5
  * Try to get the current scopes from the given OTEL context.
16
6
  * This requires a Context Manager that was wrapped with getWrappedContextManager.
@@ -3,9 +3,4 @@ import { Span } from '@opentelemetry/api';
3
3
  * Returns the currently active span.
4
4
  */
5
5
  export declare function getActiveSpan(): Span | undefined;
6
- /**
7
- * Get the root span for the given span.
8
- * The given span may be the root span itself.
9
- */
10
- export declare function getRootSpan(span: Span): Span;
11
6
  //# sourceMappingURL=getActiveSpan.d.ts.map
@@ -1,18 +1,5 @@
1
- import { Span } from '@opentelemetry/api';
2
- import { Hub, Scope, TransactionMetadata } from '@sentry/types';
1
+ import { Scope } from '@sentry/types';
3
2
  import { AbstractSpan } from '../types';
4
- /** Set the Sentry hub on an OTEL span. */
5
- export declare function setSpanHub(span: AbstractSpan, hub: Hub): void;
6
- /** Get the Sentry hub of an OTEL span. */
7
- export declare function getSpanHub(span: AbstractSpan): Hub | undefined;
8
- /** Set the parent OTEL span on an OTEL span. */
9
- export declare function setSpanParent(span: AbstractSpan, parentSpan: Span): void;
10
- /** Get the parent OTEL span of an OTEL span. */
11
- export declare function getSpanParent(span: AbstractSpan): Span | undefined;
12
- /** Set metadata for an OTEL span. */
13
- export declare function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void;
14
- /** Get metadata for an OTEL span. */
15
- export declare function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined;
16
3
  /**
17
4
  * Set the Sentry scope to be used for finishing a given OTEL span.
18
5
  * This is different from `setCapturedScopesOnSpan`, as that works on _sentry_ spans,