@sentry/core 10.32.0-alpha.0 → 10.32.1
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.
- package/build/cjs/attributes.js +74 -57
- package/build/cjs/attributes.js.map +1 -1
- package/build/cjs/client.js +6 -11
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/envelope.js +7 -41
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/index.js +0 -29
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/eventFilters.js +1 -1
- package/build/cjs/integrations/eventFilters.js.map +1 -1
- package/build/cjs/integrations/requestdata.js +6 -72
- package/build/cjs/integrations/requestdata.js.map +1 -1
- package/build/cjs/integrations/supabase.js.map +1 -1
- package/build/cjs/logs/internal.js +8 -54
- package/build/cjs/logs/internal.js.map +1 -1
- package/build/cjs/scope.js +12 -6
- package/build/cjs/scope.js.map +1 -1
- package/build/cjs/semanticAttributes.js +0 -36
- package/build/cjs/semanticAttributes.js.map +1 -1
- package/build/cjs/tracing/sentrySpan.js +0 -31
- package/build/cjs/tracing/sentrySpan.js.map +1 -1
- package/build/cjs/tracing/trace.js +0 -1
- package/build/cjs/tracing/trace.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/index.js +9 -1
- package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
- package/build/cjs/utils/aggregate-errors.js +4 -4
- package/build/cjs/utils/aggregate-errors.js.map +1 -1
- package/build/cjs/utils/applyScopeDataToEvent.js +1 -4
- package/build/cjs/utils/applyScopeDataToEvent.js.map +1 -1
- package/build/cjs/utils/featureFlags.js +0 -1
- package/build/cjs/utils/featureFlags.js.map +1 -1
- package/build/cjs/utils/is.js +2 -0
- package/build/cjs/utils/is.js.map +1 -1
- package/build/cjs/utils/should-ignore-span.js +9 -31
- package/build/cjs/utils/should-ignore-span.js.map +1 -1
- package/build/cjs/utils/spanUtils.js +2 -101
- package/build/cjs/utils/spanUtils.js.map +1 -1
- package/build/cjs/utils/version.js +1 -1
- package/build/cjs/utils/version.js.map +1 -1
- package/build/esm/attributes.js +74 -58
- package/build/esm/attributes.js.map +1 -1
- package/build/esm/client.js +1 -6
- package/build/esm/client.js.map +1 -1
- package/build/esm/envelope.js +8 -41
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/index.js +3 -9
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/eventFilters.js +1 -1
- package/build/esm/integrations/eventFilters.js.map +1 -1
- package/build/esm/integrations/requestdata.js +6 -72
- package/build/esm/integrations/requestdata.js.map +1 -1
- package/build/esm/integrations/supabase.js.map +1 -1
- package/build/esm/logs/internal.js +9 -54
- package/build/esm/logs/internal.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/scope.js +12 -6
- package/build/esm/scope.js.map +1 -1
- package/build/esm/semanticAttributes.js +1 -26
- package/build/esm/semanticAttributes.js.map +1 -1
- package/build/esm/tracing/sentrySpan.js +1 -32
- package/build/esm/tracing/sentrySpan.js.map +1 -1
- package/build/esm/tracing/trace.js +0 -1
- package/build/esm/tracing/trace.js.map +1 -1
- package/build/esm/tracing/vercel-ai/index.js +10 -2
- package/build/esm/tracing/vercel-ai/index.js.map +1 -1
- package/build/esm/utils/aggregate-errors.js +4 -4
- package/build/esm/utils/aggregate-errors.js.map +1 -1
- package/build/esm/utils/applyScopeDataToEvent.js +1 -4
- package/build/esm/utils/applyScopeDataToEvent.js.map +1 -1
- package/build/esm/utils/featureFlags.js +0 -1
- package/build/esm/utils/featureFlags.js.map +1 -1
- package/build/esm/utils/is.js +2 -0
- package/build/esm/utils/is.js.map +1 -1
- package/build/esm/utils/should-ignore-span.js +9 -31
- package/build/esm/utils/should-ignore-span.js.map +1 -1
- package/build/esm/utils/spanUtils.js +3 -97
- package/build/esm/utils/spanUtils.js.map +1 -1
- package/build/esm/utils/version.js +1 -1
- package/build/esm/utils/version.js.map +1 -1
- package/build/types/attributes.d.ts +18 -5
- package/build/types/attributes.d.ts.map +1 -1
- package/build/types/client.d.ts +2 -40
- package/build/types/client.d.ts.map +1 -1
- package/build/types/envelope.d.ts +1 -6
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -10
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/requestdata.d.ts.map +1 -1
- package/build/types/integrations/supabase.d.ts.map +1 -1
- package/build/types/logs/internal.d.ts +1 -9
- package/build/types/logs/internal.d.ts.map +1 -1
- package/build/types/scope.d.ts +12 -6
- package/build/types/scope.d.ts.map +1 -1
- package/build/types/semanticAttributes.d.ts +0 -21
- package/build/types/semanticAttributes.d.ts.map +1 -1
- package/build/types/tracing/sentrySpan.d.ts +1 -10
- package/build/types/tracing/sentrySpan.d.ts.map +1 -1
- package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
- package/build/types/types-hoist/breadcrumb.d.ts.map +1 -1
- package/build/types/types-hoist/context.d.ts.map +1 -1
- package/build/types/types-hoist/envelope.d.ts +2 -22
- package/build/types/types-hoist/envelope.d.ts.map +1 -1
- package/build/types/types-hoist/error.d.ts.map +1 -1
- package/build/types/types-hoist/event.d.ts.map +1 -1
- package/build/types/types-hoist/instrument.d.ts.map +1 -1
- package/build/types/types-hoist/integration.d.ts.map +1 -1
- package/build/types/types-hoist/link.d.ts +2 -2
- package/build/types/types-hoist/link.d.ts.map +1 -1
- package/build/types/types-hoist/log.d.ts +2 -14
- package/build/types/types-hoist/log.d.ts.map +1 -1
- package/build/types/types-hoist/misc.d.ts.map +1 -1
- package/build/types/types-hoist/options.d.ts +2 -18
- package/build/types/types-hoist/options.d.ts.map +1 -1
- package/build/types/types-hoist/polymorphics.d.ts.map +1 -1
- package/build/types/types-hoist/samplingcontext.d.ts.map +1 -1
- package/build/types/types-hoist/span.d.ts +0 -27
- package/build/types/types-hoist/span.d.ts.map +1 -1
- package/build/types/types-hoist/stackframe.d.ts.map +1 -1
- package/build/types/types-hoist/user.d.ts.map +1 -1
- package/build/types/utils/applyScopeDataToEvent.d.ts +1 -1
- package/build/types/utils/applyScopeDataToEvent.d.ts.map +1 -1
- package/build/types/utils/featureFlags.d.ts.map +1 -1
- package/build/types/utils/is.d.ts +1 -1
- package/build/types/utils/is.d.ts.map +1 -1
- package/build/types/utils/should-ignore-span.d.ts +3 -3
- package/build/types/utils/should-ignore-span.d.ts.map +1 -1
- package/build/types/utils/spanUtils.d.ts +2 -26
- package/build/types/utils/spanUtils.d.ts.map +1 -1
- package/build/types-ts3.8/attributes.d.ts +18 -5
- package/build/types-ts3.8/client.d.ts +2 -40
- package/build/types-ts3.8/envelope.d.ts +1 -6
- package/build/types-ts3.8/index.d.ts +4 -10
- package/build/types-ts3.8/logs/internal.d.ts +1 -9
- package/build/types-ts3.8/scope.d.ts +12 -6
- package/build/types-ts3.8/semanticAttributes.d.ts +0 -21
- package/build/types-ts3.8/tracing/sentrySpan.d.ts +1 -10
- package/build/types-ts3.8/types-hoist/envelope.d.ts +2 -22
- package/build/types-ts3.8/types-hoist/link.d.ts +2 -2
- package/build/types-ts3.8/types-hoist/log.d.ts +2 -14
- package/build/types-ts3.8/types-hoist/options.d.ts +2 -18
- package/build/types-ts3.8/types-hoist/span.d.ts +0 -27
- package/build/types-ts3.8/utils/applyScopeDataToEvent.d.ts +1 -1
- package/build/types-ts3.8/utils/is.d.ts +1 -1
- package/build/types-ts3.8/utils/should-ignore-span.d.ts +3 -3
- package/build/types-ts3.8/utils/spanUtils.d.ts +2 -26
- package/package.json +1 -1
- package/build/cjs/integrations/serverSpanStreaming.js +0 -51
- package/build/cjs/integrations/serverSpanStreaming.js.map +0 -1
- package/build/cjs/spans/captureSpan.js +0 -107
- package/build/cjs/spans/captureSpan.js.map +0 -1
- package/build/cjs/spans/spanBuffer.js +0 -117
- package/build/cjs/spans/spanBuffer.js.map +0 -1
- package/build/cjs/spans/spanFirstUtils.js +0 -187
- package/build/cjs/spans/spanFirstUtils.js.map +0 -1
- package/build/cjs/utils/beforeSendSpan.js +0 -36
- package/build/cjs/utils/beforeSendSpan.js.map +0 -1
- package/build/esm/integrations/serverSpanStreaming.js +0 -49
- package/build/esm/integrations/serverSpanStreaming.js.map +0 -1
- package/build/esm/spans/captureSpan.js +0 -105
- package/build/esm/spans/captureSpan.js.map +0 -1
- package/build/esm/spans/spanBuffer.js +0 -115
- package/build/esm/spans/spanBuffer.js.map +0 -1
- package/build/esm/spans/spanFirstUtils.js +0 -183
- package/build/esm/spans/spanFirstUtils.js.map +0 -1
- package/build/esm/utils/beforeSendSpan.js +0 -33
- package/build/esm/utils/beforeSendSpan.js.map +0 -1
- package/build/types/integrations/serverSpanStreaming.d.ts +0 -8
- package/build/types/integrations/serverSpanStreaming.d.ts.map +0 -1
- package/build/types/spans/captureSpan.d.ts +0 -10
- package/build/types/spans/captureSpan.d.ts.map +0 -1
- package/build/types/spans/spanBuffer.d.ts +0 -31
- package/build/types/spans/spanBuffer.d.ts.map +0 -1
- package/build/types/spans/spanFirstUtils.d.ts +0 -20
- package/build/types/spans/spanFirstUtils.d.ts.map +0 -1
- package/build/types/types-hoist/attributes.d.ts +0 -19
- package/build/types/types-hoist/attributes.d.ts.map +0 -1
- package/build/types/utils/beforeSendSpan.d.ts +0 -22
- package/build/types/utils/beforeSendSpan.d.ts.map +0 -1
- package/build/types-ts3.8/integrations/serverSpanStreaming.d.ts +0 -8
- package/build/types-ts3.8/spans/captureSpan.d.ts +0 -10
- package/build/types-ts3.8/spans/spanBuffer.d.ts +0 -31
- package/build/types-ts3.8/spans/spanFirstUtils.d.ts +0 -20
- package/build/types-ts3.8/types-hoist/attributes.d.ts +0 -19
- package/build/types-ts3.8/utils/beforeSendSpan.d.ts +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpanLink } from '../types-hoist/link';
|
|
2
|
-
import { SentrySpanArguments, Span, SpanAttributes, SpanAttributeValue, SpanContextData, SpanJSON, SpanTimeInput
|
|
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 {
|
|
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 |
|
|
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
|
|
@@ -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
|
|
22
|
+
export interface SpanLinkJSON extends Record<string, unknown> {
|
|
23
23
|
span_id: string;
|
|
24
24
|
trace_id: string;
|
|
25
25
|
sampled?: boolean;
|
|
26
|
-
attributes?:
|
|
26
|
+
attributes?: SpanLinkAttributes;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Attributes } from '../attributes';
|
|
1
2
|
import { ParameterizedString } from './parameterize';
|
|
2
3
|
export type LogSeverityLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
3
4
|
export interface Log {
|
|
@@ -24,19 +25,6 @@ export interface Log {
|
|
|
24
25
|
*/
|
|
25
26
|
severityNumber?: number;
|
|
26
27
|
}
|
|
27
|
-
export type SerializedLogAttributeValue = {
|
|
28
|
-
value: string;
|
|
29
|
-
type: 'string';
|
|
30
|
-
} | {
|
|
31
|
-
value: number;
|
|
32
|
-
type: 'integer';
|
|
33
|
-
} | {
|
|
34
|
-
value: number;
|
|
35
|
-
type: 'double';
|
|
36
|
-
} | {
|
|
37
|
-
value: boolean;
|
|
38
|
-
type: 'boolean';
|
|
39
|
-
};
|
|
40
28
|
export interface SerializedLog {
|
|
41
29
|
/**
|
|
42
30
|
* Timestamp in seconds (epoch time) indicating when the log occurred.
|
|
@@ -57,7 +45,7 @@ export interface SerializedLog {
|
|
|
57
45
|
/**
|
|
58
46
|
* Arbitrary structured data that stores information about the log - e.g., userId: 100.
|
|
59
47
|
*/
|
|
60
|
-
attributes?:
|
|
48
|
+
attributes?: Attributes;
|
|
61
49
|
/**
|
|
62
50
|
* The severity number.
|
|
63
51
|
*/
|
|
@@ -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
|
|
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';
|
|
@@ -356,15 +356,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
356
356
|
* @default false
|
|
357
357
|
*/
|
|
358
358
|
strictTraceContinuation?: boolean;
|
|
359
|
-
/**
|
|
360
|
-
* [Experimental] The trace lifecycle, determining whether spans are sent statically when the entire local span tree is complete, or
|
|
361
|
-
* in batches, following interval- and action-based triggers.
|
|
362
|
-
*
|
|
363
|
-
* @experimental this option is currently still experimental and its type, name, or entire presence is subject to break and change at any time.
|
|
364
|
-
*
|
|
365
|
-
* @default 'static'
|
|
366
|
-
*/
|
|
367
|
-
traceLifecycle?: 'static' | 'stream';
|
|
368
359
|
/**
|
|
369
360
|
* The organization ID for your Sentry project.
|
|
370
361
|
*
|
|
@@ -441,7 +432,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
441
432
|
*
|
|
442
433
|
* @returns The modified span payload that will be sent.
|
|
443
434
|
*/
|
|
444
|
-
beforeSendSpan?: (
|
|
435
|
+
beforeSendSpan?: (span: SpanJSON) => SpanJSON;
|
|
445
436
|
/**
|
|
446
437
|
* An event-processing callback for transaction events, guaranteed to be invoked after all other event
|
|
447
438
|
* processors. This allows an event to be modified or dropped before it's sent.
|
|
@@ -467,13 +458,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
467
458
|
*/
|
|
468
459
|
beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
|
|
469
460
|
}
|
|
470
|
-
/**
|
|
471
|
-
* A callback that is known to be compatible with actually receiving and returning a span v2 JSON object.
|
|
472
|
-
* Only useful in conjunction with the {@link CoreOptions.traceLifecycle} option.
|
|
473
|
-
*/
|
|
474
|
-
export type SpanV2CompatibleBeforeSendSpanCallback = ((span: SpanV2JSON) => SpanV2JSON) & {
|
|
475
|
-
_v2: true;
|
|
476
|
-
};
|
|
477
461
|
/** Base configuration options for every SDK. */
|
|
478
462
|
export interface CoreOptions<TO extends BaseTransportOptions = BaseTransportOptions> extends Pick<Partial<ClientOptions<TO>>, Exclude<keyof Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'>> {
|
|
479
463
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TypedAttributes } 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?: TypedAttributes;
|
|
34
|
-
links?: SpanLinkJSON<TypedAttributes>[];
|
|
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;
|
|
@@ -10,7 +10,7 @@ export declare function mergeScopeData(data: ScopeData, mergeData: ScopeData): v
|
|
|
10
10
|
* Merges certain scope data. Undefined values will overwrite any existing values.
|
|
11
11
|
* Exported only for tests.
|
|
12
12
|
*/
|
|
13
|
-
export declare function mergeAndOverwriteScopeData<Prop extends 'extra' | 'tags' | 'user' | 'contexts' | 'sdkProcessingMetadata', Data extends ScopeData>(data: Data, prop: Prop, mergeVal: Data[Prop]): void;
|
|
13
|
+
export declare function mergeAndOverwriteScopeData<Prop extends 'extra' | 'tags' | 'attributes' | 'user' | 'contexts' | 'sdkProcessingMetadata', Data extends ScopeData>(data: Data, prop: Prop, mergeVal: Data[Prop]): void;
|
|
14
14
|
/** Exported only for tests */
|
|
15
15
|
export declare function mergeArray<Prop extends 'breadcrumbs' | 'fingerprint'>(event: Event, prop: Prop, mergeVal: ScopeData[Prop]): void;
|
|
16
16
|
//# sourceMappingURL=applyScopeDataToEvent.d.ts.map
|
|
@@ -111,7 +111,7 @@ export declare function isSyntheticEvent(wat: unknown): boolean;
|
|
|
111
111
|
* @param base A constructor to be used in a check.
|
|
112
112
|
* @returns A boolean representing the result.
|
|
113
113
|
*/
|
|
114
|
-
export declare function isInstanceOf(wat: any, base: any):
|
|
114
|
+
export declare function isInstanceOf<T>(wat: any, base: any): wat is T;
|
|
115
115
|
/**
|
|
116
116
|
* Checks whether given value's type is a Vue ViewModel or a VNode.
|
|
117
117
|
*
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ClientOptions } from '../types-hoist/options';
|
|
2
|
-
import { SpanJSON
|
|
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'
|
|
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:
|
|
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 { TypedAttributes } 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
|
|
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<TypedAttributes>[] | 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,14 +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
|
-
/**
|
|
75
|
-
* Convert the attributes to the ones expected by Sentry, including the type annotation
|
|
76
|
-
*/
|
|
77
|
-
export declare function getV2Attributes(attributes: SpanAttributes): TypedAttributes;
|
|
78
58
|
declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
|
|
79
59
|
declare const ROOT_SPAN_FIELD = "_sentryRootSpan";
|
|
80
60
|
type SpanWithPotentialChildren = Span & {
|
|
@@ -94,11 +74,7 @@ export declare function getSpanDescendants(span: SpanWithPotentialChildren): Spa
|
|
|
94
74
|
/**
|
|
95
75
|
* Returns the root span of a given span.
|
|
96
76
|
*/
|
|
97
|
-
export declare
|
|
98
|
-
/**
|
|
99
|
-
* Returns the segment span of a given span.
|
|
100
|
-
*/
|
|
101
|
-
export declare function INTERNAL_getSegmentSpan(span: SpanWithPotentialChildren): Span;
|
|
77
|
+
export declare function getRootSpan(span: SpanWithPotentialChildren): Span;
|
|
102
78
|
/**
|
|
103
79
|
* Returns the currently active span.
|
|
104
80
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/core",
|
|
3
|
-
"version": "10.32.
|
|
3
|
+
"version": "10.32.1",
|
|
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,51 +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 = 'ServerSpanStreaming';
|
|
11
|
-
|
|
12
|
-
const _serverSpanStreamingIntegration = ((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 = 'serverSpanStreamingIntegration 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
|
-
const serverSpanStreamingIntegration = integration.defineIntegration(_serverSpanStreamingIntegration);
|
|
49
|
-
|
|
50
|
-
exports.serverSpanStreamingIntegration = serverSpanStreamingIntegration;
|
|
51
|
-
//# sourceMappingURL=serverSpanStreaming.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverSpanStreaming.js","sources":["../../../src/integrations/serverSpanStreaming.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 = 'ServerSpanStreaming';\n\nconst _serverSpanStreamingIntegration = ((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 = 'serverSpanStreamingIntegration 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\nexport const serverSpanStreamingIntegration = defineIntegration(_serverSpanStreamingIntegration);\n"],"names":["beforeSendSpan","DEBUG_BUILD","debug","isV2BeforeSendSpanCallback","SpanBuffer","captureSpan","defineIntegration"],"mappings":";;;;;;;;;AAeA,MAAM,gBAAA,GAAmB,qBAAqB;;AAE9C,MAAM,mCAAmC,CAAC,OAAO,KAAkC;AACnF,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,yCAAyC;AACtE,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,MAAA,8BAAA,GAAAC,6BAAA,CAAA,+BAAA;;;;"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const currentScopes = require('../currentScopes.js');
|
|
4
|
-
const debugBuild = require('../debug-build.js');
|
|
5
|
-
const semanticAttributes = require('../semanticAttributes.js');
|
|
6
|
-
const utils = require('../tracing/utils.js');
|
|
7
|
-
const applyScopeDataToEvent = require('../utils/applyScopeDataToEvent.js');
|
|
8
|
-
const beforeSendSpan = require('../utils/beforeSendSpan.js');
|
|
9
|
-
const debugLogger = require('../utils/debug-logger.js');
|
|
10
|
-
const spanUtils = require('../utils/spanUtils.js');
|
|
11
|
-
const spanFirstUtils = require('./spanFirstUtils.js');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Captures a span and returns a JSON representation to be enqueued for sending.
|
|
15
|
-
*
|
|
16
|
-
* IMPORTANT: This function converts the span to JSON immediately to avoid writing
|
|
17
|
-
* to an already-ended OTel span instance (which is blocked by the OTel Span class).
|
|
18
|
-
*/
|
|
19
|
-
function captureSpan(span, client = currentScopes.getClient()) {
|
|
20
|
-
if (!client) {
|
|
21
|
-
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('No client available to capture span.');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Convert to JSON FIRST - we cannot write to an already-ended span
|
|
26
|
-
const spanJSON = spanUtils.spanToV2JSON(span);
|
|
27
|
-
|
|
28
|
-
const segmentSpan = spanUtils.INTERNAL_getSegmentSpan(span);
|
|
29
|
-
const serializedSegmentSpan = spanUtils.spanToV2JSON(segmentSpan);
|
|
30
|
-
|
|
31
|
-
const { isolationScope: spanIsolationScope, scope: spanScope } = utils.getCapturedScopesOnSpan(span);
|
|
32
|
-
|
|
33
|
-
const finalScopeData = getFinalScopeData(spanIsolationScope, spanScope);
|
|
34
|
-
|
|
35
|
-
applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData);
|
|
36
|
-
|
|
37
|
-
if (span === segmentSpan) {
|
|
38
|
-
applyScopeToSegmentSpan(spanJSON, finalScopeData);
|
|
39
|
-
client.emit('processSegmentSpan', spanJSON, { scopeData: finalScopeData });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Allow integrations to add additional data to the span JSON
|
|
43
|
-
client.emit('processSpan', spanJSON, { readOnlySpan: span });
|
|
44
|
-
|
|
45
|
-
const beforeSendSpan$1 = client.getOptions().beforeSendSpan;
|
|
46
|
-
const processedSpan = beforeSendSpan.isV2BeforeSendSpanCallback(beforeSendSpan$1)
|
|
47
|
-
? spanFirstUtils.applyBeforeSendSpanCallback(spanJSON, beforeSendSpan$1)
|
|
48
|
-
: spanJSON;
|
|
49
|
-
|
|
50
|
-
const spanWithRef = {
|
|
51
|
-
...processedSpan,
|
|
52
|
-
_segmentSpan: segmentSpan,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
client.emit('enqueueSpan', spanWithRef);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function applyScopeToSegmentSpan(segmentSpanJSON, scopeData) {
|
|
59
|
-
// TODO: Apply all scope and request data from auto instrumentation (contexts, request) to segment span
|
|
60
|
-
const { contexts } = scopeData;
|
|
61
|
-
|
|
62
|
-
spanFirstUtils.safeSetSpanJSONAttributes(segmentSpanJSON, spanFirstUtils.contextsToAttributes(contexts));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function applyCommonSpanAttributes(
|
|
66
|
-
spanJSON,
|
|
67
|
-
serializedSegmentSpan,
|
|
68
|
-
client,
|
|
69
|
-
scopeData,
|
|
70
|
-
) {
|
|
71
|
-
const sdk = client.getSdkMetadata();
|
|
72
|
-
const { release, environment, sendDefaultPii } = client.getOptions();
|
|
73
|
-
|
|
74
|
-
// avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)
|
|
75
|
-
spanFirstUtils.safeSetSpanJSONAttributes(spanJSON, {
|
|
76
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,
|
|
77
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,
|
|
78
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,
|
|
79
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id,
|
|
80
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,
|
|
81
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,
|
|
82
|
-
...(sendDefaultPii
|
|
83
|
-
? {
|
|
84
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id,
|
|
85
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email,
|
|
86
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address,
|
|
87
|
-
[semanticAttributes.SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username,
|
|
88
|
-
}
|
|
89
|
-
: {}),
|
|
90
|
-
...scopeData.attributes,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// TODO: Extract this to a helper in core. It's used in multiple places.
|
|
95
|
-
function getFinalScopeData(isolationScope, scope) {
|
|
96
|
-
const finalScopeData = currentScopes.getGlobalScope().getScopeData();
|
|
97
|
-
if (isolationScope) {
|
|
98
|
-
applyScopeDataToEvent.mergeScopeData(finalScopeData, isolationScope.getScopeData());
|
|
99
|
-
}
|
|
100
|
-
if (scope) {
|
|
101
|
-
applyScopeDataToEvent.mergeScopeData(finalScopeData, scope.getScopeData());
|
|
102
|
-
}
|
|
103
|
-
return finalScopeData;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
exports.captureSpan = captureSpan;
|
|
107
|
-
//# sourceMappingURL=captureSpan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"captureSpan.js","sources":["../../../src/spans/captureSpan.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getClient, getGlobalScope } from '../currentScopes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Scope, ScopeData } from '../scope';\nimport {\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_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n} from '../semanticAttributes';\nimport { getCapturedScopesOnSpan } from '../tracing/utils';\nimport type { Span, SpanV2JSON } from '../types-hoist/span';\nimport { mergeScopeData } from '../utils/applyScopeDataToEvent';\nimport { isV2BeforeSendSpanCallback } from '../utils/beforeSendSpan';\nimport { debug } from '../utils/debug-logger';\nimport { INTERNAL_getSegmentSpan, spanToV2JSON } from '../utils/spanUtils';\nimport { applyBeforeSendSpanCallback, contextsToAttributes, safeSetSpanJSONAttributes } from './spanFirstUtils';\n/**\n * Captures a span and returns a JSON representation to be enqueued for sending.\n *\n * IMPORTANT: This function converts the span to JSON immediately to avoid writing\n * to an already-ended OTel span instance (which is blocked by the OTel Span class).\n */\nexport function captureSpan(span: Span, client = getClient()): void {\n if (!client) {\n DEBUG_BUILD && debug.warn('No client available to capture span.');\n return;\n }\n\n // Convert to JSON FIRST - we cannot write to an already-ended span\n const spanJSON = spanToV2JSON(span);\n\n const segmentSpan = INTERNAL_getSegmentSpan(span);\n const serializedSegmentSpan = spanToV2JSON(segmentSpan);\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const finalScopeData = getFinalScopeData(spanIsolationScope, spanScope);\n\n applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData);\n\n if (span === segmentSpan) {\n applyScopeToSegmentSpan(spanJSON, finalScopeData);\n client.emit('processSegmentSpan', spanJSON, { scopeData: finalScopeData });\n }\n\n // Allow integrations to add additional data to the span JSON\n client.emit('processSpan', spanJSON, { readOnlySpan: span });\n\n const beforeSendSpan = client.getOptions().beforeSendSpan;\n const processedSpan = isV2BeforeSendSpanCallback(beforeSendSpan)\n ? applyBeforeSendSpanCallback(spanJSON, beforeSendSpan)\n : spanJSON;\n\n const spanWithRef = {\n ...processedSpan,\n _segmentSpan: segmentSpan,\n };\n\n client.emit('enqueueSpan', spanWithRef);\n}\n\nfunction applyScopeToSegmentSpan(segmentSpanJSON: SpanV2JSON, scopeData: ScopeData): void {\n // TODO: Apply all scope and request data from auto instrumentation (contexts, request) to segment span\n const { contexts } = scopeData;\n\n safeSetSpanJSONAttributes(segmentSpanJSON, contextsToAttributes(contexts));\n}\n\nfunction applyCommonSpanAttributes(\n spanJSON: SpanV2JSON,\n serializedSegmentSpan: SpanV2JSON,\n client: Client,\n scopeData: ScopeData,\n): void {\n const sdk = client.getSdkMetadata();\n const { release, environment, sendDefaultPii } = client.getOptions();\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n safeSetSpanJSONAttributes(spanJSON, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id,\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]: scopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username,\n }\n : {}),\n ...scopeData.attributes,\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":["getClient","DEBUG_BUILD","debug","spanToV2JSON","INTERNAL_getSegmentSpan","getCapturedScopesOnSpan","beforeSendSpan","isV2BeforeSendSpanCallback","applyBeforeSendSpanCallback","safeSetSpanJSONAttributes","contextsToAttributes","SEMANTIC_ATTRIBUTE_SENTRY_RELEASE","SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID","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","getGlobalScope","mergeScopeData"],"mappings":"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"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const debugBuild = require('../debug-build.js');
|
|
4
|
-
const envelope = require('../envelope.js');
|
|
5
|
-
const dynamicSamplingContext = require('../tracing/dynamicSamplingContext.js');
|
|
6
|
-
const debugLogger = require('../utils/debug-logger.js');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A buffer for span JSON objects that flushes them to Sentry in Span v2 envelopes.
|
|
10
|
-
* Handles interval-based flushing, size thresholds, and graceful shutdown.
|
|
11
|
-
*/
|
|
12
|
-
class SpanBuffer {
|
|
13
|
-
|
|
14
|
-
constructor(client, options) {
|
|
15
|
-
this._spanTreeMap = new Map();
|
|
16
|
-
this._client = client;
|
|
17
|
-
|
|
18
|
-
const { maxSpanLimit, flushInterval } = options ?? {};
|
|
19
|
-
|
|
20
|
-
this._maxSpanLimit = maxSpanLimit && maxSpanLimit > 0 && maxSpanLimit <= 1000 ? maxSpanLimit : 1000;
|
|
21
|
-
this._flushInterval = flushInterval && flushInterval > 0 ? flushInterval : 5000;
|
|
22
|
-
|
|
23
|
-
this._flushIntervalId = setInterval(() => {
|
|
24
|
-
this.flush();
|
|
25
|
-
}, this._flushInterval);
|
|
26
|
-
|
|
27
|
-
this._client.on('flush', () => {
|
|
28
|
-
this.flush();
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Add a span to the buffer.
|
|
34
|
-
*/
|
|
35
|
-
addSpan(spanJSON) {
|
|
36
|
-
const traceId = spanJSON.trace_id;
|
|
37
|
-
let traceBucket = this._spanTreeMap.get(traceId);
|
|
38
|
-
if (traceBucket) {
|
|
39
|
-
traceBucket.add(spanJSON);
|
|
40
|
-
} else {
|
|
41
|
-
traceBucket = new Set([spanJSON]);
|
|
42
|
-
this._spanTreeMap.set(traceId, traceBucket);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (traceBucket.size >= this._maxSpanLimit) {
|
|
46
|
-
this._flushTrace(traceId);
|
|
47
|
-
this._debounceFlushInterval();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Flush all buffered traces.
|
|
53
|
-
*/
|
|
54
|
-
flush() {
|
|
55
|
-
if (!this._spanTreeMap.size) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Flushing span tree map with ${this._spanTreeMap.size} traces`);
|
|
60
|
-
|
|
61
|
-
this._spanTreeMap.forEach((_, traceId) => {
|
|
62
|
-
this._flushTrace(traceId);
|
|
63
|
-
});
|
|
64
|
-
this._debounceFlushInterval();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
_flushTrace(traceId) {
|
|
68
|
-
const traceBucket = this._spanTreeMap.get(traceId);
|
|
69
|
-
if (!traceBucket) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (!traceBucket.size) {
|
|
74
|
-
this._spanTreeMap.delete(traceId);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const firstSpanJSON = traceBucket.values().next().value;
|
|
79
|
-
|
|
80
|
-
const segmentSpan = firstSpanJSON?._segmentSpan;
|
|
81
|
-
if (!segmentSpan) {
|
|
82
|
-
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('No segment span reference found on span JSON, cannot compute DSC');
|
|
83
|
-
this._spanTreeMap.delete(traceId);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(segmentSpan);
|
|
88
|
-
|
|
89
|
-
const cleanedSpans = Array.from(traceBucket).map(spanJSON => {
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
91
|
-
const { _segmentSpan, ...cleanSpanJSON } = spanJSON;
|
|
92
|
-
return cleanSpanJSON;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const envelope$1 = envelope.createSpanV2Envelope(cleanedSpans, dsc, this._client);
|
|
96
|
-
|
|
97
|
-
debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Sending span envelope for trace ${traceId} with ${cleanedSpans.length} spans`);
|
|
98
|
-
|
|
99
|
-
this._client.sendEnvelope(envelope$1).then(null, reason => {
|
|
100
|
-
debugBuild.DEBUG_BUILD && debugLogger.debug.error('Error while sending span stream envelope:', reason);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
this._spanTreeMap.delete(traceId);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
_debounceFlushInterval() {
|
|
107
|
-
if (this._flushIntervalId) {
|
|
108
|
-
clearInterval(this._flushIntervalId);
|
|
109
|
-
}
|
|
110
|
-
this._flushIntervalId = setInterval(() => {
|
|
111
|
-
this.flush();
|
|
112
|
-
}, this._flushInterval);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
exports.SpanBuffer = SpanBuffer;
|
|
117
|
-
//# sourceMappingURL=spanBuffer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanBuffer.js","sources":["../../../src/spans/spanBuffer.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { createSpanV2Envelope } from '../envelope';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext';\nimport type { SpanV2JSON, SpanV2JSONWithSegmentRef } from '../types-hoist/span';\nimport { debug } from '../utils/debug-logger';\n\nexport interface SpanBufferOptions {\n /** Max spans per trace before auto-flush (default: 1000) */\n maxSpanLimit?: number;\n /** Flush interval in ms (default: 5000) */\n flushInterval?: number;\n}\n\n/**\n * A buffer for span JSON objects that flushes them to Sentry in Span v2 envelopes.\n * Handles interval-based flushing, size thresholds, and graceful shutdown.\n */\nexport class SpanBuffer {\n private _spanTreeMap: Map<string, Set<SpanV2JSONWithSegmentRef>>;\n private _flushIntervalId: ReturnType<typeof setInterval> | null;\n private _client: Client;\n private _maxSpanLimit: number;\n private _flushInterval: number;\n\n public constructor(client: Client, options?: SpanBufferOptions) {\n this._spanTreeMap = new Map();\n this._client = client;\n\n const { maxSpanLimit, flushInterval } = options ?? {};\n\n this._maxSpanLimit = maxSpanLimit && maxSpanLimit > 0 && maxSpanLimit <= 1000 ? maxSpanLimit : 1000;\n this._flushInterval = flushInterval && flushInterval > 0 ? flushInterval : 5_000;\n\n this._flushIntervalId = setInterval(() => {\n this.flush();\n }, this._flushInterval);\n\n this._client.on('flush', () => {\n this.flush();\n });\n }\n\n /**\n * Add a span to the buffer.\n */\n public addSpan(spanJSON: SpanV2JSONWithSegmentRef): void {\n const traceId = spanJSON.trace_id;\n let traceBucket = this._spanTreeMap.get(traceId);\n if (traceBucket) {\n traceBucket.add(spanJSON);\n } else {\n traceBucket = new Set([spanJSON]);\n this._spanTreeMap.set(traceId, traceBucket);\n }\n\n if (traceBucket.size >= this._maxSpanLimit) {\n this._flushTrace(traceId);\n this._debounceFlushInterval();\n }\n }\n\n /**\n * Flush all buffered traces.\n */\n public flush(): void {\n if (!this._spanTreeMap.size) {\n return;\n }\n\n DEBUG_BUILD && debug.log(`Flushing span tree map with ${this._spanTreeMap.size} traces`);\n\n this._spanTreeMap.forEach((_, traceId) => {\n this._flushTrace(traceId);\n });\n this._debounceFlushInterval();\n }\n\n private _flushTrace(traceId: string): void {\n const traceBucket = this._spanTreeMap.get(traceId);\n if (!traceBucket) {\n return;\n }\n\n if (!traceBucket.size) {\n this._spanTreeMap.delete(traceId);\n return;\n }\n\n const firstSpanJSON = traceBucket.values().next().value;\n\n const segmentSpan = firstSpanJSON?._segmentSpan;\n if (!segmentSpan) {\n DEBUG_BUILD && debug.warn('No segment span reference found on span JSON, cannot compute DSC');\n this._spanTreeMap.delete(traceId);\n return;\n }\n\n const dsc = getDynamicSamplingContextFromSpan(segmentSpan);\n\n const cleanedSpans: SpanV2JSON[] = Array.from(traceBucket).map(spanJSON => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { _segmentSpan, ...cleanSpanJSON } = spanJSON;\n return cleanSpanJSON;\n });\n\n const envelope = createSpanV2Envelope(cleanedSpans, dsc, this._client);\n\n DEBUG_BUILD && debug.log(`Sending span envelope for trace ${traceId} with ${cleanedSpans.length} spans`);\n\n this._client.sendEnvelope(envelope).then(null, reason => {\n DEBUG_BUILD && debug.error('Error while sending span stream envelope:', reason);\n });\n\n this._spanTreeMap.delete(traceId);\n }\n\n private _debounceFlushInterval(): void {\n if (this._flushIntervalId) {\n clearInterval(this._flushIntervalId);\n }\n this._flushIntervalId = setInterval(() => {\n this.flush();\n }, this._flushInterval);\n }\n}\n"],"names":["DEBUG_BUILD","debug","getDynamicSamplingContextFromSpan","envelope","createSpanV2Envelope"],"mappings":"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"}
|