@sentry/opentelemetry 7.74.2-alpha.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 (209) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +98 -0
  3. package/cjs/asyncContextStrategy.js +46 -0
  4. package/cjs/asyncContextStrategy.js.map +1 -0
  5. package/cjs/constants.js +18 -0
  6. package/cjs/constants.js.map +1 -0
  7. package/cjs/contextManager.js +59 -0
  8. package/cjs/contextManager.js.map +1 -0
  9. package/cjs/custom/client.js +81 -0
  10. package/cjs/custom/client.js.map +1 -0
  11. package/cjs/custom/hub.js +165 -0
  12. package/cjs/custom/hub.js.map +1 -0
  13. package/cjs/custom/hubextensions.js +34 -0
  14. package/cjs/custom/hubextensions.js.map +1 -0
  15. package/cjs/custom/scope.js +181 -0
  16. package/cjs/custom/scope.js.map +1 -0
  17. package/cjs/custom/transaction.js +52 -0
  18. package/cjs/custom/transaction.js.map +1 -0
  19. package/cjs/index.js +63 -0
  20. package/cjs/index.js.map +1 -0
  21. package/cjs/propagator.js +132 -0
  22. package/cjs/propagator.js.map +1 -0
  23. package/cjs/sampler.js +185 -0
  24. package/cjs/sampler.js.map +1 -0
  25. package/cjs/semanticAttributes.js +21 -0
  26. package/cjs/semanticAttributes.js.map +1 -0
  27. package/cjs/setupEventContextTrace.js +35 -0
  28. package/cjs/setupEventContextTrace.js.map +1 -0
  29. package/cjs/spanExporter.js +302 -0
  30. package/cjs/spanExporter.js.map +1 -0
  31. package/cjs/spanProcessor.js +88 -0
  32. package/cjs/spanProcessor.js.map +1 -0
  33. package/cjs/trace.js +107 -0
  34. package/cjs/trace.js.map +1 -0
  35. package/cjs/utils/addOriginToSpan.js +11 -0
  36. package/cjs/utils/addOriginToSpan.js.map +1 -0
  37. package/cjs/utils/captureExceptionForTimedEvent.js +58 -0
  38. package/cjs/utils/captureExceptionForTimedEvent.js.map +1 -0
  39. package/cjs/utils/contextData.js +41 -0
  40. package/cjs/utils/contextData.js.map +1 -0
  41. package/cjs/utils/convertOtelTimeToSeconds.js +9 -0
  42. package/cjs/utils/convertOtelTimeToSeconds.js.map +1 -0
  43. package/cjs/utils/getActiveSpan.js +29 -0
  44. package/cjs/utils/getActiveSpan.js.map +1 -0
  45. package/cjs/utils/getRequestSpanData.js +48 -0
  46. package/cjs/utils/getRequestSpanData.js.map +1 -0
  47. package/cjs/utils/getSpanKind.js +21 -0
  48. package/cjs/utils/getSpanKind.js.map +1 -0
  49. package/cjs/utils/groupSpansWithParents.js +74 -0
  50. package/cjs/utils/groupSpansWithParents.js.map +1 -0
  51. package/cjs/utils/isSentryRequest.js +29 -0
  52. package/cjs/utils/isSentryRequest.js.map +1 -0
  53. package/cjs/utils/mapStatus.js +76 -0
  54. package/cjs/utils/mapStatus.js.map +1 -0
  55. package/cjs/utils/parseSpanDescription.js +158 -0
  56. package/cjs/utils/parseSpanDescription.js.map +1 -0
  57. package/cjs/utils/spanData.js +59 -0
  58. package/cjs/utils/spanData.js.map +1 -0
  59. package/cjs/utils/spanTypes.js +77 -0
  60. package/cjs/utils/spanTypes.js.map +1 -0
  61. package/esm/asyncContextStrategy.js +41 -0
  62. package/esm/asyncContextStrategy.js.map +1 -0
  63. package/esm/constants.js +13 -0
  64. package/esm/constants.js.map +1 -0
  65. package/esm/contextManager.js +57 -0
  66. package/esm/contextManager.js.map +1 -0
  67. package/esm/custom/client.js +76 -0
  68. package/esm/custom/client.js.map +1 -0
  69. package/esm/custom/hub.js +159 -0
  70. package/esm/custom/hub.js.map +1 -0
  71. package/esm/custom/hubextensions.js +32 -0
  72. package/esm/custom/hubextensions.js.map +1 -0
  73. package/esm/custom/scope.js +179 -0
  74. package/esm/custom/scope.js.map +1 -0
  75. package/esm/custom/transaction.js +49 -0
  76. package/esm/custom/transaction.js.map +1 -0
  77. package/esm/index.js +32 -0
  78. package/esm/index.js.map +1 -0
  79. package/esm/propagator.js +127 -0
  80. package/esm/propagator.js.map +1 -0
  81. package/esm/sampler.js +183 -0
  82. package/esm/sampler.js.map +1 -0
  83. package/esm/semanticAttributes.js +19 -0
  84. package/esm/semanticAttributes.js.map +1 -0
  85. package/esm/setupEventContextTrace.js +33 -0
  86. package/esm/setupEventContextTrace.js.map +1 -0
  87. package/esm/spanExporter.js +300 -0
  88. package/esm/spanExporter.js.map +1 -0
  89. package/esm/spanProcessor.js +86 -0
  90. package/esm/spanProcessor.js.map +1 -0
  91. package/esm/trace.js +104 -0
  92. package/esm/trace.js.map +1 -0
  93. package/esm/utils/addOriginToSpan.js +9 -0
  94. package/esm/utils/addOriginToSpan.js.map +1 -0
  95. package/esm/utils/captureExceptionForTimedEvent.js +56 -0
  96. package/esm/utils/captureExceptionForTimedEvent.js.map +1 -0
  97. package/esm/utils/contextData.js +36 -0
  98. package/esm/utils/contextData.js.map +1 -0
  99. package/esm/utils/convertOtelTimeToSeconds.js +7 -0
  100. package/esm/utils/convertOtelTimeToSeconds.js.map +1 -0
  101. package/esm/utils/getActiveSpan.js +26 -0
  102. package/esm/utils/getActiveSpan.js.map +1 -0
  103. package/esm/utils/getRequestSpanData.js +46 -0
  104. package/esm/utils/getRequestSpanData.js.map +1 -0
  105. package/esm/utils/getSpanKind.js +19 -0
  106. package/esm/utils/getSpanKind.js.map +1 -0
  107. package/esm/utils/groupSpansWithParents.js +72 -0
  108. package/esm/utils/groupSpansWithParents.js.map +1 -0
  109. package/esm/utils/isSentryRequest.js +27 -0
  110. package/esm/utils/isSentryRequest.js.map +1 -0
  111. package/esm/utils/mapStatus.js +74 -0
  112. package/esm/utils/mapStatus.js.map +1 -0
  113. package/esm/utils/parseSpanDescription.js +154 -0
  114. package/esm/utils/parseSpanDescription.js.map +1 -0
  115. package/esm/utils/spanData.js +50 -0
  116. package/esm/utils/spanData.js.map +1 -0
  117. package/esm/utils/spanTypes.js +70 -0
  118. package/esm/utils/spanTypes.js.map +1 -0
  119. package/package.json +45 -0
  120. package/types/asyncContextStrategy.d.ts +6 -0
  121. package/types/asyncContextStrategy.d.ts.map +1 -0
  122. package/types/constants.d.ts +7 -0
  123. package/types/constants.d.ts.map +1 -0
  124. package/types/contextManager.d.ts +11 -0
  125. package/types/contextManager.d.ts.map +1 -0
  126. package/types/custom/client.d.ts +12 -0
  127. package/types/custom/client.d.ts.map +1 -0
  128. package/types/custom/hub.d.ts +40 -0
  129. package/types/custom/hub.d.ts.map +1 -0
  130. package/types/custom/hubextensions.d.ts +5 -0
  131. package/types/custom/hubextensions.d.ts.map +1 -0
  132. package/types/custom/scope.d.ts +34 -0
  133. package/types/custom/scope.d.ts.map +1 -0
  134. package/types/custom/transaction.d.ts +17 -0
  135. package/types/custom/transaction.d.ts.map +1 -0
  136. package/types/index.d.ts +31 -0
  137. package/types/index.d.ts.map +1 -0
  138. package/types/propagator.d.ts +20 -0
  139. package/types/propagator.d.ts.map +1 -0
  140. package/types/sampler.d.ts +15 -0
  141. package/types/sampler.d.ts.map +1 -0
  142. package/types/semanticAttributes.d.ts +17 -0
  143. package/types/semanticAttributes.d.ts.map +1 -0
  144. package/types/setupEventContextTrace.d.ts +4 -0
  145. package/types/setupEventContextTrace.d.ts.map +1 -0
  146. package/types/spanExporter.d.ts +17 -0
  147. package/types/spanExporter.d.ts.map +1 -0
  148. package/types/spanProcessor.d.ts +22 -0
  149. package/types/spanProcessor.d.ts.map +1 -0
  150. package/types/trace.d.ts +28 -0
  151. package/types/trace.d.ts.map +1 -0
  152. package/types/types.d.ts +26 -0
  153. package/types/types.d.ts.map +1 -0
  154. package/types/utils/addOriginToSpan.d.ts +5 -0
  155. package/types/utils/addOriginToSpan.d.ts.map +1 -0
  156. package/types/utils/captureExceptionForTimedEvent.d.ts +8 -0
  157. package/types/utils/captureExceptionForTimedEvent.d.ts.map +1 -0
  158. package/types/utils/contextData.d.ts +23 -0
  159. package/types/utils/contextData.d.ts.map +1 -0
  160. package/types/utils/convertOtelTimeToSeconds.d.ts +3 -0
  161. package/types/utils/convertOtelTimeToSeconds.d.ts.map +1 -0
  162. package/types/utils/getActiveSpan.d.ts +11 -0
  163. package/types/utils/getActiveSpan.d.ts.map +1 -0
  164. package/types/utils/getRequestSpanData.d.ts +8 -0
  165. package/types/utils/getRequestSpanData.d.ts.map +1 -0
  166. package/types/utils/getSpanKind.d.ts +10 -0
  167. package/types/utils/getSpanKind.d.ts.map +1 -0
  168. package/types/utils/groupSpansWithParents.d.ts +13 -0
  169. package/types/utils/groupSpansWithParents.d.ts.map +1 -0
  170. package/types/utils/isSentryRequest.d.ts +8 -0
  171. package/types/utils/isSentryRequest.d.ts.map +1 -0
  172. package/types/utils/mapStatus.d.ts +7 -0
  173. package/types/utils/mapStatus.d.ts.map +1 -0
  174. package/types/utils/parseSpanDescription.d.ts +32 -0
  175. package/types/utils/parseSpanDescription.d.ts.map +1 -0
  176. package/types/utils/spanData.d.ts +20 -0
  177. package/types/utils/spanData.d.ts.map +1 -0
  178. package/types/utils/spanTypes.d.ts +52 -0
  179. package/types/utils/spanTypes.d.ts.map +1 -0
  180. package/types-ts3.8/asyncContextStrategy.d.ts +6 -0
  181. package/types-ts3.8/constants.d.ts +7 -0
  182. package/types-ts3.8/contextManager.d.ts +11 -0
  183. package/types-ts3.8/custom/client.d.ts +12 -0
  184. package/types-ts3.8/custom/hub.d.ts +40 -0
  185. package/types-ts3.8/custom/hubextensions.d.ts +5 -0
  186. package/types-ts3.8/custom/scope.d.ts +34 -0
  187. package/types-ts3.8/custom/transaction.d.ts +17 -0
  188. package/types-ts3.8/index.d.ts +31 -0
  189. package/types-ts3.8/propagator.d.ts +20 -0
  190. package/types-ts3.8/sampler.d.ts +15 -0
  191. package/types-ts3.8/semanticAttributes.d.ts +17 -0
  192. package/types-ts3.8/setupEventContextTrace.d.ts +4 -0
  193. package/types-ts3.8/spanExporter.d.ts +17 -0
  194. package/types-ts3.8/spanProcessor.d.ts +22 -0
  195. package/types-ts3.8/trace.d.ts +28 -0
  196. package/types-ts3.8/types.d.ts +26 -0
  197. package/types-ts3.8/utils/addOriginToSpan.d.ts +5 -0
  198. package/types-ts3.8/utils/captureExceptionForTimedEvent.d.ts +8 -0
  199. package/types-ts3.8/utils/contextData.d.ts +23 -0
  200. package/types-ts3.8/utils/convertOtelTimeToSeconds.d.ts +6 -0
  201. package/types-ts3.8/utils/getActiveSpan.d.ts +11 -0
  202. package/types-ts3.8/utils/getRequestSpanData.d.ts +8 -0
  203. package/types-ts3.8/utils/getSpanKind.d.ts +10 -0
  204. package/types-ts3.8/utils/groupSpansWithParents.d.ts +13 -0
  205. package/types-ts3.8/utils/isSentryRequest.d.ts +8 -0
  206. package/types-ts3.8/utils/mapStatus.d.ts +7 -0
  207. package/types-ts3.8/utils/parseSpanDescription.d.ts +32 -0
  208. package/types-ts3.8/utils/spanData.d.ts +20 -0
  209. package/types-ts3.8/utils/spanTypes.d.ts +52 -0
@@ -0,0 +1,88 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const api = require('@opentelemetry/api');
4
+ const sdkTraceBase = require('@opentelemetry/sdk-trace-base');
5
+ const utils = require('@sentry/utils');
6
+ const hub = require('./custom/hub.js');
7
+ const spanExporter = require('./spanExporter.js');
8
+ const captureExceptionForTimedEvent = require('./utils/captureExceptionForTimedEvent.js');
9
+ const contextData = require('./utils/contextData.js');
10
+ const spanData = require('./utils/spanData.js');
11
+
12
+ function onSpanStart(span, parentContext) {
13
+ // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK
14
+ const parentSpan = api.trace.getSpan(parentContext);
15
+ const hub$1 = contextData.getHubFromContext(parentContext);
16
+
17
+ // We need access to the parent span in order to be able to move up the span tree for breadcrumbs
18
+ if (parentSpan) {
19
+ spanData.setSpanParent(span, parentSpan);
20
+ }
21
+
22
+ // The root context does not have a hub stored, so we check for this specifically
23
+ // We do this instead of just falling back to `getCurrentHub` to avoid attaching the wrong hub
24
+ let actualHub = hub$1;
25
+ if (parentContext === api.ROOT_CONTEXT) {
26
+ actualHub = hub.getCurrentHub();
27
+ }
28
+
29
+ // We need the scope at time of span creation in order to apply it to the event when the span is finished
30
+ if (actualHub) {
31
+ spanData.setSpanScope(span, actualHub.getScope());
32
+ spanData.setSpanHub(span, actualHub);
33
+ }
34
+ }
35
+
36
+ function onSpanEnd(span) {
37
+ // Capture exceptions as events
38
+ const hub$1 = spanData.getSpanHub(span) || hub.getCurrentHub();
39
+ span.events.forEach(event => {
40
+ captureExceptionForTimedEvent.maybeCaptureExceptionForTimedEvent(hub$1, event, span);
41
+ });
42
+ }
43
+
44
+ /**
45
+ * Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
46
+ * the Sentry SDK.
47
+ */
48
+ class SentrySpanProcessor extends sdkTraceBase.BatchSpanProcessor {
49
+ constructor() {
50
+ super(new spanExporter.SentrySpanExporter());
51
+ }
52
+
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ onStart(span, parentContext) {
57
+ onSpanStart(span, parentContext);
58
+
59
+ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] Starting span "${span.name}" (${span.spanContext().spanId})`);
60
+
61
+ return super.onStart(span, parentContext);
62
+ }
63
+
64
+ /** @inheritDoc */
65
+ onEnd(span) {
66
+ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] Finishing span "${span.name}" (${span.spanContext().spanId})`);
67
+
68
+ if (!this._shouldSendSpanToSentry(span)) {
69
+ // Prevent this being called to super.onEnd(), which would pass this to the span exporter
70
+ return;
71
+ }
72
+
73
+ onSpanEnd(span);
74
+
75
+ return super.onEnd(span);
76
+ }
77
+
78
+ /**
79
+ * You can overwrite this in a sub class to implement custom behavior for dropping spans.
80
+ * If you return `false` here, the span will not be passed to the exporter and thus not be sent.
81
+ */
82
+ _shouldSendSpanToSentry(_span) {
83
+ return true;
84
+ }
85
+ }
86
+
87
+ exports.SentrySpanProcessor = SentrySpanProcessor;
88
+ //# sourceMappingURL=spanProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanProcessor.js","sources":["../../src/spanProcessor.ts"],"sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport { ROOT_CONTEXT, trace } from '@opentelemetry/api';\nimport type { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './custom/hub';\nimport { SentrySpanExporter } from './spanExporter';\nimport { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';\nimport { getHubFromContext } from './utils/contextData';\nimport { getSpanHub, setSpanHub, setSpanParent, setSpanScope } from './utils/spanData';\n\nfunction onSpanStart(span: Span, parentContext: Context): void {\n // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK\n const parentSpan = trace.getSpan(parentContext);\n const hub = getHubFromContext(parentContext);\n\n // We need access to the parent span in order to be able to move up the span tree for breadcrumbs\n if (parentSpan) {\n setSpanParent(span, parentSpan);\n }\n\n // The root context does not have a hub stored, so we check for this specifically\n // We do this instead of just falling back to `getCurrentHub` to avoid attaching the wrong hub\n let actualHub = hub;\n if (parentContext === ROOT_CONTEXT) {\n actualHub = getCurrentHub();\n }\n\n // We need the scope at time of span creation in order to apply it to the event when the span is finished\n if (actualHub) {\n setSpanScope(span, actualHub.getScope());\n setSpanHub(span, actualHub);\n }\n}\n\nfunction onSpanEnd(span: Span): void {\n // Capture exceptions as events\n const hub = getSpanHub(span) || getCurrentHub();\n span.events.forEach(event => {\n maybeCaptureExceptionForTimedEvent(hub, event, span);\n });\n}\n\n/**\n * Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via\n * the Sentry SDK.\n */\nexport class SentrySpanProcessor extends BatchSpanProcessor implements SpanProcessorInterface {\n public constructor() {\n super(new SentrySpanExporter());\n }\n\n /**\n * @inheritDoc\n */\n public onStart(span: Span, parentContext: Context): void {\n onSpanStart(span, parentContext);\n\n __DEBUG_BUILD__ && logger.log(`[Tracing] Starting span \"${span.name}\" (${span.spanContext().spanId})`);\n\n return super.onStart(span, parentContext);\n }\n\n /** @inheritDoc */\n public onEnd(span: Span): void {\n __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing span \"${span.name}\" (${span.spanContext().spanId})`);\n\n if (!this._shouldSendSpanToSentry(span)) {\n // Prevent this being called to super.onEnd(), which would pass this to the span exporter\n return;\n }\n\n onSpanEnd(span);\n\n return super.onEnd(span);\n }\n\n /**\n * You can overwrite this in a sub class to implement custom behavior for dropping spans.\n * If you return `false` here, the span will not be passed to the exporter and thus not be sent.\n */\n protected _shouldSendSpanToSentry(_span: Span): boolean {\n return true;\n }\n}\n"],"names":["trace","hub","getHubFromContext","setSpanParent","ROOT_CONTEXT","getCurrentHub","setSpanScope","setSpanHub","getSpanHub","maybeCaptureExceptionForTimedEvent","BatchSpanProcessor","SentrySpanExporter","logger"],"mappings":";;;;;;;;;;;AAYA,SAAA,WAAA,CAAA,IAAA,EAAA,aAAA,EAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAAA,SAAA,CAAA,OAAA,CAAA,aAAA,CAAA,CAAA;AACA,EAAA,MAAAC,KAAA,GAAAC,6BAAA,CAAA,aAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,UAAA,EAAA;AACA,IAAAC,sBAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,SAAA,GAAAF,KAAA,CAAA;AACA,EAAA,IAAA,aAAA,KAAAG,gBAAA,EAAA;AACA,IAAA,SAAA,GAAAC,iBAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAAC,qBAAA,CAAA,IAAA,EAAA,SAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AACA,IAAAC,mBAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA,SAAA,SAAA,CAAA,IAAA,EAAA;AACA;AACA,EAAA,MAAAN,KAAA,GAAAO,mBAAA,CAAA,IAAA,CAAA,IAAAH,iBAAA,EAAA,CAAA;AACA,EAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,KAAA,IAAA;AACA,IAAAI,gEAAA,CAAAR,KAAA,EAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,SAAAS,+BAAA,EAAA;AACA,GAAA,WAAA,GAAA;AACA,IAAA,KAAA,CAAA,IAAAC,+BAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,OAAA,CAAA,IAAA,EAAA,aAAA,EAAA;AACA,IAAA,WAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AACA;AACA,IAAA,iEAAAC,YAAA,CAAA,GAAA,CAAA,CAAA,yBAAA,EAAA,IAAA,CAAA,IAAA,CAAA,GAAA,EAAA,IAAA,CAAA,WAAA,EAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA,OAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,GAAA,KAAA,CAAA,IAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAA,YAAA,CAAA,GAAA,CAAA,CAAA,0BAAA,EAAA,IAAA,CAAA,IAAA,CAAA,GAAA,EAAA,IAAA,CAAA,WAAA,EAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,EAAA;AACA;AACA,MAAA,OAAA;AACA,KAAA;AACA;AACA,IAAA,SAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA,KAAA,CAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,uBAAA,CAAA,KAAA,EAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA;AACA;;;;"}
package/cjs/trace.js ADDED
@@ -0,0 +1,107 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const api = require('@opentelemetry/api');
4
+ const core = require('@sentry/core');
5
+ const utils = require('@sentry/utils');
6
+ const hub = require('./custom/hub.js');
7
+ const semanticAttributes = require('./semanticAttributes.js');
8
+ const spanData = require('./utils/spanData.js');
9
+
10
+ /**
11
+ * Wraps a function with a transaction/span and finishes the span after the function is done.
12
+ * The created span is the active span and will be used as parent by other spans created inside the function
13
+ * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.
14
+ *
15
+ * If you want to create a span that is not set as active, use {@link startInactiveSpan}.
16
+ *
17
+ * Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
18
+ */
19
+ function startSpan(spanContext, callback) {
20
+ const tracer = getTracer();
21
+
22
+ const { name } = spanContext;
23
+
24
+ return tracer.startActiveSpan(name, span => {
25
+ function finishSpan() {
26
+ span.end();
27
+ }
28
+
29
+ _applySentryAttributesToSpan(span, spanContext);
30
+
31
+ let maybePromiseResult;
32
+ try {
33
+ maybePromiseResult = callback(span);
34
+ } catch (e) {
35
+ span.setStatus({ code: api.SpanStatusCode.ERROR });
36
+ finishSpan();
37
+ throw e;
38
+ }
39
+
40
+ if (utils.isThenable(maybePromiseResult)) {
41
+ Promise.resolve(maybePromiseResult).then(
42
+ () => {
43
+ finishSpan();
44
+ },
45
+ () => {
46
+ span.setStatus({ code: api.SpanStatusCode.ERROR });
47
+ finishSpan();
48
+ },
49
+ );
50
+ } else {
51
+ finishSpan();
52
+ }
53
+
54
+ return maybePromiseResult;
55
+ });
56
+ }
57
+
58
+ /**
59
+ * Creates a span. This span is not set as active, so will not get automatic instrumentation spans
60
+ * as children or be able to be accessed via `Sentry.getSpan()`.
61
+ *
62
+ * If you want to create a span that is set as active, use {@link startSpan}.
63
+ *
64
+ * Note that if you have not enabled tracing extensions via `addTracingExtensions`
65
+ * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans
66
+ * and the `span` returned from the callback will be undefined.
67
+ */
68
+ function startInactiveSpan(spanContext) {
69
+ const tracer = getTracer();
70
+
71
+ const { name } = spanContext;
72
+
73
+ const span = tracer.startSpan(name);
74
+
75
+ _applySentryAttributesToSpan(span, spanContext);
76
+
77
+ return span;
78
+ }
79
+
80
+ function getTracer() {
81
+ const client = hub.getCurrentHub().getClient();
82
+ return (client && client.tracer) || api.trace.getTracer('@sentry/opentelemetry', core.SDK_VERSION);
83
+ }
84
+
85
+ function _applySentryAttributesToSpan(span, spanContext) {
86
+ const { origin, op, source, metadata } = spanContext;
87
+
88
+ if (origin) {
89
+ span.setAttribute(semanticAttributes.InternalSentrySemanticAttributes.ORIGIN, origin);
90
+ }
91
+
92
+ if (op) {
93
+ span.setAttribute(semanticAttributes.InternalSentrySemanticAttributes.OP, op);
94
+ }
95
+
96
+ if (source) {
97
+ span.setAttribute(semanticAttributes.InternalSentrySemanticAttributes.SOURCE, source);
98
+ }
99
+
100
+ if (metadata) {
101
+ spanData.setSpanMetadata(span, metadata);
102
+ }
103
+ }
104
+
105
+ exports.startInactiveSpan = startInactiveSpan;
106
+ exports.startSpan = startSpan;
107
+ //# sourceMappingURL=trace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.js","sources":["../../src/trace.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { SpanStatusCode, trace } from '@opentelemetry/api';\nimport { SDK_VERSION } from '@sentry/core';\nimport type { Client } from '@sentry/types';\nimport { isThenable } from '@sentry/utils';\n\nimport { getCurrentHub } from './custom/hub';\nimport { InternalSentrySemanticAttributes } from './semanticAttributes';\nimport type { OpenTelemetryClient, OpenTelemetrySpanContext } from './types';\nimport { setSpanMetadata } from './utils/spanData';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.\n */\nexport function startSpan<T>(spanContext: OpenTelemetrySpanContext, callback: (span: Span) => T): T {\n const tracer = getTracer();\n\n const { name } = spanContext;\n\n return tracer.startActiveSpan(name, span => {\n function finishSpan(): void {\n span.end();\n }\n\n _applySentryAttributesToSpan(span, spanContext);\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(span);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n finishSpan();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishSpan();\n },\n () => {\n span.setStatus({ code: SpanStatusCode.ERROR });\n finishSpan();\n },\n );\n } else {\n finishSpan();\n }\n\n return maybePromiseResult;\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(spanContext: OpenTelemetrySpanContext): Span {\n const tracer = getTracer();\n\n const { name } = spanContext;\n\n const span = tracer.startSpan(name);\n\n _applySentryAttributesToSpan(span, spanContext);\n\n return span;\n}\n\nfunction getTracer(): Tracer {\n const client = getCurrentHub().getClient<Client & OpenTelemetryClient>();\n return (client && client.tracer) || trace.getTracer('@sentry/opentelemetry', SDK_VERSION);\n}\n\nfunction _applySentryAttributesToSpan(span: Span, spanContext: OpenTelemetrySpanContext): void {\n const { origin, op, source, metadata } = spanContext;\n\n if (origin) {\n span.setAttribute(InternalSentrySemanticAttributes.ORIGIN, origin);\n }\n\n if (op) {\n span.setAttribute(InternalSentrySemanticAttributes.OP, op);\n }\n\n if (source) {\n span.setAttribute(InternalSentrySemanticAttributes.SOURCE, source);\n }\n\n if (metadata) {\n setSpanMetadata(span, metadata);\n }\n}\n"],"names":["SpanStatusCode","isThenable","getCurrentHub","trace","SDK_VERSION","InternalSentrySemanticAttributes","setSpanMetadata"],"mappings":";;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,WAAA,EAAA,QAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,IAAA,EAAA,GAAA,WAAA,CAAA;AACA;AACA,EAAA,OAAA,MAAA,CAAA,eAAA,CAAA,IAAA,EAAA,IAAA,IAAA;AACA,IAAA,SAAA,UAAA,GAAA;AACA,MAAA,IAAA,CAAA,GAAA,EAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,4BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,kBAAA,CAAA;AACA,IAAA,IAAA;AACA,MAAA,kBAAA,GAAA,QAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,SAAA,CAAA,EAAA,IAAA,EAAAA,kBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACA,MAAA,UAAA,EAAA,CAAA;AACA,MAAA,MAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,IAAAC,gBAAA,CAAA,kBAAA,CAAA,EAAA;AACA,MAAA,OAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,CAAA,IAAA;AACA,QAAA,MAAA;AACA,UAAA,UAAA,EAAA,CAAA;AACA,SAAA;AACA,QAAA,MAAA;AACA,UAAA,IAAA,CAAA,SAAA,CAAA,EAAA,IAAA,EAAAD,kBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACA,UAAA,UAAA,EAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,UAAA,EAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,kBAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,IAAA,EAAA,GAAA,WAAA,CAAA;AACA;AACA,EAAA,MAAA,IAAA,GAAA,MAAA,CAAA,SAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,EAAA,4BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,IAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,SAAA,GAAA;AACA,EAAA,MAAA,MAAA,GAAAE,iBAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,OAAA,CAAA,MAAA,IAAA,MAAA,CAAA,MAAA,KAAAC,SAAA,CAAA,SAAA,CAAA,uBAAA,EAAAC,gBAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,4BAAA,CAAA,IAAA,EAAA,WAAA,EAAA;AACA,EAAA,MAAA,EAAA,MAAA,EAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,WAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,IAAA,CAAA,YAAA,CAAAC,mDAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,EAAA,EAAA;AACA,IAAA,IAAA,CAAA,YAAA,CAAAA,mDAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,IAAA,CAAA,YAAA,CAAAA,mDAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,QAAA,EAAA;AACA,IAAAC,wBAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;;"}
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const semanticAttributes = require('../semanticAttributes.js');
4
+
5
+ /** Adds an origin to an OTEL Span. */
6
+ function addOriginToSpan(span, origin) {
7
+ span.setAttribute(semanticAttributes.InternalSentrySemanticAttributes.ORIGIN, origin);
8
+ }
9
+
10
+ exports.addOriginToSpan = addOriginToSpan;
11
+ //# sourceMappingURL=addOriginToSpan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addOriginToSpan.js","sources":["../../../src/utils/addOriginToSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { SpanOrigin } from '@sentry/types';\n\nimport { InternalSentrySemanticAttributes } from '../semanticAttributes';\n\n/** Adds an origin to an OTEL Span. */\nexport function addOriginToSpan(span: Span, origin: SpanOrigin): void {\n span.setAttribute(InternalSentrySemanticAttributes.ORIGIN, origin);\n}\n"],"names":["InternalSentrySemanticAttributes"],"mappings":";;;;AAKA;AACA,SAAA,eAAA,CAAA,IAAA,EAAA,MAAA,EAAA;AACA,EAAA,IAAA,CAAA,YAAA,CAAAA,mDAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,58 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const semanticConventions = require('@opentelemetry/semantic-conventions');
4
+ const utils = require('@sentry/utils');
5
+
6
+ /**
7
+ * Maybe capture a Sentry exception for an OTEL timed event.
8
+ * This will check if the event is exception-like and in that case capture it as an exception.
9
+ */
10
+ function maybeCaptureExceptionForTimedEvent(hub, event, otelSpan) {
11
+ if (event.name !== 'exception') {
12
+ return;
13
+ }
14
+
15
+ const attributes = event.attributes;
16
+ if (!attributes) {
17
+ return;
18
+ }
19
+
20
+ const message = attributes[semanticConventions.SemanticAttributes.EXCEPTION_MESSAGE];
21
+
22
+ if (typeof message !== 'string') {
23
+ return;
24
+ }
25
+
26
+ const syntheticError = new Error(message);
27
+
28
+ const stack = attributes[semanticConventions.SemanticAttributes.EXCEPTION_STACKTRACE];
29
+ if (utils.isString(stack)) {
30
+ syntheticError.stack = stack;
31
+ }
32
+
33
+ const type = attributes[semanticConventions.SemanticAttributes.EXCEPTION_TYPE];
34
+ if (utils.isString(type)) {
35
+ syntheticError.name = type;
36
+ }
37
+
38
+ hub.captureException(syntheticError, {
39
+ captureContext: otelSpan
40
+ ? {
41
+ contexts: {
42
+ otel: {
43
+ attributes: otelSpan.attributes,
44
+ resource: otelSpan.resource.attributes,
45
+ },
46
+ trace: {
47
+ trace_id: otelSpan.spanContext().traceId,
48
+ span_id: otelSpan.spanContext().spanId,
49
+ parent_span_id: otelSpan.parentSpanId,
50
+ },
51
+ },
52
+ }
53
+ : undefined,
54
+ });
55
+ }
56
+
57
+ exports.maybeCaptureExceptionForTimedEvent = maybeCaptureExceptionForTimedEvent;
58
+ //# sourceMappingURL=captureExceptionForTimedEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captureExceptionForTimedEvent.js","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"sourcesContent":["import type { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { Hub } from '@sentry/types';\nimport { isString } from '@sentry/utils';\n\n/**\n * Maybe capture a Sentry exception for an OTEL timed event.\n * This will check if the event is exception-like and in that case capture it as an exception.\n */\nexport function maybeCaptureExceptionForTimedEvent(hub: Hub, event: TimedEvent, otelSpan?: OtelSpan): void {\n if (event.name !== 'exception') {\n return;\n }\n\n const attributes = event.attributes;\n if (!attributes) {\n return;\n }\n\n const message = attributes[SemanticAttributes.EXCEPTION_MESSAGE];\n\n if (typeof message !== 'string') {\n return;\n }\n\n const syntheticError = new Error(message);\n\n const stack = attributes[SemanticAttributes.EXCEPTION_STACKTRACE];\n if (isString(stack)) {\n syntheticError.stack = stack;\n }\n\n const type = attributes[SemanticAttributes.EXCEPTION_TYPE];\n if (isString(type)) {\n syntheticError.name = type;\n }\n\n hub.captureException(syntheticError, {\n captureContext: otelSpan\n ? {\n contexts: {\n otel: {\n attributes: otelSpan.attributes,\n resource: otelSpan.resource.attributes,\n },\n trace: {\n trace_id: otelSpan.spanContext().traceId,\n span_id: otelSpan.spanContext().spanId,\n parent_span_id: otelSpan.parentSpanId,\n },\n },\n }\n : undefined,\n });\n}\n"],"names":["SemanticAttributes","isString"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA,SAAA,kCAAA,CAAA,GAAA,EAAA,KAAA,EAAA,QAAA,EAAA;AACA,EAAA,IAAA,KAAA,CAAA,IAAA,KAAA,WAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,KAAA,CAAA,UAAA,CAAA;AACA,EAAA,IAAA,CAAA,UAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,UAAA,CAAAA,sCAAA,CAAA,iBAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,OAAA,OAAA,KAAA,QAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,cAAA,GAAA,IAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,UAAA,CAAAA,sCAAA,CAAA,oBAAA,CAAA,CAAA;AACA,EAAA,IAAAC,cAAA,CAAA,KAAA,CAAA,EAAA;AACA,IAAA,cAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,IAAA,GAAA,UAAA,CAAAD,sCAAA,CAAA,cAAA,CAAA,CAAA;AACA,EAAA,IAAAC,cAAA,CAAA,IAAA,CAAA,EAAA;AACA,IAAA,cAAA,CAAA,IAAA,GAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,GAAA,CAAA,gBAAA,CAAA,cAAA,EAAA;AACA,IAAA,cAAA,EAAA,QAAA;AACA,QAAA;AACA,UAAA,QAAA,EAAA;AACA,YAAA,IAAA,EAAA;AACA,cAAA,UAAA,EAAA,QAAA,CAAA,UAAA;AACA,cAAA,QAAA,EAAA,QAAA,CAAA,QAAA,CAAA,UAAA;AACA,aAAA;AACA,YAAA,KAAA,EAAA;AACA,cAAA,QAAA,EAAA,QAAA,CAAA,WAAA,EAAA,CAAA,OAAA;AACA,cAAA,OAAA,EAAA,QAAA,CAAA,WAAA,EAAA,CAAA,MAAA;AACA,cAAA,cAAA,EAAA,QAAA,CAAA,YAAA;AACA,aAAA;AACA,WAAA;AACA,SAAA;AACA,QAAA,SAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,41 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const constants = require('../constants.js');
4
+
5
+ /**
6
+ * Try to get the Propagation Context from the given OTEL context.
7
+ * This requires the SentryPropagator to be registered.
8
+ */
9
+ function getPropagationContextFromContext(context) {
10
+ return context.getValue(constants.SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY) ;
11
+ }
12
+
13
+ /**
14
+ * Set a Propagation Context on an OTEL context..
15
+ * This will return a forked context with the Propagation Context set.
16
+ */
17
+ function setPropagationContextOnContext(context, propagationContext) {
18
+ return context.setValue(constants.SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY, propagationContext);
19
+ }
20
+
21
+ /**
22
+ * Try to get the Hub from the given OTEL context.
23
+ * This requires a Context Manager that was wrapped with getWrappedContextManager.
24
+ */
25
+ function getHubFromContext(context) {
26
+ return context.getValue(constants.SENTRY_HUB_CONTEXT_KEY) ;
27
+ }
28
+
29
+ /**
30
+ * Set a Hub on an OTEL context..
31
+ * This will return a forked context with the Propagation Context set.
32
+ */
33
+ function setHubOnContext(context, hub) {
34
+ return context.setValue(constants.SENTRY_HUB_CONTEXT_KEY, hub);
35
+ }
36
+
37
+ exports.getHubFromContext = getHubFromContext;
38
+ exports.getPropagationContextFromContext = getPropagationContextFromContext;
39
+ exports.setHubOnContext = setHubOnContext;
40
+ exports.setPropagationContextOnContext = setPropagationContextOnContext;
41
+ //# sourceMappingURL=contextData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextData.js","sources":["../../../src/utils/contextData.ts"],"sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { Hub, PropagationContext } from '@sentry/types';\n\nimport { SENTRY_HUB_CONTEXT_KEY, SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY } from '../constants';\n\n/**\n * Try to get the Propagation Context from the given OTEL context.\n * This requires the SentryPropagator to be registered.\n */\nexport function getPropagationContextFromContext(context: Context): PropagationContext | undefined {\n return context.getValue(SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY) as PropagationContext | undefined;\n}\n\n/**\n * Set a Propagation Context on an OTEL context..\n * This will return a forked context with the Propagation Context set.\n */\nexport function setPropagationContextOnContext(context: Context, propagationContext: PropagationContext): Context {\n return context.setValue(SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY, propagationContext);\n}\n\n/**\n * Try to get the Hub from the given OTEL context.\n * This requires a Context Manager that was wrapped with getWrappedContextManager.\n */\nexport function getHubFromContext(context: Context): Hub | undefined {\n return context.getValue(SENTRY_HUB_CONTEXT_KEY) as Hub | undefined;\n}\n\n/**\n * Set a Hub on an OTEL context..\n * This will return a forked context with the Propagation Context set.\n */\nexport function setHubOnContext(context: Context, hub: Hub): Context {\n return context.setValue(SENTRY_HUB_CONTEXT_KEY, hub);\n}\n"],"names":["SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY","SENTRY_HUB_CONTEXT_KEY"],"mappings":";;;;AAKA;AACA;AACA;AACA;AACA,SAAA,gCAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,QAAA,CAAAA,gDAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,8BAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,QAAA,CAAAA,gDAAA,EAAA,kBAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,QAAA,CAAAC,gCAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,OAAA,EAAA,GAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,QAAA,CAAAA,gCAAA,EAAA,GAAA,CAAA,CAAA;AACA;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ /** Convert an OTEL time to seconds */
4
+ function convertOtelTimeToSeconds([seconds, nano]) {
5
+ return seconds + nano / 1000000000;
6
+ }
7
+
8
+ exports.convertOtelTimeToSeconds = convertOtelTimeToSeconds;
9
+ //# sourceMappingURL=convertOtelTimeToSeconds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertOtelTimeToSeconds.js","sources":["../../../src/utils/convertOtelTimeToSeconds.ts"],"sourcesContent":["/** Convert an OTEL time to seconds */\nexport function convertOtelTimeToSeconds([seconds, nano]: [number, number]): number {\n return seconds + nano / 1_000_000_000;\n}\n"],"names":[],"mappings":";;AAAA;AACA,SAAA,wBAAA,CAAA,CAAA,OAAA,EAAA,IAAA,CAAA,EAAA;AACA,EAAA,OAAA,OAAA,GAAA,IAAA,GAAA,UAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,29 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const api = require('@opentelemetry/api');
4
+ const spanData = require('./spanData.js');
5
+
6
+ /**
7
+ * Returns the currently active span.
8
+ */
9
+ function getActiveSpan() {
10
+ return api.trace.getActiveSpan();
11
+ }
12
+
13
+ /**
14
+ * Get the root span for the given span.
15
+ * The given span may be the root span itself.
16
+ */
17
+ function getRootSpan(span) {
18
+ let parent = span;
19
+
20
+ while (spanData.getSpanParent(parent)) {
21
+ parent = spanData.getSpanParent(parent) ;
22
+ }
23
+
24
+ return parent;
25
+ }
26
+
27
+ exports.getActiveSpan = getActiveSpan;
28
+ exports.getRootSpan = getRootSpan;
29
+ //# sourceMappingURL=getActiveSpan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getActiveSpan.js","sources":["../../../src/utils/getActiveSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\n\nimport { getSpanParent } from './spanData';\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n return trace.getActiveSpan();\n}\n\n/**\n * Get the root span for the given span.\n * The given span may be the root span itself.\n */\nexport function getRootSpan(span: Span): Span {\n let parent: Span = span;\n\n while (getSpanParent(parent)) {\n parent = getSpanParent(parent) as Span;\n }\n\n return parent;\n}\n"],"names":["trace","getSpanParent"],"mappings":";;;;;AAKA;AACA;AACA;AACA,SAAA,aAAA,GAAA;AACA,EAAA,OAAAA,SAAA,CAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,IAAA,EAAA;AACA,EAAA,IAAA,MAAA,GAAA,IAAA,CAAA;AACA;AACA,EAAA,OAAAC,sBAAA,CAAA,MAAA,CAAA,EAAA;AACA,IAAA,MAAA,GAAAA,sBAAA,CAAA,MAAA,CAAA,EAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,MAAA,CAAA;AACA;;;;;"}
@@ -0,0 +1,48 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const semanticConventions = require('@opentelemetry/semantic-conventions');
4
+ const utils = require('@sentry/utils');
5
+ const spanTypes = require('./spanTypes.js');
6
+
7
+ /**
8
+ * Get sanitizied request data from an OTEL span.
9
+ */
10
+ function getRequestSpanData(span) {
11
+ // The base `Span` type has no `attributes`, so we need to guard here against that
12
+ if (!spanTypes.spanHasAttributes(span)) {
13
+ return {};
14
+ }
15
+
16
+ const data = {
17
+ url: span.attributes[semanticConventions.SemanticAttributes.HTTP_URL] ,
18
+ 'http.method': span.attributes[semanticConventions.SemanticAttributes.HTTP_METHOD] ,
19
+ };
20
+
21
+ // Default to GET if URL is set but method is not
22
+ if (!data['http.method'] && data.url) {
23
+ data['http.method'] = 'GET';
24
+ }
25
+
26
+ try {
27
+ const urlStr = span.attributes[semanticConventions.SemanticAttributes.HTTP_URL];
28
+ if (typeof urlStr === 'string') {
29
+ const url = utils.parseUrl(urlStr);
30
+
31
+ data.url = utils.getSanitizedUrlString(url);
32
+
33
+ if (url.search) {
34
+ data['http.query'] = url.search;
35
+ }
36
+ if (url.hash) {
37
+ data['http.fragment'] = url.hash;
38
+ }
39
+ }
40
+ } catch (e) {
41
+ // ignore
42
+ }
43
+
44
+ return data;
45
+ }
46
+
47
+ exports.getRequestSpanData = getRequestSpanData;
48
+ //# sourceMappingURL=getRequestSpanData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequestSpanData.js","sources":["../../../src/utils/getRequestSpanData.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { SanitizedRequestData } from '@sentry/types';\nimport { getSanitizedUrlString, parseUrl } from '@sentry/utils';\n\nimport { spanHasAttributes } from './spanTypes';\n\n/**\n * Get sanitizied request data from an OTEL span.\n */\nexport function getRequestSpanData(span: Span | ReadableSpan): Partial<SanitizedRequestData> {\n // The base `Span` type has no `attributes`, so we need to guard here against that\n if (!spanHasAttributes(span)) {\n return {};\n }\n\n const data: Partial<SanitizedRequestData> = {\n url: span.attributes[SemanticAttributes.HTTP_URL] as string | undefined,\n 'http.method': span.attributes[SemanticAttributes.HTTP_METHOD] as string | undefined,\n };\n\n // Default to GET if URL is set but method is not\n if (!data['http.method'] && data.url) {\n data['http.method'] = 'GET';\n }\n\n try {\n const urlStr = span.attributes[SemanticAttributes.HTTP_URL];\n if (typeof urlStr === 'string') {\n const url = parseUrl(urlStr);\n\n data.url = getSanitizedUrlString(url);\n\n if (url.search) {\n data['http.query'] = url.search;\n }\n if (url.hash) {\n data['http.fragment'] = url.hash;\n }\n }\n } catch {\n // ignore\n }\n\n return data;\n}\n"],"names":["spanHasAttributes","SemanticAttributes","parseUrl","getSanitizedUrlString"],"mappings":";;;;;;AAQA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,IAAA,EAAA;AACA;AACA,EAAA,IAAA,CAAAA,2BAAA,CAAA,IAAA,CAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,IAAA,GAAA;AACA,IAAA,GAAA,EAAA,IAAA,CAAA,UAAA,CAAAC,sCAAA,CAAA,QAAA,CAAA;AACA,IAAA,aAAA,EAAA,IAAA,CAAA,UAAA,CAAAA,sCAAA,CAAA,WAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,CAAA,IAAA,CAAA,aAAA,CAAA,IAAA,IAAA,CAAA,GAAA,EAAA;AACA,IAAA,IAAA,CAAA,aAAA,CAAA,GAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,MAAA,GAAA,IAAA,CAAA,UAAA,CAAAA,sCAAA,CAAA,QAAA,CAAA,CAAA;AACA,IAAA,IAAA,OAAA,MAAA,KAAA,QAAA,EAAA;AACA,MAAA,MAAA,GAAA,GAAAC,cAAA,CAAA,MAAA,CAAA,CAAA;AACA;AACA,MAAA,IAAA,CAAA,GAAA,GAAAC,2BAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA,MAAA,IAAA,GAAA,CAAA,MAAA,EAAA;AACA,QAAA,IAAA,CAAA,YAAA,CAAA,GAAA,GAAA,CAAA,MAAA,CAAA;AACA,OAAA;AACA,MAAA,IAAA,GAAA,CAAA,IAAA,EAAA;AACA,QAAA,IAAA,CAAA,eAAA,CAAA,GAAA,GAAA,CAAA,IAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,21 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const api = require('@opentelemetry/api');
4
+ const spanTypes = require('./spanTypes.js');
5
+
6
+ /**
7
+ * Get the span kind from a span.
8
+ * For whatever reason, this is not public API on the generic "Span" type,
9
+ * so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from.
10
+ * Otherwise, we fall back to `SpanKind.INTERNAL`.
11
+ */
12
+ function getSpanKind(span) {
13
+ if (spanTypes.spanHasKind(span)) {
14
+ return span.kind;
15
+ }
16
+
17
+ return api.SpanKind.INTERNAL;
18
+ }
19
+
20
+ exports.getSpanKind = getSpanKind;
21
+ //# sourceMappingURL=getSpanKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSpanKind.js","sources":["../../../src/utils/getSpanKind.ts"],"sourcesContent":["import { SpanKind } from '@opentelemetry/api';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasKind } from './spanTypes';\n\n/**\n * Get the span kind from a span.\n * For whatever reason, this is not public API on the generic \"Span\" type,\n * so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from.\n * Otherwise, we fall back to `SpanKind.INTERNAL`.\n */\nexport function getSpanKind(span: AbstractSpan): SpanKind {\n if (spanHasKind(span)) {\n return span.kind;\n }\n\n return SpanKind.INTERNAL;\n}\n"],"names":["spanHasKind","SpanKind"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,IAAA,EAAA;AACA,EAAA,IAAAA,qBAAA,CAAA,IAAA,CAAA,EAAA;AACA,IAAA,OAAA,IAAA,CAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAAC,YAAA,CAAA,QAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,74 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const spanData = require('./spanData.js');
4
+
5
+ /**
6
+ * This function runs through a list of OTEL Spans, and wraps them in an `SpanNode`
7
+ * where each node holds a reference to their parent node.
8
+ */
9
+ function groupSpansWithParents(spans) {
10
+ const nodeMap = new Map();
11
+
12
+ for (const span of spans) {
13
+ createOrUpdateSpanNodeAndRefs(nodeMap, span);
14
+ }
15
+
16
+ return Array.from(nodeMap, function ([_id, spanNode]) {
17
+ return spanNode;
18
+ });
19
+ }
20
+
21
+ function createOrUpdateSpanNodeAndRefs(nodeMap, span) {
22
+ const parentSpan = spanData.getSpanParent(span);
23
+ const parentIsRemote = parentSpan ? !!parentSpan.spanContext().isRemote : false;
24
+
25
+ const id = span.spanContext().spanId;
26
+
27
+ // If the parentId is the trace parent ID, we pretend it's undefined
28
+ // As this means the parent exists somewhere else
29
+ const parentId = !parentIsRemote ? span.parentSpanId : undefined;
30
+
31
+ if (!parentId) {
32
+ createOrUpdateNode(nodeMap, { id, span, children: [] });
33
+ return;
34
+ }
35
+
36
+ // Else make sure to create parent node as well
37
+ // Note that the parent may not know it's parent _yet_, this may be updated in a later pass
38
+ const parentNode = createOrGetParentNode(nodeMap, parentId);
39
+ const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] });
40
+ parentNode.children.push(node);
41
+ }
42
+
43
+ function createOrGetParentNode(nodeMap, id) {
44
+ const existing = nodeMap.get(id);
45
+
46
+ if (existing) {
47
+ return existing;
48
+ }
49
+
50
+ return createOrUpdateNode(nodeMap, { id, children: [] });
51
+ }
52
+
53
+ function createOrUpdateNode(nodeMap, spanNode) {
54
+ const existing = nodeMap.get(spanNode.id);
55
+
56
+ // If span is already set, nothing to do here
57
+ if (existing && existing.span) {
58
+ return existing;
59
+ }
60
+
61
+ // If it exists but span is not set yet, we update it
62
+ if (existing && !existing.span) {
63
+ existing.span = spanNode.span;
64
+ existing.parentNode = spanNode.parentNode;
65
+ return existing;
66
+ }
67
+
68
+ // Else, we create a new one...
69
+ nodeMap.set(spanNode.id, spanNode);
70
+ return spanNode;
71
+ }
72
+
73
+ exports.groupSpansWithParents = groupSpansWithParents;
74
+ //# sourceMappingURL=groupSpansWithParents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupSpansWithParents.js","sources":["../../../src/utils/groupSpansWithParents.ts"],"sourcesContent":["import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';\n\nimport { getSpanParent } from './spanData';\n\nexport interface SpanNode {\n id: string;\n span?: ReadableSpan;\n parentNode?: SpanNode | undefined;\n children: SpanNode[];\n}\n\ntype SpanMap = Map<string, SpanNode>;\n\n/**\n * This function runs through a list of OTEL Spans, and wraps them in an `SpanNode`\n * where each node holds a reference to their parent node.\n */\nexport function groupSpansWithParents(spans: ReadableSpan[]): SpanNode[] {\n const nodeMap: SpanMap = new Map<string, SpanNode>();\n\n for (const span of spans) {\n createOrUpdateSpanNodeAndRefs(nodeMap, span);\n }\n\n return Array.from(nodeMap, function ([_id, spanNode]) {\n return spanNode;\n });\n}\n\nfunction createOrUpdateSpanNodeAndRefs(nodeMap: SpanMap, span: ReadableSpan): void {\n const parentSpan = getSpanParent(span);\n const parentIsRemote = parentSpan ? !!parentSpan.spanContext().isRemote : false;\n\n const id = span.spanContext().spanId;\n\n // If the parentId is the trace parent ID, we pretend it's undefined\n // As this means the parent exists somewhere else\n const parentId = !parentIsRemote ? span.parentSpanId : undefined;\n\n if (!parentId) {\n createOrUpdateNode(nodeMap, { id, span, children: [] });\n return;\n }\n\n // Else make sure to create parent node as well\n // Note that the parent may not know it's parent _yet_, this may be updated in a later pass\n const parentNode = createOrGetParentNode(nodeMap, parentId);\n const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] });\n parentNode.children.push(node);\n}\n\nfunction createOrGetParentNode(nodeMap: SpanMap, id: string): SpanNode {\n const existing = nodeMap.get(id);\n\n if (existing) {\n return existing;\n }\n\n return createOrUpdateNode(nodeMap, { id, children: [] });\n}\n\nfunction createOrUpdateNode(nodeMap: SpanMap, spanNode: SpanNode): SpanNode {\n const existing = nodeMap.get(spanNode.id);\n\n // If span is already set, nothing to do here\n if (existing && existing.span) {\n return existing;\n }\n\n // If it exists but span is not set yet, we update it\n if (existing && !existing.span) {\n existing.span = spanNode.span;\n existing.parentNode = spanNode.parentNode;\n return existing;\n }\n\n // Else, we create a new one...\n nodeMap.set(spanNode.id, spanNode);\n return spanNode;\n}\n"],"names":["getSpanParent"],"mappings":";;;;AAaA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,IAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,KAAA,MAAA,IAAA,IAAA,KAAA,EAAA;AACA,IAAA,6BAAA,CAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA,IAAA,CAAA,OAAA,EAAA,UAAA,CAAA,GAAA,EAAA,QAAA,CAAA,EAAA;AACA,IAAA,OAAA,QAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,6BAAA,CAAA,OAAA,EAAA,IAAA,EAAA;AACA,EAAA,MAAA,UAAA,GAAAA,sBAAA,CAAA,IAAA,CAAA,CAAA;AACA,EAAA,MAAA,cAAA,GAAA,UAAA,GAAA,CAAA,CAAA,UAAA,CAAA,WAAA,EAAA,CAAA,QAAA,GAAA,KAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAA,IAAA,CAAA,WAAA,EAAA,CAAA,MAAA,CAAA;AACA;AACA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,CAAA,cAAA,GAAA,IAAA,CAAA,YAAA,GAAA,SAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,QAAA,EAAA;AACA,IAAA,kBAAA,CAAA,OAAA,EAAA,EAAA,EAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,qBAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,kBAAA,CAAA,OAAA,EAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AACA,EAAA,UAAA,CAAA,QAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,qBAAA,CAAA,OAAA,EAAA,EAAA,EAAA;AACA,EAAA,MAAA,QAAA,GAAA,OAAA,CAAA,GAAA,CAAA,EAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,EAAA;AACA,IAAA,OAAA,QAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,kBAAA,CAAA,OAAA,EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,kBAAA,CAAA,OAAA,EAAA,QAAA,EAAA;AACA,EAAA,MAAA,QAAA,GAAA,OAAA,CAAA,GAAA,CAAA,QAAA,CAAA,EAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,QAAA,IAAA,QAAA,CAAA,IAAA,EAAA;AACA,IAAA,OAAA,QAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,IAAA,QAAA,IAAA,CAAA,QAAA,CAAA,IAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,QAAA,CAAA,IAAA,CAAA;AACA,IAAA,QAAA,CAAA,UAAA,GAAA,QAAA,CAAA,UAAA,CAAA;AACA,IAAA,OAAA,QAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,OAAA,CAAA,GAAA,CAAA,QAAA,CAAA,EAAA,EAAA,QAAA,CAAA,CAAA;AACA,EAAA,OAAA,QAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,29 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const semanticConventions = require('@opentelemetry/semantic-conventions');
4
+ const core = require('@sentry/core');
5
+ const spanTypes = require('./spanTypes.js');
6
+
7
+ /**
8
+ *
9
+ * @param otelSpan Checks wheter a given OTEL Span is an http request to sentry.
10
+ * @returns boolean
11
+ */
12
+ function isSentryRequestSpan(span) {
13
+ if (!spanTypes.spanHasAttributes(span)) {
14
+ return false;
15
+ }
16
+
17
+ const { attributes } = span;
18
+
19
+ const httpUrl = attributes[semanticConventions.SemanticAttributes.HTTP_URL];
20
+
21
+ if (!httpUrl) {
22
+ return false;
23
+ }
24
+
25
+ return core.isSentryRequestUrl(httpUrl.toString(), core.getCurrentHub());
26
+ }
27
+
28
+ exports.isSentryRequestSpan = isSentryRequestSpan;
29
+ //# sourceMappingURL=isSentryRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSentryRequest.js","sources":["../../../src/utils/isSentryRequest.ts"],"sourcesContent":["import { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport { getCurrentHub, isSentryRequestUrl } from '@sentry/core';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasAttributes } from './spanTypes';\n\n/**\n *\n * @param otelSpan Checks wheter a given OTEL Span is an http request to sentry.\n * @returns boolean\n */\nexport function isSentryRequestSpan(span: AbstractSpan): boolean {\n if (!spanHasAttributes(span)) {\n return false;\n }\n\n const { attributes } = span;\n\n const httpUrl = attributes[SemanticAttributes.HTTP_URL];\n\n if (!httpUrl) {\n return false;\n }\n\n return isSentryRequestUrl(httpUrl.toString(), getCurrentHub());\n}\n"],"names":["spanHasAttributes","SemanticAttributes","isSentryRequestUrl","getCurrentHub"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,IAAA,EAAA;AACA,EAAA,IAAA,CAAAA,2BAAA,CAAA,IAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,EAAA,UAAA,EAAA,GAAA,IAAA,CAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,UAAA,CAAAC,sCAAA,CAAA,QAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAAC,uBAAA,CAAA,OAAA,CAAA,QAAA,EAAA,EAAAC,kBAAA,EAAA,CAAA,CAAA;AACA;;;;"}