@sentry/core 10.39.0-alpha.0 → 10.39.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 (155) hide show
  1. package/build/cjs/attributes.js.map +1 -1
  2. package/build/cjs/client.js +6 -13
  3. package/build/cjs/client.js.map +1 -1
  4. package/build/cjs/envelope.js +7 -41
  5. package/build/cjs/envelope.js.map +1 -1
  6. package/build/cjs/index.js +0 -48
  7. package/build/cjs/index.js.map +1 -1
  8. package/build/cjs/integration.js +0 -12
  9. package/build/cjs/integration.js.map +1 -1
  10. package/build/cjs/integrations/eventFilters.js +1 -1
  11. package/build/cjs/integrations/eventFilters.js.map +1 -1
  12. package/build/cjs/integrations/requestdata.js +6 -72
  13. package/build/cjs/integrations/requestdata.js.map +1 -1
  14. package/build/cjs/semanticAttributes.js +0 -84
  15. package/build/cjs/semanticAttributes.js.map +1 -1
  16. package/build/cjs/tracing/sentrySpan.js +0 -32
  17. package/build/cjs/tracing/sentrySpan.js.map +1 -1
  18. package/build/cjs/tracing/trace.js +0 -1
  19. package/build/cjs/tracing/trace.js.map +1 -1
  20. package/build/cjs/tracing/vercel-ai/index.js +0 -1
  21. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  22. package/build/cjs/utils/featureFlags.js +0 -1
  23. package/build/cjs/utils/featureFlags.js.map +1 -1
  24. package/build/cjs/utils/scopeData.js +0 -4
  25. package/build/cjs/utils/scopeData.js.map +1 -1
  26. package/build/cjs/utils/should-ignore-span.js +9 -31
  27. package/build/cjs/utils/should-ignore-span.js.map +1 -1
  28. package/build/cjs/utils/spanUtils.js +2 -90
  29. package/build/cjs/utils/spanUtils.js.map +1 -1
  30. package/build/cjs/utils/version.js +1 -1
  31. package/build/cjs/utils/version.js.map +1 -1
  32. package/build/esm/attributes.js.map +1 -1
  33. package/build/esm/client.js +2 -9
  34. package/build/esm/client.js.map +1 -1
  35. package/build/esm/envelope.js +8 -41
  36. package/build/esm/envelope.js.map +1 -1
  37. package/build/esm/index.js +3 -10
  38. package/build/esm/index.js.map +1 -1
  39. package/build/esm/integration.js +1 -12
  40. package/build/esm/integration.js.map +1 -1
  41. package/build/esm/integrations/eventFilters.js +1 -1
  42. package/build/esm/integrations/eventFilters.js.map +1 -1
  43. package/build/esm/integrations/requestdata.js +6 -72
  44. package/build/esm/integrations/requestdata.js.map +1 -1
  45. package/build/esm/package.json +1 -1
  46. package/build/esm/semanticAttributes.js +1 -57
  47. package/build/esm/semanticAttributes.js.map +1 -1
  48. package/build/esm/tracing/sentrySpan.js +1 -33
  49. package/build/esm/tracing/sentrySpan.js.map +1 -1
  50. package/build/esm/tracing/trace.js +0 -1
  51. package/build/esm/tracing/trace.js.map +1 -1
  52. package/build/esm/tracing/vercel-ai/index.js +0 -1
  53. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  54. package/build/esm/utils/featureFlags.js +0 -1
  55. package/build/esm/utils/featureFlags.js.map +1 -1
  56. package/build/esm/utils/scopeData.js +0 -4
  57. package/build/esm/utils/scopeData.js.map +1 -1
  58. package/build/esm/utils/should-ignore-span.js +9 -31
  59. package/build/esm/utils/should-ignore-span.js.map +1 -1
  60. package/build/esm/utils/spanUtils.js +3 -87
  61. package/build/esm/utils/spanUtils.js.map +1 -1
  62. package/build/esm/utils/version.js +1 -1
  63. package/build/esm/utils/version.js.map +1 -1
  64. package/build/types/attributes.d.ts +1 -1
  65. package/build/types/attributes.d.ts.map +1 -1
  66. package/build/types/client.d.ts +2 -40
  67. package/build/types/client.d.ts.map +1 -1
  68. package/build/types/envelope.d.ts +1 -6
  69. package/build/types/envelope.d.ts.map +1 -1
  70. package/build/types/index.d.ts +4 -11
  71. package/build/types/index.d.ts.map +1 -1
  72. package/build/types/integration.d.ts +0 -4
  73. package/build/types/integration.d.ts.map +1 -1
  74. package/build/types/integrations/requestdata.d.ts.map +1 -1
  75. package/build/types/semanticAttributes.d.ts +0 -38
  76. package/build/types/semanticAttributes.d.ts.map +1 -1
  77. package/build/types/tracing/sentrySpan.d.ts +1 -10
  78. package/build/types/tracing/sentrySpan.d.ts.map +1 -1
  79. package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
  80. package/build/types/types-hoist/envelope.d.ts +2 -22
  81. package/build/types/types-hoist/envelope.d.ts.map +1 -1
  82. package/build/types/types-hoist/integration.d.ts +0 -7
  83. package/build/types/types-hoist/integration.d.ts.map +1 -1
  84. package/build/types/types-hoist/link.d.ts +2 -2
  85. package/build/types/types-hoist/link.d.ts.map +1 -1
  86. package/build/types/types-hoist/options.d.ts +2 -18
  87. package/build/types/types-hoist/options.d.ts.map +1 -1
  88. package/build/types/types-hoist/span.d.ts +0 -27
  89. package/build/types/types-hoist/span.d.ts.map +1 -1
  90. package/build/types/utils/featureFlags.d.ts.map +1 -1
  91. package/build/types/utils/scopeData.d.ts.map +1 -1
  92. package/build/types/utils/should-ignore-span.d.ts +3 -3
  93. package/build/types/utils/should-ignore-span.d.ts.map +1 -1
  94. package/build/types/utils/spanUtils.d.ts +2 -22
  95. package/build/types/utils/spanUtils.d.ts.map +1 -1
  96. package/build/types-ts3.8/attributes.d.ts +1 -1
  97. package/build/types-ts3.8/client.d.ts +2 -40
  98. package/build/types-ts3.8/envelope.d.ts +1 -6
  99. package/build/types-ts3.8/index.d.ts +4 -11
  100. package/build/types-ts3.8/integration.d.ts +0 -4
  101. package/build/types-ts3.8/semanticAttributes.d.ts +0 -38
  102. package/build/types-ts3.8/tracing/sentrySpan.d.ts +1 -10
  103. package/build/types-ts3.8/types-hoist/envelope.d.ts +2 -22
  104. package/build/types-ts3.8/types-hoist/integration.d.ts +0 -7
  105. package/build/types-ts3.8/types-hoist/link.d.ts +2 -2
  106. package/build/types-ts3.8/types-hoist/options.d.ts +2 -18
  107. package/build/types-ts3.8/types-hoist/span.d.ts +0 -27
  108. package/build/types-ts3.8/utils/should-ignore-span.d.ts +3 -3
  109. package/build/types-ts3.8/utils/spanUtils.d.ts +2 -22
  110. package/package.json +1 -1
  111. package/build/cjs/integrations/spanStreaming.js +0 -54
  112. package/build/cjs/integrations/spanStreaming.js.map +0 -1
  113. package/build/cjs/spans/captureSpan.js +0 -104
  114. package/build/cjs/spans/captureSpan.js.map +0 -1
  115. package/build/cjs/spans/spanBuffer.js +0 -121
  116. package/build/cjs/spans/spanBuffer.js.map +0 -1
  117. package/build/cjs/spans/spanFirstUtils.js +0 -186
  118. package/build/cjs/spans/spanFirstUtils.js.map +0 -1
  119. package/build/cjs/utils/beforeSendSpan.js +0 -36
  120. package/build/cjs/utils/beforeSendSpan.js.map +0 -1
  121. package/build/cjs/utils/hasSpanStreamingEnabled.js +0 -21
  122. package/build/cjs/utils/hasSpanStreamingEnabled.js.map +0 -1
  123. package/build/esm/integrations/spanStreaming.js +0 -52
  124. package/build/esm/integrations/spanStreaming.js.map +0 -1
  125. package/build/esm/spans/captureSpan.js +0 -102
  126. package/build/esm/spans/captureSpan.js.map +0 -1
  127. package/build/esm/spans/spanBuffer.js +0 -119
  128. package/build/esm/spans/spanBuffer.js.map +0 -1
  129. package/build/esm/spans/spanFirstUtils.js +0 -182
  130. package/build/esm/spans/spanFirstUtils.js.map +0 -1
  131. package/build/esm/utils/beforeSendSpan.js +0 -33
  132. package/build/esm/utils/beforeSendSpan.js.map +0 -1
  133. package/build/esm/utils/hasSpanStreamingEnabled.js +0 -19
  134. package/build/esm/utils/hasSpanStreamingEnabled.js.map +0 -1
  135. package/build/types/integrations/spanStreaming.d.ts +0 -11
  136. package/build/types/integrations/spanStreaming.d.ts.map +0 -1
  137. package/build/types/spans/captureSpan.d.ts +0 -10
  138. package/build/types/spans/captureSpan.d.ts.map +0 -1
  139. package/build/types/spans/spanBuffer.d.ts +0 -35
  140. package/build/types/spans/spanBuffer.d.ts.map +0 -1
  141. package/build/types/spans/spanFirstUtils.d.ts +0 -20
  142. package/build/types/spans/spanFirstUtils.d.ts.map +0 -1
  143. package/build/types/types-hoist/attributes.d.ts +0 -19
  144. package/build/types/types-hoist/attributes.d.ts.map +0 -1
  145. package/build/types/utils/beforeSendSpan.d.ts +0 -22
  146. package/build/types/utils/beforeSendSpan.d.ts.map +0 -1
  147. package/build/types/utils/hasSpanStreamingEnabled.d.ts +0 -9
  148. package/build/types/utils/hasSpanStreamingEnabled.d.ts.map +0 -1
  149. package/build/types-ts3.8/integrations/spanStreaming.d.ts +0 -11
  150. package/build/types-ts3.8/spans/captureSpan.d.ts +0 -10
  151. package/build/types-ts3.8/spans/spanBuffer.d.ts +0 -35
  152. package/build/types-ts3.8/spans/spanFirstUtils.d.ts +0 -20
  153. package/build/types-ts3.8/types-hoist/attributes.d.ts +0 -19
  154. package/build/types-ts3.8/utils/beforeSendSpan.d.ts +0 -22
  155. package/build/types-ts3.8/utils/hasSpanStreamingEnabled.d.ts +0 -9
@@ -1,5 +1,5 @@
1
1
  import { IntegrationIndex } from './integration';
2
- import { Scope, ScopeData } from './scope';
2
+ import { Scope } from './scope';
3
3
  import { Breadcrumb, BreadcrumbHint, FetchBreadcrumbHint, XhrBreadcrumbHint } from './types-hoist/breadcrumb';
4
4
  import { CheckIn, MonitorConfig } from './types-hoist/checkin';
5
5
  import { EventDropReason, Outcome } from './types-hoist/clientreport';
@@ -18,7 +18,7 @@ import { RequestEventData } from './types-hoist/request';
18
18
  import { SdkMetadata } from './types-hoist/sdkmetadata';
19
19
  import { Session, SessionAggregates } from './types-hoist/session';
20
20
  import { SeverityLevel } from './types-hoist/severity';
21
- import { Span, SpanAttributes, SpanContextData, SpanV2JSON, SpanV2JSONWithSegmentRef } from './types-hoist/span';
21
+ import { Span, SpanAttributes, SpanContextData } from './types-hoist/span';
22
22
  import { StartSpanOptions } from './types-hoist/startSpanOptions';
23
23
  import { Transport, TransportMakeRequestResponse } from './types-hoist/transport';
24
24
  /**
@@ -207,30 +207,6 @@ export declare abstract class Client<O extends ClientOptions = ClientOptions> {
207
207
  * @returns {() => void} A function that, when executed, removes the registered callback.
208
208
  */
209
209
  on(hook: 'spanEnd', callback: (span: Span) => void): () => void;
210
- /**
211
- * Register a callback for after a span is ended.
212
- */
213
- on(hook: 'afterSpanEnd', callback: (span: Span) => void): () => void;
214
- /**
215
- * Register a callback for after a segment span is ended.
216
- */
217
- on(hook: 'afterSegmentSpanEnd', callback: (span: Span) => void): () => void;
218
- /**
219
- * Register a callback for when the span JSON is ready to be enqueued into the span buffer.
220
- */
221
- on(hook: 'enqueueSpan', callback: (spanJSON: SpanV2JSONWithSegmentRef) => void): () => void;
222
- /**
223
- * Register a callback for when a span JSON is processed, to add some data to the span JSON.
224
- */
225
- on(hook: 'processSpan', callback: (spanJSON: SpanV2JSON, hint: {
226
- readOnlySpan: Span;
227
- }) => void): () => void;
228
- /**
229
- * Register a callback for when a segment span JSON is processed, to add some data to the segment span JSON.
230
- */
231
- on(hook: 'processSegmentSpan', callback: (spanJSON: SpanV2JSON, hint: {
232
- scopeData: ScopeData;
233
- }) => void): () => void;
234
210
  /**
235
211
  * Register a callback for when an idle span is allowed to auto-finish.
236
212
  * @returns {() => void} A function that, when executed, removes the registered callback.
@@ -426,20 +402,6 @@ export declare abstract class Client<O extends ClientOptions = ClientOptions> {
426
402
  }): void;
427
403
  /** Fire a hook whenever a span ends. */
428
404
  emit(hook: 'spanEnd', span: Span): void;
429
- /** Fire a hook after the `spanEnd` hook */
430
- emit(hook: 'afterSpanEnd', span: Span): void;
431
- /** Fire a hook after a span is processed, to add some attributes to the span JSON. */
432
- emit(hook: 'processSpan', spanJSON: SpanV2JSON, hint: {
433
- readOnlySpan: Span;
434
- }): void;
435
- /** Fire a hook after a span is processed, to add some attributes to the span JSON. */
436
- emit(hook: 'processSegmentSpan', spanJSON: SpanV2JSON, hint: {
437
- scopeData: ScopeData;
438
- }): void;
439
- /** Fire a hook after the `segmentSpanEnd` hook is fired. */
440
- emit(hook: 'afterSegmentSpanEnd', span: Span): void;
441
- /** Fire a hook after a span ready to be enqueued into the span buffer. */
442
- emit(hook: 'enqueueSpan', spanJSON: SpanV2JSONWithSegmentRef): void;
443
405
  /**
444
406
  * Fire a hook indicating that an idle span is allowed to auto finish.
445
407
  */
@@ -2,12 +2,11 @@ import { Client } from './client';
2
2
  import { SentrySpan } from './tracing/sentrySpan';
3
3
  import { LegacyCSPReport } from './types-hoist/csp';
4
4
  import { DsnComponents } from './types-hoist/dsn';
5
- import { DynamicSamplingContext, EventEnvelope, RawSecurityEnvelope, SessionEnvelope, SpanEnvelope, SpanV2Envelope } from './types-hoist/envelope';
5
+ import { EventEnvelope, RawSecurityEnvelope, SessionEnvelope, SpanEnvelope } from './types-hoist/envelope';
6
6
  import { Event } from './types-hoist/event';
7
7
  import { SdkInfo } from './types-hoist/sdkinfo';
8
8
  import { SdkMetadata } from './types-hoist/sdkmetadata';
9
9
  import { Session, SessionAggregates } from './types-hoist/session';
10
- import { SpanV2JSON } from './types-hoist/span';
11
10
  /**
12
11
  * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
13
12
  * Merge with existing data if any.
@@ -30,10 +29,6 @@ export declare function createSpanEnvelope(spans: [
30
29
  SentrySpan,
31
30
  ...SentrySpan[]
32
31
  ], client?: Client): SpanEnvelope;
33
- /**
34
- * Creates a span v2 envelope
35
- */
36
- export declare function createSpanV2Envelope(serializedSpans: SpanV2JSON[], dsc: Partial<DynamicSamplingContext>, client: Client): SpanV2Envelope;
37
32
  /**
38
33
  * Create an Envelope from a CSP report.
39
34
  */
@@ -6,7 +6,7 @@ export { ServerRuntimeClientOptions } from './server-runtime-client';
6
6
  export { IntegrationIndex } from './integration';
7
7
  export * from './tracing';
8
8
  export * from './semanticAttributes';
9
- export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope, createSpanV2Envelope } from './envelope';
9
+ export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope';
10
10
  export { captureCheckIn, withMonitor, captureException, captureEvent, captureMessage, lastEventId, close, flush, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, isInitialized, isEnabled, startSession, endSession, captureSession, addEventProcessor, } from './exports';
11
11
  export { getCurrentScope, getIsolationScope, getGlobalScope, withScope, withIsolationScope, getClient, getTraceContextFromScope, } from './currentScopes';
12
12
  export { getDefaultCurrentScope, getDefaultIsolationScope } from './defaultScopes';
@@ -31,16 +31,12 @@ export { prepareEvent } from './utils/prepareEvent';
31
31
  export { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';
32
32
  export { createCheckInEnvelope } from './checkin';
33
33
  export { hasSpansEnabled } from './utils/hasSpansEnabled';
34
- export { hasSpanStreamingEnabled } from './utils/hasSpanStreamingEnabled';
35
34
  export { isSentryRequestUrl } from './utils/isSentryRequestUrl';
36
35
  export { handleCallbackErrors } from './utils/handleCallbackErrors';
37
36
  export { parameterize, fmt } from './utils/parameterize';
38
37
  export { addAutoIpAddressToSession } from './utils/ipAddress';
39
38
  export { addAutoIpAddressToUser } from './utils/ipAddress';
40
- export { convertSpanLinksForEnvelope, spanToTraceHeader, spanToJSON, spanIsSampled, spanToTraceContext, getSpanDescendants, getStatusMessage, getRootSpan, INTERNAL_getSegmentSpan, getActiveSpan, addChildSpanToSpan, spanTimeInputToSeconds, updateSpanName, spanToV2JSON, showSpanDropWarning, } from './utils/spanUtils';
41
- export { captureSpan } from './spans/captureSpan';
42
- export { safeSetSpanJSONAttributes } from './spans/spanFirstUtils';
43
- export { SpanBuffer, SpanBufferOptions } from './spans/spanBuffer';
39
+ export { convertSpanLinksForEnvelope, spanToTraceHeader, spanToJSON, spanIsSampled, spanToTraceContext, getSpanDescendants, getStatusMessage, getRootSpan, getActiveSpan, addChildSpanToSpan, spanTimeInputToSeconds, updateSpanName, } from './utils/spanUtils';
44
40
  export { _setSpanForScope as _INTERNAL_setSpanForScope } from './utils/spanOnScope';
45
41
  export { parseSampleRate } from './utils/parseSampleRate';
46
42
  export { applySdkMetadata } from './utils/sdkMetadata';
@@ -68,7 +64,6 @@ export { consoleIntegration } from './integrations/console';
68
64
  export { featureFlagsIntegration, FeatureFlagsIntegration } from './integrations/featureFlags';
69
65
  export { growthbookIntegration } from './integrations/featureFlags';
70
66
  export { conversationIdIntegration } from './integrations/conversationId';
71
- export { spanStreamingIntegration } from './integrations/spanStreaming';
72
67
  export { profiler } from './profiling';
73
68
  export { instrumentFetchRequest } from './fetch';
74
69
  export { trpcMiddleware } from './trpc';
@@ -154,8 +149,6 @@ export { SDK_VERSION } from './utils/version';
154
149
  export { getDebugImagesForResources, getFilenameToDebugIdMap } from './utils/debug-ids';
155
150
  export { getFilenameToMetadataMap } from './metadata';
156
151
  export { escapeStringForRegex } from './vendor/escapeStringForRegex';
157
- export { isV2BeforeSendSpanCallback, withStreamSpan } from './utils/beforeSendSpan';
158
- export { shouldIgnoreSpan, reparentChildSpans } from './utils/should-ignore-span';
159
152
  export { Attachment } from './types-hoist/attachment';
160
153
  export { Breadcrumb, BreadcrumbHint, FetchBreadcrumbData, XhrBreadcrumbData, FetchBreadcrumbHint, XhrBreadcrumbHint, } from './types-hoist/breadcrumb';
161
154
  export { ClientReport, Outcome, EventDropReason } from './types-hoist/clientreport';
@@ -163,7 +156,7 @@ export { Context, Contexts, DeviceContext, OsContext, AppContext, CultureContext
163
156
  export { DataCategory } from './types-hoist/datacategory';
164
157
  export { DsnComponents, DsnLike, DsnProtocol } from './types-hoist/dsn';
165
158
  export { DebugImage, DebugMeta } from './types-hoist/debugMeta';
166
- export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, RawSecurityEnvelope, RawSecurityItem, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanV2Envelope, SpanItem, LogEnvelope, MetricEnvelope, } from './types-hoist/envelope';
159
+ export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, RawSecurityEnvelope, RawSecurityItem, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanItem, LogEnvelope, MetricEnvelope, } from './types-hoist/envelope';
167
160
  export { ExtendedError } from './types-hoist/error';
168
161
  export { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './types-hoist/event';
169
162
  export { EventProcessor } from './types-hoist/eventprocessor';
@@ -184,7 +177,7 @@ export { SdkInfo } from './types-hoist/sdkinfo';
184
177
  export { SdkMetadata } from './types-hoist/sdkmetadata';
185
178
  export { SessionAggregates, AggregationCounts, Session, SessionContext, SessionStatus, SerializedSession, } from './types-hoist/session';
186
179
  export { SeverityLevel } from './types-hoist/severity';
187
- export { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, SpanV2JSON, SpanV2JSONWithSegmentRef, SerializedSpanContainer, } from './types-hoist/span';
180
+ export { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, } from './types-hoist/span';
188
181
  export { SpanStatus } from './types-hoist/spanStatus';
189
182
  export { Log, LogSeverityLevel } from './types-hoist/log';
190
183
  export { Metric, MetricType, SerializedMetric, SerializedMetricContainer, SerializedMetricAttributeValue, } from './types-hoist/metric';
@@ -15,10 +15,6 @@ export declare function getIntegrationsToSetup(options: Pick<CoreOptions, 'defau
15
15
  * @param withDefault should enable default integrations
16
16
  */
17
17
  export declare function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex;
18
- /**
19
- * Runs the `beforeSetup` hooks of the given integrations on the given client.
20
- */
21
- export declare function beforeSetupIntegrations(client: Client, integrations: Integration[]): void;
22
18
  /**
23
19
  * Execute the `afterAllSetup` hooks of the given integrations.
24
20
  */
@@ -4,7 +4,6 @@
4
4
  *
5
5
  */
6
6
  export declare const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source";
7
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_SPAN_SOURCE = "sentry.span.source";
8
7
  /**
9
8
  * Attributes that holds the sample rate that was locally applied to a span.
10
9
  * If this attribute is not defined, it means that the span inherited a sampling decision.
@@ -51,9 +50,7 @@ export declare const SEMANTIC_ATTRIBUTE_CACHE_KEY = "cache.key";
51
50
  export declare const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = "cache.item_size";
52
51
  /** TODO: Remove these once we update to latest semantic conventions */
53
52
  export declare const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = "http.request.method";
54
- export declare const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_TIME_TO_FIRST_BYTE = "http.request.time_to_first_byte";
55
53
  export declare const SEMANTIC_ATTRIBUTE_URL_FULL = "url.full";
56
- export declare const SEMANTIC_ATTRIBUTE_URL_QUERY = "url.query";
57
54
  /**
58
55
  * A span link attribute to mark the link as a special span link.
59
56
  *
@@ -78,39 +75,4 @@ export declare const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = "sentry.link.type";
78
75
  * For LangGraph: configurable.thread_id
79
76
  */
80
77
  export declare const GEN_AI_CONVERSATION_ID_ATTRIBUTE = "gen_ai.conversation.id";
81
- /** The release version of the application */
82
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = "sentry.release";
83
- /** The environment name (e.g., "production", "staging", "development") */
84
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = "sentry.environment";
85
- /** The segment name (e.g., "GET /users") */
86
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = "sentry.segment.name";
87
- /** The id of the segment that this span belongs to. */
88
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = "sentry.segment.id";
89
- /** The user ID (gated by sendDefaultPii) */
90
- export declare const SEMANTIC_ATTRIBUTE_USER_ID = "user.id";
91
- /** The user email (gated by sendDefaultPii) */
92
- export declare const SEMANTIC_ATTRIBUTE_USER_EMAIL = "user.email";
93
- /** The user IP address (gated by sendDefaultPii) */
94
- export declare const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = "user.ip_address";
95
- /** The user username (gated by sendDefaultPii) */
96
- export declare const SEMANTIC_ATTRIBUTE_USER_USERNAME = "user.name";
97
- /** The name of the Sentry SDK (e.g., "sentry.php", "sentry.javascript") */
98
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = "sentry.sdk.name";
99
- /** The version of the Sentry SDK */
100
- export declare const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = "sentry.sdk.version";
101
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_VALUE = "browser.web_vital.lcp.value";
102
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_ELEMENT = "browser.web_vital.lcp.element";
103
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_ID = "browser.web_vital.lcp.id";
104
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_URL = "browser.web_vital.lcp.url";
105
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_LOAD_TIME = "browser.web_vital.lcp.load_time";
106
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_RENDER_TIME = "browser.web_vital.lcp.render_time";
107
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_LCP_SIZE = "browser.web_vital.lcp.size";
108
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_CLS_VALUE = "browser.web_vital.cls.value";
109
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_CLS_SOURCES = "browser.web_vital.cls.source";
110
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_INP_VALUE = "browser.web_vital.inp.value";
111
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_TTFB_VALUE = "browser.web_vital.ttfb.value";
112
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_TTFB_REQUEST_TIME = "browser.web_vital.ttfb.request_time";
113
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_FP_VALUE = "browser.web_vital.fp.value";
114
- export declare const SEMANTIC_ATTRIBUTE_WEB_VITAL_FCP_VALUE = "browser.web_vital.fcp.value";
115
- export declare const SEMANTIC_ATTRIBUTE_BROWSER_CONNECTION_RTT = "browser.connection.rtt";
116
78
  //# sourceMappingURL=semanticAttributes.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { SpanLink } from '../types-hoist/link';
2
- import { SentrySpanArguments, Span, SpanAttributes, SpanAttributeValue, SpanContextData, SpanJSON, SpanTimeInput, SpanV2JSON } from '../types-hoist/span';
2
+ import { SentrySpanArguments, Span, SpanAttributes, SpanAttributeValue, SpanContextData, SpanJSON, SpanTimeInput } from '../types-hoist/span';
3
3
  import { SpanStatus } from '../types-hoist/spanStatus';
4
4
  import { TimedEvent } from '../types-hoist/timedEvent';
5
5
  /**
@@ -77,15 +77,6 @@ export declare class SentrySpan implements Span {
77
77
  * use `spanToJSON(span)` instead.
78
78
  */
79
79
  getSpanJSON(): SpanJSON;
80
- /**
81
- * Get SpanV2JSON representation of this span.
82
- *
83
- * @hidden
84
- * @internal This method is purely for internal purposes and should not be used outside
85
- * of SDK code. If you need to get a JSON representation of a span,
86
- * use `spanToV2JSON(span)` instead.
87
- */
88
- getSpanV2JSON(): SpanV2JSON;
89
80
  /** @inheritdoc */
90
81
  isRecording(): boolean;
91
82
  /**
@@ -11,7 +11,7 @@ import { Profile, ProfileChunk } from './profiling';
11
11
  import { ReplayEvent, ReplayRecordingData } from './replay';
12
12
  import { SdkInfo } from './sdkinfo';
13
13
  import { SerializedSession, SessionAggregates } from './session';
14
- import { SerializedSpanContainer, SpanJSON } from './span';
14
+ import { SpanJSON } from './span';
15
15
  export type DynamicSamplingContext = {
16
16
  trace_id: string;
17
17
  public_key: DsnComponents['publicKey'];
@@ -87,21 +87,6 @@ type ProfileChunkItemHeaders = {
87
87
  type SpanItemHeaders = {
88
88
  type: 'span';
89
89
  };
90
- type SpanContainerItemHeaders = {
91
- /**
92
- * Same as v1 span item type but this envelope is distinguished by {@link SpanContainerItemHeaders.content_type}.
93
- */
94
- type: 'span';
95
- /**
96
- * The number of span items in the container. This must be the same as the number of span items in the payload.
97
- */
98
- item_count: number;
99
- /**
100
- * The content type of the span items. This must be `application/vnd.sentry.items.span.v2+json`.
101
- * (the presence of this field also distinguishes the span item from the v1 span item)
102
- */
103
- content_type: 'application/vnd.sentry.items.span.v2+json';
104
- };
105
90
  type LogContainerItemHeaders = {
106
91
  type: 'log';
107
92
  /**
@@ -135,7 +120,6 @@ export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
135
120
  export type ProfileItem = BaseEnvelopeItem<ProfileItemHeaders, Profile>;
136
121
  export type ProfileChunkItem = BaseEnvelopeItem<ProfileChunkItemHeaders, ProfileChunk>;
137
122
  export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Partial<SpanJSON>>;
138
- export type SpanContainerItem = BaseEnvelopeItem<SpanContainerItemHeaders, SerializedSpanContainer>;
139
123
  export type LogContainerItem = BaseEnvelopeItem<LogContainerItemHeaders, SerializedLogContainer>;
140
124
  export type MetricContainerItem = BaseEnvelopeItem<MetricContainerItemHeaders, SerializedMetricContainer>;
141
125
  export type RawSecurityItem = BaseEnvelopeItem<RawSecurityHeaders, LegacyCSPReport>;
@@ -155,9 +139,6 @@ type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
155
139
  type SpanEnvelopeHeaders = BaseEnvelopeHeaders & {
156
140
  trace?: DynamicSamplingContext;
157
141
  };
158
- type SpanV2EnvelopeHeaders = BaseEnvelopeHeaders & {
159
- trace?: DynamicSamplingContext;
160
- };
161
142
  type LogEnvelopeHeaders = BaseEnvelopeHeaders;
162
143
  type MetricEnvelopeHeaders = BaseEnvelopeHeaders;
163
144
  export type EventEnvelope = BaseEnvelope<EventEnvelopeHeaders, EventItem | AttachmentItem | UserFeedbackItem | FeedbackItem | ProfileItem>;
@@ -172,12 +153,11 @@ export type ReplayEnvelope = [
172
153
  ];
173
154
  export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
174
155
  export type SpanEnvelope = BaseEnvelope<SpanEnvelopeHeaders, SpanItem>;
175
- export type SpanV2Envelope = BaseEnvelope<SpanV2EnvelopeHeaders, SpanContainerItem>;
176
156
  export type ProfileChunkEnvelope = BaseEnvelope<BaseEnvelopeHeaders, ProfileChunkItem>;
177
157
  export type RawSecurityEnvelope = BaseEnvelope<BaseEnvelopeHeaders, RawSecurityItem>;
178
158
  export type LogEnvelope = BaseEnvelope<LogEnvelopeHeaders, LogContainerItem>;
179
159
  export type MetricEnvelope = BaseEnvelope<MetricEnvelopeHeaders, MetricContainerItem>;
180
- export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | SpanEnvelope | SpanV2Envelope | RawSecurityEnvelope | LogEnvelope | MetricEnvelope;
160
+ export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | SpanEnvelope | RawSecurityEnvelope | LogEnvelope | MetricEnvelope;
181
161
  export type EnvelopeItem = Envelope[1][number];
182
162
  export {};
183
163
  //# sourceMappingURL=envelope.d.ts.map
@@ -11,13 +11,6 @@ export interface Integration {
11
11
  * It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
12
12
  */
13
13
  setupOnce?(): void;
14
- /**
15
- * This hook is called for all integrations before the `setup` hook.
16
- * This is useful for integrations that need to e.g. modify client values before other integrations are set up.
17
- * Use this hook with caution and prefer `setup` whenever possible.
18
- * @param client
19
- */
20
- beforeSetup?(client: Client): void;
21
14
  /**
22
15
  * Set up an integration for the given client.
23
16
  * Receives the client as argument.
@@ -19,11 +19,11 @@ export interface SpanLink {
19
19
  * Link interface for the event envelope item. It's a flattened representation of `SpanLink`.
20
20
  * Can include additional fields defined by OTel.
21
21
  */
22
- export interface SpanLinkJSON<TAttributes = SpanLinkAttributes> extends Record<string, unknown> {
22
+ export interface SpanLinkJSON extends Record<string, unknown> {
23
23
  span_id: string;
24
24
  trace_id: string;
25
25
  sampled?: boolean;
26
- attributes?: TAttributes;
26
+ attributes?: SpanLinkAttributes;
27
27
  }
28
28
  export {};
29
29
  //# sourceMappingURL=link.d.ts.map
@@ -6,7 +6,7 @@ import { Log } from './log';
6
6
  import { Metric } from './metric';
7
7
  import { TracesSamplerSamplingContext } from './samplingcontext';
8
8
  import { SdkMetadata } from './sdkmetadata';
9
- import { SpanJSON, SpanV2JSON } from './span';
9
+ import { SpanJSON } from './span';
10
10
  import { StackLineParser, StackParser } from './stacktrace';
11
11
  import { TracePropagationTargets } from './tracing';
12
12
  import { BaseTransportOptions, Transport } from './transport';
@@ -450,15 +450,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
450
450
  * @default false
451
451
  */
452
452
  strictTraceContinuation?: boolean;
453
- /**
454
- * [Experimental] The trace lifecycle, determining whether spans are sent statically when the entire local span tree is complete, or
455
- * in batches, following interval- and action-based triggers.
456
- *
457
- * @experimental this option is currently still experimental and its type, name, or entire presence is subject to break and change at any time.
458
- *
459
- * @default 'static'
460
- */
461
- traceLifecycle?: 'static' | 'stream';
462
453
  /**
463
454
  * The organization ID for your Sentry project.
464
455
  *
@@ -535,7 +526,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
535
526
  *
536
527
  * @returns The modified span payload that will be sent.
537
528
  */
538
- beforeSendSpan?: ((span: SpanJSON) => SpanJSON) | SpanV2CompatibleBeforeSendSpanCallback;
529
+ beforeSendSpan?: (span: SpanJSON) => SpanJSON;
539
530
  /**
540
531
  * An event-processing callback for transaction events, guaranteed to be invoked after all other event
541
532
  * processors. This allows an event to be modified or dropped before it's sent.
@@ -561,13 +552,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
561
552
  */
562
553
  beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
563
554
  }
564
- /**
565
- * A callback that is known to be compatible with actually receiving and returning a span v2 JSON object.
566
- * Only useful in conjunction with the {@link CoreOptions.traceLifecycle} option.
567
- */
568
- export type SpanV2CompatibleBeforeSendSpanCallback = ((span: SpanV2JSON) => SpanV2JSON) & {
569
- _v2: true;
570
- };
571
555
  /** Base configuration options for every SDK. */
572
556
  export interface CoreOptions<TO extends BaseTransportOptions = BaseTransportOptions> extends Pick<Partial<ClientOptions<TO>>, Exclude<keyof Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'>> {
573
557
  /**
@@ -1,4 +1,3 @@
1
- import { Attributes } from '../attributes';
2
1
  import { SpanLink, SpanLinkJSON } from './link';
3
2
  import { Measurements } from './measurement';
4
3
  import { HrTime } from './opentelemetry';
@@ -18,32 +17,6 @@ export type SpanAttributes = Partial<{
18
17
  }> & Record<string, SpanAttributeValue | undefined>;
19
18
  /** This type is aligned with the OpenTelemetry TimeInput type. */
20
19
  export type SpanTimeInput = HrTime | number | Date;
21
- /**
22
- * JSON representation of a v2 span, as it should be sent to Sentry.
23
- */
24
- export interface SpanV2JSON {
25
- trace_id: string;
26
- parent_span_id?: string;
27
- span_id: string;
28
- name: string;
29
- start_timestamp: number;
30
- end_timestamp: number;
31
- status: 'ok' | 'error';
32
- is_segment: boolean;
33
- attributes?: Attributes;
34
- links?: SpanLinkJSON<Attributes>[];
35
- }
36
- /**
37
- * A SpanV2JSON with an attached reference to the segment span.
38
- * This reference is used to compute dynamic sampling context before sending.
39
- * The reference MUST be removed before sending the span envelope.
40
- */
41
- export interface SpanV2JSONWithSegmentRef extends SpanV2JSON {
42
- _segmentSpan: Span;
43
- }
44
- export type SerializedSpanContainer = {
45
- items: Array<SpanV2JSON>;
46
- };
47
20
  /** A JSON representation of a span. */
48
21
  export interface SpanJSON {
49
22
  data: SpanAttributes;
@@ -1,12 +1,12 @@
1
1
  import { ClientOptions } from '../types-hoist/options';
2
- import { SpanJSON, SpanV2JSON } from '../types-hoist/span';
2
+ import { SpanJSON } from '../types-hoist/span';
3
3
  /**
4
4
  * Check if a span should be ignored based on the ignoreSpans configuration.
5
5
  */
6
- export declare function shouldIgnoreSpan(span: Pick<SpanJSON, 'description' | 'op'> | Pick<SpanV2JSON, 'name' | 'attributes'>, ignoreSpans: Required<ClientOptions>['ignoreSpans']): boolean;
6
+ export declare function shouldIgnoreSpan(span: Pick<SpanJSON, 'description' | 'op'>, ignoreSpans: Required<ClientOptions>['ignoreSpans']): boolean;
7
7
  /**
8
8
  * Takes a list of spans, and a span that was dropped, and re-parents the child spans of the dropped span to the parent of the dropped span, if possible.
9
9
  * This mutates the spans array in place!
10
10
  */
11
- export declare function reparentChildSpans(spans: Pick<SpanV2JSON, 'parent_span_id' | 'span_id'>[], dropSpan: Pick<SpanV2JSON, 'parent_span_id' | 'span_id'>): void;
11
+ export declare function reparentChildSpans(spans: SpanJSON[], dropSpan: SpanJSON): void;
12
12
  //# sourceMappingURL=should-ignore-span.d.ts.map
@@ -1,7 +1,6 @@
1
- import { Attributes } from '../attributes';
2
1
  import { TraceContext } from '../types-hoist/context';
3
2
  import { SpanLink, SpanLinkJSON } from '../types-hoist/link';
4
- import { Span, SpanAttributes, SpanJSON, SpanTimeInput, SpanV2JSON } from '../types-hoist/span';
3
+ import { Span, SpanAttributes, SpanJSON, SpanTimeInput } from '../types-hoist/span';
5
4
  import { SpanStatus } from '../types-hoist/spanStatus';
6
5
  export declare const TRACE_FLAG_NONE = 0;
7
6
  export declare const TRACE_FLAG_SAMPLED = 1;
@@ -29,12 +28,6 @@ export declare function spanToTraceparentHeader(span: Span): string;
29
28
  * If the links array is empty, it returns `undefined` so the empty value can be dropped before it's sent.
30
29
  */
31
30
  export declare function convertSpanLinksForEnvelope(links?: SpanLink[]): SpanLinkJSON[] | undefined;
32
- /**
33
- *
34
- * @param links
35
- * @returns
36
- */
37
- export declare function getV2SpanLinks(links?: SpanLink[]): SpanLinkJSON<Attributes>[] | undefined;
38
31
  /**
39
32
  * Convert a span time input into a timestamp in seconds.
40
33
  */
@@ -43,11 +36,6 @@ export declare function spanTimeInputToSeconds(input: SpanTimeInput | undefined)
43
36
  * Convert a span to a JSON representation.
44
37
  */
45
38
  export declare function spanToJSON(span: Span): SpanJSON;
46
- /**
47
- * Convert a span to a SpanV2JSON representation.
48
- * @returns
49
- */
50
- export declare function spanToV2JSON(span: Span): SpanV2JSON;
51
39
  /** Exported only for tests. */
52
40
  export interface OpenTelemetrySdkTraceBaseSpan extends Span {
53
41
  attributes: SpanAttributes;
@@ -67,10 +55,6 @@ export interface OpenTelemetrySdkTraceBaseSpan extends Span {
67
55
  export declare function spanIsSampled(span: Span): boolean;
68
56
  /** Get the status message to use for a JSON representation of a span. */
69
57
  export declare function getStatusMessage(status: SpanStatus | undefined): string | undefined;
70
- /**
71
- * Convert the various statuses to the ones expected by Sentry ('ok' is default)
72
- */
73
- export declare function getV2StatusMessage(status: SpanStatus | undefined): 'ok' | 'error';
74
58
  declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
75
59
  declare const ROOT_SPAN_FIELD = "_sentryRootSpan";
76
60
  type SpanWithPotentialChildren = Span & {
@@ -90,11 +74,7 @@ export declare function getSpanDescendants(span: SpanWithPotentialChildren): Spa
90
74
  /**
91
75
  * Returns the root span of a given span.
92
76
  */
93
- export declare const getRootSpan: typeof INTERNAL_getSegmentSpan;
94
- /**
95
- * Returns the segment span of a given span.
96
- */
97
- export declare function INTERNAL_getSegmentSpan(span: SpanWithPotentialChildren): Span;
77
+ export declare function getRootSpan(span: SpanWithPotentialChildren): Span;
98
78
  /**
99
79
  * Returns the currently active span.
100
80
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/core",
3
- "version": "10.39.0-alpha.0",
3
+ "version": "10.39.0",
4
4
  "description": "Base implementation for all Sentry JavaScript SDKs",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -1,54 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const debugBuild = require('../debug-build.js');
4
- const integration = require('../integration.js');
5
- const captureSpan = require('../spans/captureSpan.js');
6
- const spanBuffer = require('../spans/spanBuffer.js');
7
- const beforeSendSpan = require('../utils/beforeSendSpan.js');
8
- const debugLogger = require('../utils/debug-logger.js');
9
-
10
- const INTEGRATION_NAME = 'SpanStreaming';
11
-
12
- const _spanStreamingIntegration = ((options) => {
13
- return {
14
- name: INTEGRATION_NAME,
15
- setup(client) {
16
- const clientOptions = client.getOptions();
17
- const beforeSendSpan$1 = clientOptions.beforeSendSpan;
18
-
19
- const initialMessage = 'spanStreamingIntegration requires';
20
- const fallbackMsg = 'Falling back to static trace lifecycle.';
21
-
22
- if (clientOptions.traceLifecycle !== 'stream') {
23
- client.getOptions().traceLifecycle = 'static';
24
- debugBuild.DEBUG_BUILD && debugLogger.debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
25
- return;
26
- }
27
-
28
- if (beforeSendSpan$1 && !beforeSendSpan.isV2BeforeSendSpanCallback(beforeSendSpan$1)) {
29
- client.getOptions().traceLifecycle = 'static';
30
- debugBuild.DEBUG_BUILD &&
31
- debugLogger.debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamSpan\`! ${fallbackMsg}`);
32
- return;
33
- }
34
-
35
- const buffer = new spanBuffer.SpanBuffer(client, options);
36
-
37
- client.on('enqueueSpan', spanJSON => {
38
- buffer.addSpan(spanJSON);
39
- });
40
-
41
- client.on('afterSpanEnd', span => {
42
- captureSpan.captureSpan(span, client);
43
- });
44
- },
45
- };
46
- }) ;
47
-
48
- /**
49
- * Span streaming integration used by server runtime SDKs.
50
- */
51
- const spanStreamingIntegration = integration.defineIntegration(_spanStreamingIntegration);
52
-
53
- exports.spanStreamingIntegration = spanStreamingIntegration;
54
- //# sourceMappingURL=spanStreaming.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanStreaming.js","sources":["../../../src/integrations/spanStreaming.ts"],"sourcesContent":["import { DEBUG_BUILD } from '../debug-build';\nimport { defineIntegration } from '../integration';\nimport { captureSpan } from '../spans/captureSpan';\nimport { SpanBuffer } from '../spans/spanBuffer';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { isV2BeforeSendSpanCallback } from '../utils/beforeSendSpan';\nimport { debug } from '../utils/debug-logger';\n\nexport interface ServerSpanStreamingOptions {\n /** Max spans per envelope batch (default: 1000) */\n maxSpanLimit?: number;\n /** Flush interval in ms (default: 5000) */\n flushInterval?: number;\n}\n\nconst INTEGRATION_NAME = 'SpanStreaming';\n\nconst _spanStreamingIntegration = ((options?: ServerSpanStreamingOptions) => {\n return {\n name: INTEGRATION_NAME,\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 client.getOptions().traceLifecycle = 'static';\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_BUILD &&\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n const buffer = new SpanBuffer(client, options);\n\n client.on('enqueueSpan', spanJSON => {\n buffer.addSpan(spanJSON);\n });\n\n client.on('afterSpanEnd', span => {\n captureSpan(span, client);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Span streaming integration used by server runtime SDKs.\n */\nexport const spanStreamingIntegration = defineIntegration(_spanStreamingIntegration);\n"],"names":["beforeSendSpan","DEBUG_BUILD","debug","isV2BeforeSendSpanCallback","SpanBuffer","captureSpan","defineIntegration"],"mappings":";;;;;;;;;AAeA,MAAM,gBAAA,GAAmB,eAAe;;AAExC,MAAM,6BAA6B,CAAC,OAAO,KAAkC;AAC7E,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,MAAM,aAAA,GAAgB,MAAM,CAAC,UAAU,EAAE;AAC/C,MAAM,MAAMA,gBAAA,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,QAAQ,MAAM,CAAC,UAAU,EAAE,CAAC,cAAA,GAAiB,QAAQ;AACrD,QAAQC,0BAAeC,iBAAK,CAAC,IAAI,CAAC,CAAC,EAAA,cAAA,CAAA,2CAAA,EAAA,WAAA,CAAA,CAAA,CAAA;AACA,QAAA;AACA,MAAA;;AAEA,MAAA,IAAAF,gBAAA,IAAA,CAAAG,yCAAA,CAAAH,gBAAA,CAAA,EAAA;AACA,QAAA,MAAA,CAAA,UAAA,EAAA,CAAA,cAAA,GAAA,QAAA;AACA,QAAAC,sBAAA;AACA,UAAAC,iBAAA,CAAA,IAAA,CAAA,CAAA,EAAA,cAAA,CAAA,qDAAA,EAAA,WAAA,CAAA,CAAA,CAAA;AACA,QAAA;AACA,MAAA;;AAEA,MAAA,MAAA,MAAA,GAAA,IAAAE,qBAAA,CAAA,MAAA,EAAA,OAAA,CAAA;;AAEA,MAAA,MAAA,CAAA,EAAA,CAAA,aAAA,EAAA,QAAA,IAAA;AACA,QAAA,MAAA,CAAA,OAAA,CAAA,QAAA,CAAA;AACA,MAAA,CAAA,CAAA;;AAEA,MAAA,MAAA,CAAA,EAAA,CAAA,cAAA,EAAA,IAAA,IAAA;AACA,QAAAC,uBAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AACA,MAAA,CAAA,CAAA;AACA,IAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA;;AAEA;AACA;AACA;AACA,MAAA,wBAAA,GAAAC,6BAAA,CAAA,yBAAA;;;;"}