@sentry/browser 10.21.0-alpha.0 → 10.21.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 (62) hide show
  1. package/build/npm/cjs/index.js +0 -2
  2. package/build/npm/cjs/index.js.map +1 -1
  3. package/build/npm/cjs/integrations/httpcontext.js +0 -2
  4. package/build/npm/cjs/integrations/httpcontext.js.map +1 -1
  5. package/build/npm/cjs/profiling/integration.js +108 -46
  6. package/build/npm/cjs/profiling/integration.js.map +1 -1
  7. package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js +343 -0
  8. package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
  9. package/build/npm/cjs/profiling/startProfileForSpan.js +16 -0
  10. package/build/npm/cjs/profiling/startProfileForSpan.js.map +1 -1
  11. package/build/npm/cjs/profiling/utils.js +251 -14
  12. package/build/npm/cjs/profiling/utils.js.map +1 -1
  13. package/build/npm/cjs/tracing/request.js +0 -1
  14. package/build/npm/cjs/tracing/request.js.map +1 -1
  15. package/build/npm/esm/index.js +0 -1
  16. package/build/npm/esm/index.js.map +1 -1
  17. package/build/npm/esm/integrations/httpcontext.js +0 -2
  18. package/build/npm/esm/integrations/httpcontext.js.map +1 -1
  19. package/build/npm/esm/package.json +1 -1
  20. package/build/npm/esm/profiling/integration.js +110 -48
  21. package/build/npm/esm/profiling/integration.js.map +1 -1
  22. package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js +341 -0
  23. package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
  24. package/build/npm/esm/profiling/startProfileForSpan.js +16 -0
  25. package/build/npm/esm/profiling/startProfileForSpan.js.map +1 -1
  26. package/build/npm/esm/profiling/utils.js +245 -15
  27. package/build/npm/esm/profiling/utils.js.map +1 -1
  28. package/build/npm/esm/tracing/request.js +0 -1
  29. package/build/npm/esm/tracing/request.js.map +1 -1
  30. package/build/npm/types/feedbackAsync.d.ts +3 -9
  31. package/build/npm/types/feedbackAsync.d.ts.map +1 -1
  32. package/build/npm/types/feedbackSync.d.ts +3 -9
  33. package/build/npm/types/feedbackSync.d.ts.map +1 -1
  34. package/build/npm/types/helpers.d.ts +2 -29
  35. package/build/npm/types/helpers.d.ts.map +1 -1
  36. package/build/npm/types/index.d.ts +0 -1
  37. package/build/npm/types/index.d.ts.map +1 -1
  38. package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts.map +1 -1
  39. package/build/npm/types/integrations/httpcontext.d.ts.map +1 -1
  40. package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
  41. package/build/npm/types/profiling/integration.d.ts.map +1 -1
  42. package/build/npm/types/profiling/lifecycleMode/traceLifecycleProfiler.d.ts +70 -0
  43. package/build/npm/types/profiling/lifecycleMode/traceLifecycleProfiler.d.ts.map +1 -0
  44. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -1
  45. package/build/npm/types/profiling/utils.d.ts +32 -2
  46. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  47. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  48. package/build/npm/types/tracing/request.d.ts.map +1 -1
  49. package/build/npm/types-ts3.8/feedbackAsync.d.ts +3 -9
  50. package/build/npm/types-ts3.8/feedbackSync.d.ts +3 -9
  51. package/build/npm/types-ts3.8/helpers.d.ts +2 -29
  52. package/build/npm/types-ts3.8/index.d.ts +0 -1
  53. package/build/npm/types-ts3.8/profiling/lifecycleMode/traceLifecycleProfiler.d.ts +70 -0
  54. package/build/npm/types-ts3.8/profiling/utils.d.ts +32 -2
  55. package/package.json +7 -7
  56. package/build/npm/cjs/integrations/spanstreaming.js +0 -252
  57. package/build/npm/cjs/integrations/spanstreaming.js.map +0 -1
  58. package/build/npm/esm/integrations/spanstreaming.js +0 -250
  59. package/build/npm/esm/integrations/spanstreaming.js.map +0 -1
  60. package/build/npm/types/integrations/spanstreaming.d.ts +0 -5
  61. package/build/npm/types/integrations/spanstreaming.d.ts.map +0 -1
  62. package/build/npm/types-ts3.8/integrations/spanstreaming.d.ts +0 -5
@@ -1,252 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const debugBuild = require('../debug-build.js');
5
- const helpers = require('../helpers.js');
6
-
7
- const spanStreamingIntegration = core.defineIntegration(((userOptions) => {
8
- const validatedUserProvidedBatchLimit =
9
- userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1
10
- ? userOptions.batchLimit
11
- : undefined;
12
-
13
- if (debugBuild.DEBUG_BUILD && userOptions?.batchLimit && !validatedUserProvidedBatchLimit) {
14
- core.debug.warn('SpanStreaming batchLimit must be between 1 and 1000, defaulting to 1000');
15
- }
16
-
17
- const options = {
18
- ...userOptions,
19
- batchLimit:
20
- userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1
21
- ? userOptions.batchLimit
22
- : 1000,
23
- };
24
-
25
- // key: traceId-segmentSpanId
26
- const spanTreeMap = new Map();
27
-
28
- return {
29
- name: 'SpanStreaming',
30
- setup(client) {
31
- const clientOptions = client.getOptions();
32
- const beforeSendSpan = clientOptions.beforeSendSpan;
33
-
34
- const initialMessage = 'spanStreamingIntegration requires';
35
- const fallbackMsg = 'Falling back to static trace lifecycle.';
36
-
37
- if (clientOptions.traceLifecycle !== 'stream') {
38
- debugBuild.DEBUG_BUILD && core.debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
39
- return;
40
- }
41
-
42
- if (beforeSendSpan && !core.isV2BeforeSendSpanCallback(beforeSendSpan)) {
43
- client.getOptions().traceLifecycle = 'static';
44
- core.debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamSpan\`! ${fallbackMsg}`);
45
- return;
46
- }
47
-
48
- client.on('spanEnd', span => {
49
- const spanTreeMapKey = getSpanTreeMapKey(span);
50
- const spanBuffer = spanTreeMap.get(spanTreeMapKey);
51
- if (spanBuffer) {
52
- spanBuffer.add(span);
53
- } else {
54
- spanTreeMap.set(spanTreeMapKey, new Set([span]));
55
- }
56
- });
57
-
58
- // For now, we send all spans on local segment (root) span end.
59
- // TODO: This will change once we have more concrete ideas about a universal SDK data buffer.
60
- client.on('segmentSpanEnd', segmentSpan => {
61
- processAndSendSpans(segmentSpan, {
62
- spanTreeMap: spanTreeMap,
63
- client,
64
- batchLimit: options.batchLimit,
65
- beforeSendSpan,
66
- });
67
- });
68
- },
69
- };
70
- }) );
71
-
72
- /**
73
- * Just the traceid alone isn't enough because there can be multiple span trees with the same traceid.
74
- */
75
- function getSpanTreeMapKey(span) {
76
- return `${span.spanContext().traceId}-${core.getRootSpan(span).spanContext().spanId}`;
77
- }
78
-
79
- function processAndSendSpans(
80
- segmentSpan,
81
- { client, spanTreeMap, batchLimit, beforeSendSpan },
82
- ) {
83
- const traceId = segmentSpan.spanContext().traceId;
84
- const spanTreeMapKey = getSpanTreeMapKey(segmentSpan);
85
- const spansOfTrace = spanTreeMap.get(spanTreeMapKey);
86
-
87
- if (!spansOfTrace?.size) {
88
- spanTreeMap.delete(spanTreeMapKey);
89
- return;
90
- }
91
-
92
- const segmentSpanJson = core.spanToV2JSON(segmentSpan);
93
-
94
- for (const span of spansOfTrace) {
95
- applyCommonSpanAttributes(span, segmentSpanJson, client);
96
- }
97
-
98
- applyScopeToSegmentSpan(segmentSpan, segmentSpanJson, client);
99
-
100
- // TODO: Apply scope data and contexts to segment span
101
-
102
- const { ignoreSpans } = client.getOptions();
103
-
104
- // 1. Check if the entire span tree is ignored by ignoreSpans
105
- if (ignoreSpans?.length && core.shouldIgnoreSpan(segmentSpanJson, ignoreSpans)) {
106
- client.recordDroppedEvent('before_send', 'span', spansOfTrace.size);
107
- spanTreeMap.delete(spanTreeMapKey);
108
- return;
109
- }
110
-
111
- const serializedSpans = Array.from(spansOfTrace ?? []).map(s => {
112
- const serialized = core.spanToV2JSON(s);
113
- // remove internal span attributes we don't need to send.
114
- delete serialized.attributes?.[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
115
- return serialized;
116
- });
117
-
118
- const processedSpans = [];
119
- let ignoredSpanCount = 0;
120
-
121
- for (const span of serializedSpans) {
122
- // 2. Check if child spans should be ignored
123
- const isChildSpan = span.span_id !== segmentSpan.spanContext().spanId;
124
- if (ignoreSpans?.length && isChildSpan && core.shouldIgnoreSpan(span, ignoreSpans)) {
125
- core.reparentChildSpans(serializedSpans, span);
126
- ignoredSpanCount++;
127
- // drop this span by not adding it to the processedSpans array
128
- continue;
129
- }
130
-
131
- // 3. Apply beforeSendSpan callback
132
- const processedSpan = beforeSendSpan ? applyBeforeSendSpanCallback(span, beforeSendSpan) : span;
133
- processedSpans.push(processedSpan);
134
- }
135
-
136
- if (ignoredSpanCount) {
137
- client.recordDroppedEvent('before_send', 'span', ignoredSpanCount);
138
- }
139
-
140
- const batches = [];
141
- for (let i = 0; i < processedSpans.length; i += batchLimit) {
142
- batches.push(processedSpans.slice(i, i + batchLimit));
143
- }
144
-
145
- debugBuild.DEBUG_BUILD && core.debug.log(`Sending trace ${traceId} in ${batches.length} batch${batches.length === 1 ? '' : 'es'}`);
146
-
147
- const dsc = core.getDynamicSamplingContextFromSpan(segmentSpan);
148
-
149
- for (const batch of batches) {
150
- const envelope = core.createSpanV2Envelope(batch, dsc, client);
151
- // no need to handle client reports for network errors,
152
- // buffer overflows or rate limiting here. All of this is handled
153
- // by client and transport.
154
- client.sendEnvelope(envelope).then(null, reason => {
155
- debugBuild.DEBUG_BUILD && core.debug.error('Error while sending span stream envelope:', reason);
156
- });
157
- }
158
-
159
- spanTreeMap.delete(spanTreeMapKey);
160
- }
161
-
162
- function applyCommonSpanAttributes(span, serializedSegmentSpan, client) {
163
- const sdk = client.getSdkMetadata();
164
- const { release, environment, sendDefaultPii } = client.getOptions();
165
-
166
- const { isolationScope: spanIsolationScope, scope: spanScope } = core.getCapturedScopesOnSpan(span);
167
-
168
- const originalAttributeKeys = Object.keys(core.spanToV2JSON(span).attributes ?? {});
169
-
170
- const finalScopeData = getFinalScopeData(spanIsolationScope, spanScope);
171
-
172
- // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)
173
- setAttributesIfNotPresent(span, originalAttributeKeys, {
174
- [core.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,
175
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,
176
- [core.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,
177
- [core.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,
178
- [core.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,
179
- ...(sendDefaultPii
180
- ? {
181
- [core.SEMANTIC_ATTRIBUTE_USER_ID]: finalScopeData.user?.id,
182
- [core.SEMANTIC_ATTRIBUTE_USER_EMAIL]: finalScopeData.user?.email,
183
- [core.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: finalScopeData.user?.ip_address ?? undefined,
184
- [core.SEMANTIC_ATTRIBUTE_USER_USERNAME]: finalScopeData.user?.username,
185
- }
186
- : {}),
187
- });
188
- }
189
-
190
- /**
191
- * Adds span attributes from the scopes' contexts
192
- * TODO: It's not set in stone yet if we actually want to flatmap contexts into span attributes.
193
- * For now we do it but not yet extra or tags. It's still TBD how to proceed here.
194
- */
195
- function applyScopeToSegmentSpan(segmentSpan, serializedSegmentSpan, client) {
196
- const { isolationScope, scope } = core.getCapturedScopesOnSpan(segmentSpan);
197
- const finalScopeData = getFinalScopeData(isolationScope, scope);
198
-
199
- const browserRequestData = helpers.getHttpRequestData();
200
-
201
- const tags = finalScopeData.tags ?? {};
202
-
203
- let contextAttributes = {};
204
- Object.keys(finalScopeData.contexts).forEach(key => {
205
- const context = finalScopeData.contexts[key];
206
- if (context) {
207
- contextAttributes = { ...contextAttributes, ...core.attributesFromObject(context) };
208
- }
209
- });
210
-
211
- const extraAttributes = core.attributesFromObject(finalScopeData.extra);
212
-
213
- setAttributesIfNotPresent(segmentSpan, Object.keys(serializedSegmentSpan.attributes ?? {}), {
214
- [core.SEMANTIC_ATTRIBUTE_URL_FULL]: browserRequestData.url,
215
- ...core.httpHeadersToSpanAttributes(browserRequestData.headers, client.getOptions().sendDefaultPii ?? false),
216
- ...tags,
217
- ...contextAttributes,
218
- ...extraAttributes,
219
- });
220
- }
221
-
222
- function applyBeforeSendSpanCallback(span, beforeSendSpan) {
223
- const modifedSpan = beforeSendSpan(span);
224
- if (!modifedSpan) {
225
- core.showSpanDropWarning();
226
- return span;
227
- }
228
- return modifedSpan;
229
- }
230
-
231
- function setAttributesIfNotPresent(span, originalAttributeKeys, newAttributes) {
232
- Object.keys(newAttributes).forEach(key => {
233
- if (!originalAttributeKeys.includes(key)) {
234
- span.setAttribute(key, newAttributes[key]);
235
- }
236
- });
237
- }
238
-
239
- // TODO: Extract this to a helper in core. It's used in multiple places.
240
- function getFinalScopeData(isolationScope, scope) {
241
- const finalScopeData = core.getGlobalScope().getScopeData();
242
- if (isolationScope) {
243
- core.mergeScopeData(finalScopeData, isolationScope.getScopeData());
244
- }
245
- if (scope) {
246
- core.mergeScopeData(finalScopeData, scope.getScopeData());
247
- }
248
- return finalScopeData;
249
- }
250
-
251
- exports.spanStreamingIntegration = spanStreamingIntegration;
252
- //# sourceMappingURL=spanstreaming.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanstreaming.js","sources":["../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { Client, IntegrationFn, Scope, ScopeData, Span, SpanAttributes, SpanV2JSON } from '@sentry/core';\nimport {\n attributesFromObject,\n createSpanV2Envelope,\n debug,\n defineIntegration,\n getCapturedScopesOnSpan,\n getDynamicSamplingContextFromSpan,\n getGlobalScope,\n getRootSpan as getSegmentSpan,\n httpHeadersToSpanAttributes,\n isV2BeforeSendSpanCallback,\n mergeScopeData,\n reparentChildSpans,\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n shouldIgnoreSpan,\n showSpanDropWarning,\n spanToV2JSON,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getHttpRequestData } from '../helpers';\n\nexport interface SpanStreamingOptions {\n batchLimit: number;\n}\n\nexport const spanStreamingIntegration = defineIntegration(((userOptions?: Partial<SpanStreamingOptions>) => {\n const validatedUserProvidedBatchLimit =\n userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1\n ? userOptions.batchLimit\n : undefined;\n\n if (DEBUG_BUILD && userOptions?.batchLimit && !validatedUserProvidedBatchLimit) {\n debug.warn('SpanStreaming batchLimit must be between 1 and 1000, defaulting to 1000');\n }\n\n const options: SpanStreamingOptions = {\n ...userOptions,\n batchLimit:\n userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1\n ? userOptions.batchLimit\n : 1000,\n };\n\n // key: traceId-segmentSpanId\n const spanTreeMap = new Map<string, Set<Span>>();\n\n return {\n name: 'SpanStreaming',\n setup(client) {\n const clientOptions = client.getOptions();\n const beforeSendSpan = clientOptions.beforeSendSpan;\n\n const initialMessage = 'spanStreamingIntegration requires';\n const fallbackMsg = 'Falling back to static trace lifecycle.';\n\n if (clientOptions.traceLifecycle !== 'stream') {\n DEBUG_BUILD && debug.warn(`${initialMessage} \\`traceLifecycle\\` to be set to \"stream\"! ${fallbackMsg}`);\n return;\n }\n\n if (beforeSendSpan && !isV2BeforeSendSpanCallback(beforeSendSpan)) {\n client.getOptions().traceLifecycle = 'static';\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n client.on('spanEnd', span => {\n const spanTreeMapKey = getSpanTreeMapKey(span);\n const spanBuffer = spanTreeMap.get(spanTreeMapKey);\n if (spanBuffer) {\n spanBuffer.add(span);\n } else {\n spanTreeMap.set(spanTreeMapKey, new Set([span]));\n }\n });\n\n // For now, we send all spans on local segment (root) span end.\n // TODO: This will change once we have more concrete ideas about a universal SDK data buffer.\n client.on('segmentSpanEnd', segmentSpan => {\n processAndSendSpans(segmentSpan, {\n spanTreeMap: spanTreeMap,\n client,\n batchLimit: options.batchLimit,\n beforeSendSpan,\n });\n });\n },\n };\n}) satisfies IntegrationFn);\n\ninterface SpanProcessingOptions {\n client: Client;\n spanTreeMap: Map<string, Set<Span>>;\n batchLimit: number;\n beforeSendSpan: ((span: SpanV2JSON) => SpanV2JSON) | undefined;\n}\n\n/**\n * Just the traceid alone isn't enough because there can be multiple span trees with the same traceid.\n */\nfunction getSpanTreeMapKey(span: Span): string {\n return `${span.spanContext().traceId}-${getSegmentSpan(span).spanContext().spanId}`;\n}\n\nfunction processAndSendSpans(\n segmentSpan: Span,\n { client, spanTreeMap, batchLimit, beforeSendSpan }: SpanProcessingOptions,\n): void {\n const traceId = segmentSpan.spanContext().traceId;\n const spanTreeMapKey = getSpanTreeMapKey(segmentSpan);\n const spansOfTrace = spanTreeMap.get(spanTreeMapKey);\n\n if (!spansOfTrace?.size) {\n spanTreeMap.delete(spanTreeMapKey);\n return;\n }\n\n const segmentSpanJson = spanToV2JSON(segmentSpan);\n\n for (const span of spansOfTrace) {\n applyCommonSpanAttributes(span, segmentSpanJson, client);\n }\n\n applyScopeToSegmentSpan(segmentSpan, segmentSpanJson, client);\n\n // TODO: Apply scope data and contexts to segment span\n\n const { ignoreSpans } = client.getOptions();\n\n // 1. Check if the entire span tree is ignored by ignoreSpans\n if (ignoreSpans?.length && shouldIgnoreSpan(segmentSpanJson, ignoreSpans)) {\n client.recordDroppedEvent('before_send', 'span', spansOfTrace.size);\n spanTreeMap.delete(spanTreeMapKey);\n return;\n }\n\n const serializedSpans = Array.from(spansOfTrace ?? []).map(s => {\n const serialized = spanToV2JSON(s);\n // remove internal span attributes we don't need to send.\n delete serialized.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n return serialized;\n });\n\n const processedSpans = [];\n let ignoredSpanCount = 0;\n\n for (const span of serializedSpans) {\n // 2. Check if child spans should be ignored\n const isChildSpan = span.span_id !== segmentSpan.spanContext().spanId;\n if (ignoreSpans?.length && isChildSpan && shouldIgnoreSpan(span, ignoreSpans)) {\n reparentChildSpans(serializedSpans, span);\n ignoredSpanCount++;\n // drop this span by not adding it to the processedSpans array\n continue;\n }\n\n // 3. Apply beforeSendSpan callback\n const processedSpan = beforeSendSpan ? applyBeforeSendSpanCallback(span, beforeSendSpan) : span;\n processedSpans.push(processedSpan);\n }\n\n if (ignoredSpanCount) {\n client.recordDroppedEvent('before_send', 'span', ignoredSpanCount);\n }\n\n const batches: SpanV2JSON[][] = [];\n for (let i = 0; i < processedSpans.length; i += batchLimit) {\n batches.push(processedSpans.slice(i, i + batchLimit));\n }\n\n DEBUG_BUILD && debug.log(`Sending trace ${traceId} in ${batches.length} batch${batches.length === 1 ? '' : 'es'}`);\n\n const dsc = getDynamicSamplingContextFromSpan(segmentSpan);\n\n for (const batch of batches) {\n const envelope = createSpanV2Envelope(batch, dsc, client);\n // no need to handle client reports for network errors,\n // buffer overflows or rate limiting here. All of this is handled\n // by client and transport.\n client.sendEnvelope(envelope).then(null, reason => {\n DEBUG_BUILD && debug.error('Error while sending span stream envelope:', reason);\n });\n }\n\n spanTreeMap.delete(spanTreeMapKey);\n}\n\nfunction applyCommonSpanAttributes(span: Span, serializedSegmentSpan: SpanV2JSON, client: Client): void {\n const sdk = client.getSdkMetadata();\n const { release, environment, sendDefaultPii } = client.getOptions();\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const originalAttributeKeys = Object.keys(spanToV2JSON(span).attributes ?? {});\n\n const finalScopeData = getFinalScopeData(spanIsolationScope, spanScope);\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n setAttributesIfNotPresent(span, originalAttributeKeys, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,\n ...(sendDefaultPii\n ? {\n [SEMANTIC_ATTRIBUTE_USER_ID]: finalScopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: finalScopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: finalScopeData.user?.ip_address ?? undefined,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: finalScopeData.user?.username,\n }\n : {}),\n });\n}\n\n/**\n * Adds span attributes from the scopes' contexts\n * TODO: It's not set in stone yet if we actually want to flatmap contexts into span attributes.\n * For now we do it but not yet extra or tags. It's still TBD how to proceed here.\n */\nfunction applyScopeToSegmentSpan(segmentSpan: Span, serializedSegmentSpan: SpanV2JSON, client: Client): void {\n const { isolationScope, scope } = getCapturedScopesOnSpan(segmentSpan);\n const finalScopeData = getFinalScopeData(isolationScope, scope);\n\n const browserRequestData = getHttpRequestData();\n\n const tags = finalScopeData.tags ?? {};\n\n let contextAttributes = {};\n Object.keys(finalScopeData.contexts).forEach(key => {\n const context = finalScopeData.contexts[key];\n if (context) {\n contextAttributes = { ...contextAttributes, ...attributesFromObject(context) };\n }\n });\n\n const extraAttributes = attributesFromObject(finalScopeData.extra);\n\n setAttributesIfNotPresent(segmentSpan, Object.keys(serializedSegmentSpan.attributes ?? {}), {\n [SEMANTIC_ATTRIBUTE_URL_FULL]: browserRequestData.url,\n ...httpHeadersToSpanAttributes(browserRequestData.headers, client.getOptions().sendDefaultPii ?? false),\n ...tags,\n ...contextAttributes,\n ...extraAttributes,\n });\n}\n\nfunction applyBeforeSendSpanCallback(span: SpanV2JSON, beforeSendSpan: (span: SpanV2JSON) => SpanV2JSON): SpanV2JSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\nfunction setAttributesIfNotPresent(span: Span, originalAttributeKeys: string[], newAttributes: SpanAttributes): void {\n Object.keys(newAttributes).forEach(key => {\n if (!originalAttributeKeys.includes(key)) {\n span.setAttribute(key, newAttributes[key]);\n }\n });\n}\n\n// TODO: Extract this to a helper in core. It's used in multiple places.\nfunction getFinalScopeData(isolationScope: Scope | undefined, scope: Scope | undefined): ScopeData {\n const finalScopeData = getGlobalScope().getScopeData();\n if (isolationScope) {\n mergeScopeData(finalScopeData, isolationScope.getScopeData());\n }\n if (scope) {\n mergeScopeData(finalScopeData, scope.getScopeData());\n }\n return finalScopeData;\n}\n"],"names":["defineIntegration","DEBUG_BUILD","debug","isV2BeforeSendSpanCallback","getSegmentSpan","spanToV2JSON","shouldIgnoreSpan","SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME","reparentChildSpans","getDynamicSamplingContextFromSpan","createSpanV2Envelope","getCapturedScopesOnSpan","SEMANTIC_ATTRIBUTE_SENTRY_RELEASE","SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION","SEMANTIC_ATTRIBUTE_USER_ID","SEMANTIC_ATTRIBUTE_USER_EMAIL","SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS","SEMANTIC_ATTRIBUTE_USER_USERNAME","getHttpRequestData","attributesFromObject","SEMANTIC_ATTRIBUTE_URL_FULL","httpHeadersToSpanAttributes","showSpanDropWarning","getGlobalScope","mergeScopeData"],"mappings":";;;;;;AAoCO,MAAM,2BAA2BA,sBAAiB,EAAE,CAAC,WAAW,KAAqC;AAC5G,EAAE,MAAM,+BAAA;AACR,IAAI,WAAW,EAAE,UAAA,IAAc,WAAW,CAAC,UAAA,IAAc,IAAA,IAAQ,WAAW,CAAC,cAAc;AAC3F,QAAQ,WAAW,CAAC;AACpB,QAAQ,SAAS;;AAEjB,EAAE,IAAIC,sBAAA,IAAe,WAAW,EAAE,UAAA,IAAc,CAAC,+BAA+B,EAAE;AAClF,IAAIC,UAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC;AACzF;;AAEA,EAAE,MAAM,OAAO,GAAyB;AACxC,IAAI,GAAG,WAAW;AAClB,IAAI,UAAU;AACd,MAAM,WAAW,EAAE,UAAA,IAAc,WAAW,CAAC,UAAA,IAAc,IAAA,IAAQ,WAAW,CAAC,cAAc;AAC7F,UAAU,WAAW,CAAC;AACtB,UAAU,IAAI;AACd,GAAG;;AAEH;AACA,EAAE,MAAM,WAAA,GAAc,IAAI,GAAG,EAAqB;;AAElD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,eAAe;AACzB,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,MAAM,aAAA,GAAgB,MAAM,CAAC,UAAU,EAAE;AAC/C,MAAM,MAAM,cAAA,GAAiB,aAAa,CAAC,cAAc;;AAEzD,MAAM,MAAM,cAAA,GAAiB,mCAAmC;AAChE,MAAM,MAAM,WAAA,GAAc,yCAAyC;;AAEnE,MAAM,IAAI,aAAa,CAAC,cAAA,KAAmB,QAAQ,EAAE;AACrD,QAAQD,0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IAAA,GAAA,IAAA;AACA,IAAA,GAAA,iBAAA;AACA,IAAA,GAAA,eAAA;AACA,GAAA,CAAA;AACA;;AAEA,SAAA,2BAAA,CAAA,IAAA,EAAA,cAAA,EAAA;AACA,EAAA,MAAA,WAAA,GAAA,cAAA,CAAA,IAAA,CAAA;AACA,EAAA,IAAA,CAAA,WAAA,EAAA;AACA,IAAAC,wBAAA,EAAA;AACA,IAAA,OAAA,IAAA;AACA;AACA,EAAA,OAAA,WAAA;AACA;;AAEA,SAAA,yBAAA,CAAA,IAAA,EAAA,qBAAA,EAAA,aAAA,EAAA;AACA,EAAA,MAAA,CAAA,IAAA,CAAA,aAAA,CAAA,CAAA,OAAA,CAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,YAAA,CAAA,GAAA,EAAA,aAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA,GAAA,CAAA;AACA;;AAEA;AACA,SAAA,iBAAA,CAAA,cAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,cAAA,GAAAC,mBAAA,EAAA,CAAA,YAAA,EAAA;AACA,EAAA,IAAA,cAAA,EAAA;AACA,IAAAC,mBAAA,CAAA,cAAA,EAAA,cAAA,CAAA,YAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,KAAA,EAAA;AACA,IAAAA,mBAAA,CAAA,cAAA,EAAA,KAAA,CAAA,YAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA,cAAA;AACA;;;;"}
@@ -1,250 +0,0 @@
1
- import { defineIntegration, debug, isV2BeforeSendSpanCallback, getRootSpan, spanToV2JSON, shouldIgnoreSpan, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, reparentChildSpans, getDynamicSamplingContextFromSpan, createSpanV2Envelope, getCapturedScopesOnSpan, SEMANTIC_ATTRIBUTE_USER_USERNAME, SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS, SEMANTIC_ATTRIBUTE_USER_EMAIL, SEMANTIC_ATTRIBUTE_USER_ID, SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME, attributesFromObject, httpHeadersToSpanAttributes, SEMANTIC_ATTRIBUTE_URL_FULL, showSpanDropWarning, getGlobalScope, mergeScopeData, SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT, SEMANTIC_ATTRIBUTE_SENTRY_RELEASE } from '@sentry/core';
2
- import { DEBUG_BUILD } from '../debug-build.js';
3
- import { getHttpRequestData } from '../helpers.js';
4
-
5
- const spanStreamingIntegration = defineIntegration(((userOptions) => {
6
- const validatedUserProvidedBatchLimit =
7
- userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1
8
- ? userOptions.batchLimit
9
- : undefined;
10
-
11
- if (DEBUG_BUILD && userOptions?.batchLimit && !validatedUserProvidedBatchLimit) {
12
- debug.warn('SpanStreaming batchLimit must be between 1 and 1000, defaulting to 1000');
13
- }
14
-
15
- const options = {
16
- ...userOptions,
17
- batchLimit:
18
- userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1
19
- ? userOptions.batchLimit
20
- : 1000,
21
- };
22
-
23
- // key: traceId-segmentSpanId
24
- const spanTreeMap = new Map();
25
-
26
- return {
27
- name: 'SpanStreaming',
28
- setup(client) {
29
- const clientOptions = client.getOptions();
30
- const beforeSendSpan = clientOptions.beforeSendSpan;
31
-
32
- const initialMessage = 'spanStreamingIntegration requires';
33
- const fallbackMsg = 'Falling back to static trace lifecycle.';
34
-
35
- if (clientOptions.traceLifecycle !== 'stream') {
36
- DEBUG_BUILD && debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
37
- return;
38
- }
39
-
40
- if (beforeSendSpan && !isV2BeforeSendSpanCallback(beforeSendSpan)) {
41
- client.getOptions().traceLifecycle = 'static';
42
- debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamSpan\`! ${fallbackMsg}`);
43
- return;
44
- }
45
-
46
- client.on('spanEnd', span => {
47
- const spanTreeMapKey = getSpanTreeMapKey(span);
48
- const spanBuffer = spanTreeMap.get(spanTreeMapKey);
49
- if (spanBuffer) {
50
- spanBuffer.add(span);
51
- } else {
52
- spanTreeMap.set(spanTreeMapKey, new Set([span]));
53
- }
54
- });
55
-
56
- // For now, we send all spans on local segment (root) span end.
57
- // TODO: This will change once we have more concrete ideas about a universal SDK data buffer.
58
- client.on('segmentSpanEnd', segmentSpan => {
59
- processAndSendSpans(segmentSpan, {
60
- spanTreeMap: spanTreeMap,
61
- client,
62
- batchLimit: options.batchLimit,
63
- beforeSendSpan,
64
- });
65
- });
66
- },
67
- };
68
- }) );
69
-
70
- /**
71
- * Just the traceid alone isn't enough because there can be multiple span trees with the same traceid.
72
- */
73
- function getSpanTreeMapKey(span) {
74
- return `${span.spanContext().traceId}-${getRootSpan(span).spanContext().spanId}`;
75
- }
76
-
77
- function processAndSendSpans(
78
- segmentSpan,
79
- { client, spanTreeMap, batchLimit, beforeSendSpan },
80
- ) {
81
- const traceId = segmentSpan.spanContext().traceId;
82
- const spanTreeMapKey = getSpanTreeMapKey(segmentSpan);
83
- const spansOfTrace = spanTreeMap.get(spanTreeMapKey);
84
-
85
- if (!spansOfTrace?.size) {
86
- spanTreeMap.delete(spanTreeMapKey);
87
- return;
88
- }
89
-
90
- const segmentSpanJson = spanToV2JSON(segmentSpan);
91
-
92
- for (const span of spansOfTrace) {
93
- applyCommonSpanAttributes(span, segmentSpanJson, client);
94
- }
95
-
96
- applyScopeToSegmentSpan(segmentSpan, segmentSpanJson, client);
97
-
98
- // TODO: Apply scope data and contexts to segment span
99
-
100
- const { ignoreSpans } = client.getOptions();
101
-
102
- // 1. Check if the entire span tree is ignored by ignoreSpans
103
- if (ignoreSpans?.length && shouldIgnoreSpan(segmentSpanJson, ignoreSpans)) {
104
- client.recordDroppedEvent('before_send', 'span', spansOfTrace.size);
105
- spanTreeMap.delete(spanTreeMapKey);
106
- return;
107
- }
108
-
109
- const serializedSpans = Array.from(spansOfTrace ?? []).map(s => {
110
- const serialized = spanToV2JSON(s);
111
- // remove internal span attributes we don't need to send.
112
- delete serialized.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
113
- return serialized;
114
- });
115
-
116
- const processedSpans = [];
117
- let ignoredSpanCount = 0;
118
-
119
- for (const span of serializedSpans) {
120
- // 2. Check if child spans should be ignored
121
- const isChildSpan = span.span_id !== segmentSpan.spanContext().spanId;
122
- if (ignoreSpans?.length && isChildSpan && shouldIgnoreSpan(span, ignoreSpans)) {
123
- reparentChildSpans(serializedSpans, span);
124
- ignoredSpanCount++;
125
- // drop this span by not adding it to the processedSpans array
126
- continue;
127
- }
128
-
129
- // 3. Apply beforeSendSpan callback
130
- const processedSpan = beforeSendSpan ? applyBeforeSendSpanCallback(span, beforeSendSpan) : span;
131
- processedSpans.push(processedSpan);
132
- }
133
-
134
- if (ignoredSpanCount) {
135
- client.recordDroppedEvent('before_send', 'span', ignoredSpanCount);
136
- }
137
-
138
- const batches = [];
139
- for (let i = 0; i < processedSpans.length; i += batchLimit) {
140
- batches.push(processedSpans.slice(i, i + batchLimit));
141
- }
142
-
143
- DEBUG_BUILD && debug.log(`Sending trace ${traceId} in ${batches.length} batch${batches.length === 1 ? '' : 'es'}`);
144
-
145
- const dsc = getDynamicSamplingContextFromSpan(segmentSpan);
146
-
147
- for (const batch of batches) {
148
- const envelope = createSpanV2Envelope(batch, dsc, client);
149
- // no need to handle client reports for network errors,
150
- // buffer overflows or rate limiting here. All of this is handled
151
- // by client and transport.
152
- client.sendEnvelope(envelope).then(null, reason => {
153
- DEBUG_BUILD && debug.error('Error while sending span stream envelope:', reason);
154
- });
155
- }
156
-
157
- spanTreeMap.delete(spanTreeMapKey);
158
- }
159
-
160
- function applyCommonSpanAttributes(span, serializedSegmentSpan, client) {
161
- const sdk = client.getSdkMetadata();
162
- const { release, environment, sendDefaultPii } = client.getOptions();
163
-
164
- const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);
165
-
166
- const originalAttributeKeys = Object.keys(spanToV2JSON(span).attributes ?? {});
167
-
168
- const finalScopeData = getFinalScopeData(spanIsolationScope, spanScope);
169
-
170
- // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)
171
- setAttributesIfNotPresent(span, originalAttributeKeys, {
172
- [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,
173
- [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,
174
- [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,
175
- [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,
176
- [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,
177
- ...(sendDefaultPii
178
- ? {
179
- [SEMANTIC_ATTRIBUTE_USER_ID]: finalScopeData.user?.id,
180
- [SEMANTIC_ATTRIBUTE_USER_EMAIL]: finalScopeData.user?.email,
181
- [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: finalScopeData.user?.ip_address ?? undefined,
182
- [SEMANTIC_ATTRIBUTE_USER_USERNAME]: finalScopeData.user?.username,
183
- }
184
- : {}),
185
- });
186
- }
187
-
188
- /**
189
- * Adds span attributes from the scopes' contexts
190
- * TODO: It's not set in stone yet if we actually want to flatmap contexts into span attributes.
191
- * For now we do it but not yet extra or tags. It's still TBD how to proceed here.
192
- */
193
- function applyScopeToSegmentSpan(segmentSpan, serializedSegmentSpan, client) {
194
- const { isolationScope, scope } = getCapturedScopesOnSpan(segmentSpan);
195
- const finalScopeData = getFinalScopeData(isolationScope, scope);
196
-
197
- const browserRequestData = getHttpRequestData();
198
-
199
- const tags = finalScopeData.tags ?? {};
200
-
201
- let contextAttributes = {};
202
- Object.keys(finalScopeData.contexts).forEach(key => {
203
- const context = finalScopeData.contexts[key];
204
- if (context) {
205
- contextAttributes = { ...contextAttributes, ...attributesFromObject(context) };
206
- }
207
- });
208
-
209
- const extraAttributes = attributesFromObject(finalScopeData.extra);
210
-
211
- setAttributesIfNotPresent(segmentSpan, Object.keys(serializedSegmentSpan.attributes ?? {}), {
212
- [SEMANTIC_ATTRIBUTE_URL_FULL]: browserRequestData.url,
213
- ...httpHeadersToSpanAttributes(browserRequestData.headers, client.getOptions().sendDefaultPii ?? false),
214
- ...tags,
215
- ...contextAttributes,
216
- ...extraAttributes,
217
- });
218
- }
219
-
220
- function applyBeforeSendSpanCallback(span, beforeSendSpan) {
221
- const modifedSpan = beforeSendSpan(span);
222
- if (!modifedSpan) {
223
- showSpanDropWarning();
224
- return span;
225
- }
226
- return modifedSpan;
227
- }
228
-
229
- function setAttributesIfNotPresent(span, originalAttributeKeys, newAttributes) {
230
- Object.keys(newAttributes).forEach(key => {
231
- if (!originalAttributeKeys.includes(key)) {
232
- span.setAttribute(key, newAttributes[key]);
233
- }
234
- });
235
- }
236
-
237
- // TODO: Extract this to a helper in core. It's used in multiple places.
238
- function getFinalScopeData(isolationScope, scope) {
239
- const finalScopeData = getGlobalScope().getScopeData();
240
- if (isolationScope) {
241
- mergeScopeData(finalScopeData, isolationScope.getScopeData());
242
- }
243
- if (scope) {
244
- mergeScopeData(finalScopeData, scope.getScopeData());
245
- }
246
- return finalScopeData;
247
- }
248
-
249
- export { spanStreamingIntegration };
250
- //# sourceMappingURL=spanstreaming.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanstreaming.js","sources":["../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { Client, IntegrationFn, Scope, ScopeData, Span, SpanAttributes, SpanV2JSON } from '@sentry/core';\nimport {\n attributesFromObject,\n createSpanV2Envelope,\n debug,\n defineIntegration,\n getCapturedScopesOnSpan,\n getDynamicSamplingContextFromSpan,\n getGlobalScope,\n getRootSpan as getSegmentSpan,\n httpHeadersToSpanAttributes,\n isV2BeforeSendSpanCallback,\n mergeScopeData,\n reparentChildSpans,\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n shouldIgnoreSpan,\n showSpanDropWarning,\n spanToV2JSON,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getHttpRequestData } from '../helpers';\n\nexport interface SpanStreamingOptions {\n batchLimit: number;\n}\n\nexport const spanStreamingIntegration = defineIntegration(((userOptions?: Partial<SpanStreamingOptions>) => {\n const validatedUserProvidedBatchLimit =\n userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1\n ? userOptions.batchLimit\n : undefined;\n\n if (DEBUG_BUILD && userOptions?.batchLimit && !validatedUserProvidedBatchLimit) {\n debug.warn('SpanStreaming batchLimit must be between 1 and 1000, defaulting to 1000');\n }\n\n const options: SpanStreamingOptions = {\n ...userOptions,\n batchLimit:\n userOptions?.batchLimit && userOptions.batchLimit <= 1000 && userOptions.batchLimit >= 1\n ? userOptions.batchLimit\n : 1000,\n };\n\n // key: traceId-segmentSpanId\n const spanTreeMap = new Map<string, Set<Span>>();\n\n return {\n name: 'SpanStreaming',\n setup(client) {\n const clientOptions = client.getOptions();\n const beforeSendSpan = clientOptions.beforeSendSpan;\n\n const initialMessage = 'spanStreamingIntegration requires';\n const fallbackMsg = 'Falling back to static trace lifecycle.';\n\n if (clientOptions.traceLifecycle !== 'stream') {\n DEBUG_BUILD && debug.warn(`${initialMessage} \\`traceLifecycle\\` to be set to \"stream\"! ${fallbackMsg}`);\n return;\n }\n\n if (beforeSendSpan && !isV2BeforeSendSpanCallback(beforeSendSpan)) {\n client.getOptions().traceLifecycle = 'static';\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n client.on('spanEnd', span => {\n const spanTreeMapKey = getSpanTreeMapKey(span);\n const spanBuffer = spanTreeMap.get(spanTreeMapKey);\n if (spanBuffer) {\n spanBuffer.add(span);\n } else {\n spanTreeMap.set(spanTreeMapKey, new Set([span]));\n }\n });\n\n // For now, we send all spans on local segment (root) span end.\n // TODO: This will change once we have more concrete ideas about a universal SDK data buffer.\n client.on('segmentSpanEnd', segmentSpan => {\n processAndSendSpans(segmentSpan, {\n spanTreeMap: spanTreeMap,\n client,\n batchLimit: options.batchLimit,\n beforeSendSpan,\n });\n });\n },\n };\n}) satisfies IntegrationFn);\n\ninterface SpanProcessingOptions {\n client: Client;\n spanTreeMap: Map<string, Set<Span>>;\n batchLimit: number;\n beforeSendSpan: ((span: SpanV2JSON) => SpanV2JSON) | undefined;\n}\n\n/**\n * Just the traceid alone isn't enough because there can be multiple span trees with the same traceid.\n */\nfunction getSpanTreeMapKey(span: Span): string {\n return `${span.spanContext().traceId}-${getSegmentSpan(span).spanContext().spanId}`;\n}\n\nfunction processAndSendSpans(\n segmentSpan: Span,\n { client, spanTreeMap, batchLimit, beforeSendSpan }: SpanProcessingOptions,\n): void {\n const traceId = segmentSpan.spanContext().traceId;\n const spanTreeMapKey = getSpanTreeMapKey(segmentSpan);\n const spansOfTrace = spanTreeMap.get(spanTreeMapKey);\n\n if (!spansOfTrace?.size) {\n spanTreeMap.delete(spanTreeMapKey);\n return;\n }\n\n const segmentSpanJson = spanToV2JSON(segmentSpan);\n\n for (const span of spansOfTrace) {\n applyCommonSpanAttributes(span, segmentSpanJson, client);\n }\n\n applyScopeToSegmentSpan(segmentSpan, segmentSpanJson, client);\n\n // TODO: Apply scope data and contexts to segment span\n\n const { ignoreSpans } = client.getOptions();\n\n // 1. Check if the entire span tree is ignored by ignoreSpans\n if (ignoreSpans?.length && shouldIgnoreSpan(segmentSpanJson, ignoreSpans)) {\n client.recordDroppedEvent('before_send', 'span', spansOfTrace.size);\n spanTreeMap.delete(spanTreeMapKey);\n return;\n }\n\n const serializedSpans = Array.from(spansOfTrace ?? []).map(s => {\n const serialized = spanToV2JSON(s);\n // remove internal span attributes we don't need to send.\n delete serialized.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n return serialized;\n });\n\n const processedSpans = [];\n let ignoredSpanCount = 0;\n\n for (const span of serializedSpans) {\n // 2. Check if child spans should be ignored\n const isChildSpan = span.span_id !== segmentSpan.spanContext().spanId;\n if (ignoreSpans?.length && isChildSpan && shouldIgnoreSpan(span, ignoreSpans)) {\n reparentChildSpans(serializedSpans, span);\n ignoredSpanCount++;\n // drop this span by not adding it to the processedSpans array\n continue;\n }\n\n // 3. Apply beforeSendSpan callback\n const processedSpan = beforeSendSpan ? applyBeforeSendSpanCallback(span, beforeSendSpan) : span;\n processedSpans.push(processedSpan);\n }\n\n if (ignoredSpanCount) {\n client.recordDroppedEvent('before_send', 'span', ignoredSpanCount);\n }\n\n const batches: SpanV2JSON[][] = [];\n for (let i = 0; i < processedSpans.length; i += batchLimit) {\n batches.push(processedSpans.slice(i, i + batchLimit));\n }\n\n DEBUG_BUILD && debug.log(`Sending trace ${traceId} in ${batches.length} batch${batches.length === 1 ? '' : 'es'}`);\n\n const dsc = getDynamicSamplingContextFromSpan(segmentSpan);\n\n for (const batch of batches) {\n const envelope = createSpanV2Envelope(batch, dsc, client);\n // no need to handle client reports for network errors,\n // buffer overflows or rate limiting here. All of this is handled\n // by client and transport.\n client.sendEnvelope(envelope).then(null, reason => {\n DEBUG_BUILD && debug.error('Error while sending span stream envelope:', reason);\n });\n }\n\n spanTreeMap.delete(spanTreeMapKey);\n}\n\nfunction applyCommonSpanAttributes(span: Span, serializedSegmentSpan: SpanV2JSON, client: Client): void {\n const sdk = client.getSdkMetadata();\n const { release, environment, sendDefaultPii } = client.getOptions();\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const originalAttributeKeys = Object.keys(spanToV2JSON(span).attributes ?? {});\n\n const finalScopeData = getFinalScopeData(spanIsolationScope, spanScope);\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n setAttributesIfNotPresent(span, originalAttributeKeys, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,\n ...(sendDefaultPii\n ? {\n [SEMANTIC_ATTRIBUTE_USER_ID]: finalScopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: finalScopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: finalScopeData.user?.ip_address ?? undefined,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: finalScopeData.user?.username,\n }\n : {}),\n });\n}\n\n/**\n * Adds span attributes from the scopes' contexts\n * TODO: It's not set in stone yet if we actually want to flatmap contexts into span attributes.\n * For now we do it but not yet extra or tags. It's still TBD how to proceed here.\n */\nfunction applyScopeToSegmentSpan(segmentSpan: Span, serializedSegmentSpan: SpanV2JSON, client: Client): void {\n const { isolationScope, scope } = getCapturedScopesOnSpan(segmentSpan);\n const finalScopeData = getFinalScopeData(isolationScope, scope);\n\n const browserRequestData = getHttpRequestData();\n\n const tags = finalScopeData.tags ?? {};\n\n let contextAttributes = {};\n Object.keys(finalScopeData.contexts).forEach(key => {\n const context = finalScopeData.contexts[key];\n if (context) {\n contextAttributes = { ...contextAttributes, ...attributesFromObject(context) };\n }\n });\n\n const extraAttributes = attributesFromObject(finalScopeData.extra);\n\n setAttributesIfNotPresent(segmentSpan, Object.keys(serializedSegmentSpan.attributes ?? {}), {\n [SEMANTIC_ATTRIBUTE_URL_FULL]: browserRequestData.url,\n ...httpHeadersToSpanAttributes(browserRequestData.headers, client.getOptions().sendDefaultPii ?? false),\n ...tags,\n ...contextAttributes,\n ...extraAttributes,\n });\n}\n\nfunction applyBeforeSendSpanCallback(span: SpanV2JSON, beforeSendSpan: (span: SpanV2JSON) => SpanV2JSON): SpanV2JSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\nfunction setAttributesIfNotPresent(span: Span, originalAttributeKeys: string[], newAttributes: SpanAttributes): void {\n Object.keys(newAttributes).forEach(key => {\n if (!originalAttributeKeys.includes(key)) {\n span.setAttribute(key, newAttributes[key]);\n }\n });\n}\n\n// TODO: Extract this to a helper in core. It's used in multiple places.\nfunction getFinalScopeData(isolationScope: Scope | undefined, scope: Scope | undefined): ScopeData {\n const finalScopeData = getGlobalScope().getScopeData();\n if (isolationScope) {\n mergeScopeData(finalScopeData, isolationScope.getScopeData());\n }\n if (scope) {\n mergeScopeData(finalScopeData, scope.getScopeData());\n }\n return finalScopeData;\n}\n"],"names":["getSegmentSpan"],"mappings":";;;;AAoCO,MAAM,2BAA2B,iBAAiB,EAAE,CAAC,WAAW,KAAqC;AAC5G,EAAE,MAAM,+BAAA;AACR,IAAI,WAAW,EAAE,UAAA,IAAc,WAAW,CAAC,UAAA,IAAc,IAAA,IAAQ,WAAW,CAAC,cAAc;AAC3F,QAAQ,WAAW,CAAC;AACpB,QAAQ,SAAS;;AAEjB,EAAE,IAAI,WAAA,IAAe,WAAW,EAA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,GAAA,CAAA,CAAA;AACA;AACA,GAAA,CAAA;AACA;;AAEA;AACA,SAAA,iBAAA,CAAA,cAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,cAAA,GAAA,cAAA,EAAA,CAAA,YAAA,EAAA;AACA,EAAA,IAAA,cAAA,EAAA;AACA,IAAA,cAAA,CAAA,cAAA,EAAA,cAAA,CAAA,YAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,KAAA,EAAA;AACA,IAAA,cAAA,CAAA,cAAA,EAAA,KAAA,CAAA,YAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA,cAAA;AACA;;;;"}
@@ -1,5 +0,0 @@
1
- export interface SpanStreamingOptions {
2
- batchLimit: number;
3
- }
4
- export declare const spanStreamingIntegration: (userOptions?: Partial<SpanStreamingOptions> | undefined) => import("@sentry/core").Integration;
5
- //# sourceMappingURL=spanstreaming.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanstreaming.d.ts","sourceRoot":"","sources":["../../../../src/integrations/spanstreaming.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,wBAAwB,iGA+DV,CAAC"}
@@ -1,5 +0,0 @@
1
- export interface SpanStreamingOptions {
2
- batchLimit: number;
3
- }
4
- export declare const spanStreamingIntegration: (userOptions?: Partial<SpanStreamingOptions> | undefined) => import("@sentry/core").Integration;
5
- //# sourceMappingURL=spanstreaming.d.ts.map