@sentry/core 10.31.0 → 10.32.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/attributes.js +98 -0
- package/build/cjs/attributes.js.map +1 -0
- package/build/cjs/client.js +11 -6
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/envelope.js +41 -7
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/index.js +29 -0
- 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/mcp-server/correlation.js +17 -3
- package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
- package/build/cjs/integrations/mcp-server/sessionExtraction.js +44 -0
- package/build/cjs/integrations/mcp-server/sessionExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/transport.js +17 -3
- package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
- package/build/cjs/integrations/requestdata.js +72 -6
- package/build/cjs/integrations/requestdata.js.map +1 -1
- package/build/cjs/integrations/serverSpanStreaming.js +51 -0
- package/build/cjs/integrations/serverSpanStreaming.js.map +1 -0
- package/build/cjs/semanticAttributes.js +36 -0
- package/build/cjs/semanticAttributes.js.map +1 -1
- package/build/cjs/spans/captureSpan.js +107 -0
- package/build/cjs/spans/captureSpan.js.map +1 -0
- package/build/cjs/spans/spanBuffer.js +117 -0
- package/build/cjs/spans/spanBuffer.js.map +1 -0
- package/build/cjs/spans/spanFirstUtils.js +187 -0
- package/build/cjs/spans/spanFirstUtils.js.map +1 -0
- package/build/cjs/tracing/sentrySpan.js +31 -0
- package/build/cjs/tracing/sentrySpan.js.map +1 -1
- package/build/cjs/tracing/trace.js +1 -0
- package/build/cjs/tracing/trace.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/index.js +1 -0
- package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
- package/build/cjs/utils/applyScopeDataToEvent.js +5 -0
- package/build/cjs/utils/applyScopeDataToEvent.js.map +1 -1
- package/build/cjs/utils/beforeSendSpan.js +36 -0
- package/build/cjs/utils/beforeSendSpan.js.map +1 -0
- package/build/cjs/utils/featureFlags.js +1 -0
- package/build/cjs/utils/featureFlags.js.map +1 -1
- package/build/cjs/utils/should-ignore-span.js +31 -9
- package/build/cjs/utils/should-ignore-span.js.map +1 -1
- package/build/cjs/utils/spanUtils.js +101 -2
- 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 +95 -0
- package/build/esm/attributes.js.map +1 -0
- package/build/esm/client.js +6 -1
- package/build/esm/client.js.map +1 -1
- package/build/esm/envelope.js +41 -8
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/index.js +9 -3
- 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/mcp-server/correlation.js +17 -3
- package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
- package/build/esm/integrations/mcp-server/sessionExtraction.js +43 -1
- package/build/esm/integrations/mcp-server/sessionExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/transport.js +18 -4
- package/build/esm/integrations/mcp-server/transport.js.map +1 -1
- package/build/esm/integrations/requestdata.js +72 -6
- package/build/esm/integrations/requestdata.js.map +1 -1
- package/build/esm/integrations/serverSpanStreaming.js +49 -0
- package/build/esm/integrations/serverSpanStreaming.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/semanticAttributes.js +26 -1
- package/build/esm/semanticAttributes.js.map +1 -1
- package/build/esm/spans/captureSpan.js +105 -0
- package/build/esm/spans/captureSpan.js.map +1 -0
- package/build/esm/spans/spanBuffer.js +115 -0
- package/build/esm/spans/spanBuffer.js.map +1 -0
- package/build/esm/spans/spanFirstUtils.js +183 -0
- package/build/esm/spans/spanFirstUtils.js.map +1 -0
- package/build/esm/tracing/sentrySpan.js +32 -1
- package/build/esm/tracing/sentrySpan.js.map +1 -1
- package/build/esm/tracing/trace.js +1 -0
- package/build/esm/tracing/trace.js.map +1 -1
- package/build/esm/tracing/vercel-ai/index.js +1 -0
- package/build/esm/tracing/vercel-ai/index.js.map +1 -1
- package/build/esm/utils/applyScopeDataToEvent.js +5 -0
- package/build/esm/utils/applyScopeDataToEvent.js.map +1 -1
- package/build/esm/utils/beforeSendSpan.js +33 -0
- package/build/esm/utils/beforeSendSpan.js.map +1 -0
- package/build/esm/utils/featureFlags.js +1 -0
- package/build/esm/utils/featureFlags.js.map +1 -1
- package/build/esm/utils/should-ignore-span.js +31 -9
- package/build/esm/utils/should-ignore-span.js.map +1 -1
- package/build/esm/utils/spanUtils.js +97 -3
- 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 +2 -2
- package/build/types/attributes.d.ts.map +1 -1
- package/build/types/client.d.ts +40 -2
- package/build/types/client.d.ts.map +1 -1
- package/build/types/envelope.d.ts +6 -1
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/index.d.ts +10 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/correlation.d.ts +2 -2
- package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/sessionExtraction.d.ts +13 -1
- package/build/types/integrations/mcp-server/sessionExtraction.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/transport.d.ts.map +1 -1
- package/build/types/integrations/requestdata.d.ts.map +1 -1
- package/build/types/integrations/serverSpanStreaming.d.ts +8 -0
- package/build/types/integrations/serverSpanStreaming.d.ts.map +1 -0
- package/build/types/semanticAttributes.d.ts +21 -0
- package/build/types/semanticAttributes.d.ts.map +1 -1
- package/build/types/spans/captureSpan.d.ts +10 -0
- package/build/types/spans/captureSpan.d.ts.map +1 -0
- package/build/types/spans/spanBuffer.d.ts +31 -0
- package/build/types/spans/spanBuffer.d.ts.map +1 -0
- package/build/types/spans/spanFirstUtils.d.ts +20 -0
- package/build/types/spans/spanFirstUtils.d.ts.map +1 -0
- package/build/types/tracing/sentrySpan.d.ts +10 -1
- 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/attributes.d.ts +19 -0
- package/build/types/types-hoist/attributes.d.ts.map +1 -0
- package/build/types/types-hoist/envelope.d.ts +22 -2
- package/build/types/types-hoist/envelope.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/options.d.ts +18 -2
- package/build/types/types-hoist/options.d.ts.map +1 -1
- package/build/types/types-hoist/span.d.ts +27 -0
- package/build/types/types-hoist/span.d.ts.map +1 -1
- package/build/types/utils/applyScopeDataToEvent.d.ts.map +1 -1
- package/build/types/utils/beforeSendSpan.d.ts +22 -0
- package/build/types/utils/beforeSendSpan.d.ts.map +1 -0
- package/build/types/utils/featureFlags.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 +26 -2
- package/build/types/utils/spanUtils.d.ts.map +1 -1
- package/build/types-ts3.8/attributes.d.ts +2 -2
- package/build/types-ts3.8/client.d.ts +40 -2
- package/build/types-ts3.8/envelope.d.ts +6 -1
- package/build/types-ts3.8/index.d.ts +10 -4
- package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +2 -2
- package/build/types-ts3.8/integrations/mcp-server/sessionExtraction.d.ts +13 -1
- package/build/types-ts3.8/integrations/serverSpanStreaming.d.ts +8 -0
- package/build/types-ts3.8/semanticAttributes.d.ts +21 -0
- package/build/types-ts3.8/spans/captureSpan.d.ts +10 -0
- package/build/types-ts3.8/spans/spanBuffer.d.ts +31 -0
- package/build/types-ts3.8/spans/spanFirstUtils.d.ts +20 -0
- package/build/types-ts3.8/tracing/sentrySpan.d.ts +10 -1
- package/build/types-ts3.8/types-hoist/attributes.d.ts +19 -0
- package/build/types-ts3.8/types-hoist/envelope.d.ts +22 -2
- package/build/types-ts3.8/types-hoist/link.d.ts +2 -2
- package/build/types-ts3.8/types-hoist/options.d.ts +18 -2
- package/build/types-ts3.8/types-hoist/span.d.ts +27 -0
- package/build/types-ts3.8/utils/beforeSendSpan.d.ts +22 -0
- package/build/types-ts3.8/utils/should-ignore-span.d.ts +3 -3
- package/build/types-ts3.8/utils/spanUtils.d.ts +26 -2
- package/package.json +1 -1
|
@@ -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 { SpanJSON } from './span';
|
|
14
|
+
import { SerializedSpanContainer, SpanJSON } from './span';
|
|
15
15
|
export type DynamicSamplingContext = {
|
|
16
16
|
trace_id: string;
|
|
17
17
|
public_key: DsnComponents['publicKey'];
|
|
@@ -87,6 +87,21 @@ 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
|
+
};
|
|
90
105
|
type LogContainerItemHeaders = {
|
|
91
106
|
type: 'log';
|
|
92
107
|
/**
|
|
@@ -120,6 +135,7 @@ export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
|
|
|
120
135
|
export type ProfileItem = BaseEnvelopeItem<ProfileItemHeaders, Profile>;
|
|
121
136
|
export type ProfileChunkItem = BaseEnvelopeItem<ProfileChunkItemHeaders, ProfileChunk>;
|
|
122
137
|
export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Partial<SpanJSON>>;
|
|
138
|
+
export type SpanContainerItem = BaseEnvelopeItem<SpanContainerItemHeaders, SerializedSpanContainer>;
|
|
123
139
|
export type LogContainerItem = BaseEnvelopeItem<LogContainerItemHeaders, SerializedLogContainer>;
|
|
124
140
|
export type MetricContainerItem = BaseEnvelopeItem<MetricContainerItemHeaders, SerializedMetricContainer>;
|
|
125
141
|
export type RawSecurityItem = BaseEnvelopeItem<RawSecurityHeaders, LegacyCSPReport>;
|
|
@@ -139,6 +155,9 @@ type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
|
|
|
139
155
|
type SpanEnvelopeHeaders = BaseEnvelopeHeaders & {
|
|
140
156
|
trace?: DynamicSamplingContext;
|
|
141
157
|
};
|
|
158
|
+
type SpanV2EnvelopeHeaders = BaseEnvelopeHeaders & {
|
|
159
|
+
trace?: DynamicSamplingContext;
|
|
160
|
+
};
|
|
142
161
|
type LogEnvelopeHeaders = BaseEnvelopeHeaders;
|
|
143
162
|
type MetricEnvelopeHeaders = BaseEnvelopeHeaders;
|
|
144
163
|
export type EventEnvelope = BaseEnvelope<EventEnvelopeHeaders, EventItem | AttachmentItem | UserFeedbackItem | FeedbackItem | ProfileItem>;
|
|
@@ -153,11 +172,12 @@ export type ReplayEnvelope = [
|
|
|
153
172
|
];
|
|
154
173
|
export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
|
|
155
174
|
export type SpanEnvelope = BaseEnvelope<SpanEnvelopeHeaders, SpanItem>;
|
|
175
|
+
export type SpanV2Envelope = BaseEnvelope<SpanV2EnvelopeHeaders, SpanContainerItem>;
|
|
156
176
|
export type ProfileChunkEnvelope = BaseEnvelope<BaseEnvelopeHeaders, ProfileChunkItem>;
|
|
157
177
|
export type RawSecurityEnvelope = BaseEnvelope<BaseEnvelopeHeaders, RawSecurityItem>;
|
|
158
178
|
export type LogEnvelope = BaseEnvelope<LogEnvelopeHeaders, LogContainerItem>;
|
|
159
179
|
export type MetricEnvelope = BaseEnvelope<MetricEnvelopeHeaders, MetricContainerItem>;
|
|
160
|
-
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | SpanEnvelope | RawSecurityEnvelope | LogEnvelope | MetricEnvelope;
|
|
180
|
+
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | SpanEnvelope | SpanV2Envelope | RawSecurityEnvelope | LogEnvelope | MetricEnvelope;
|
|
161
181
|
export type EnvelopeItem = Envelope[1][number];
|
|
162
182
|
export {};
|
|
163
183
|
//# 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 extends Record<string, unknown> {
|
|
22
|
+
export interface SpanLinkJSON<TAttributes = SpanLinkAttributes> extends Record<string, unknown> {
|
|
23
23
|
span_id: string;
|
|
24
24
|
trace_id: string;
|
|
25
25
|
sampled?: boolean;
|
|
26
|
-
attributes?:
|
|
26
|
+
attributes?: TAttributes;
|
|
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 } from './span';
|
|
9
|
+
import { SpanJSON, SpanV2JSON } from './span';
|
|
10
10
|
import { StackLineParser, StackParser } from './stacktrace';
|
|
11
11
|
import { TracePropagationTargets } from './tracing';
|
|
12
12
|
import { BaseTransportOptions, Transport } from './transport';
|
|
@@ -356,6 +356,15 @@ 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';
|
|
359
368
|
/**
|
|
360
369
|
* The organization ID for your Sentry project.
|
|
361
370
|
*
|
|
@@ -432,7 +441,7 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
432
441
|
*
|
|
433
442
|
* @returns The modified span payload that will be sent.
|
|
434
443
|
*/
|
|
435
|
-
beforeSendSpan?: (span: SpanJSON) => SpanJSON;
|
|
444
|
+
beforeSendSpan?: ((span: SpanJSON) => SpanJSON) | SpanV2CompatibleBeforeSendSpanCallback;
|
|
436
445
|
/**
|
|
437
446
|
* An event-processing callback for transaction events, guaranteed to be invoked after all other event
|
|
438
447
|
* processors. This allows an event to be modified or dropped before it's sent.
|
|
@@ -458,6 +467,13 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
458
467
|
*/
|
|
459
468
|
beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
|
|
460
469
|
}
|
|
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
|
+
};
|
|
461
477
|
/** Base configuration options for every SDK. */
|
|
462
478
|
export interface CoreOptions<TO extends BaseTransportOptions = BaseTransportOptions> extends Pick<Partial<ClientOptions<TO>>, Exclude<keyof Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'>> {
|
|
463
479
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TypedAttributes } from '../attributes';
|
|
1
2
|
import { SpanLink, SpanLinkJSON } from './link';
|
|
2
3
|
import { Measurements } from './measurement';
|
|
3
4
|
import { HrTime } from './opentelemetry';
|
|
@@ -17,6 +18,32 @@ export type SpanAttributes = Partial<{
|
|
|
17
18
|
}> & Record<string, SpanAttributeValue | undefined>;
|
|
18
19
|
/** This type is aligned with the OpenTelemetry TimeInput type. */
|
|
19
20
|
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
|
+
};
|
|
20
47
|
/** A JSON representation of a span. */
|
|
21
48
|
export interface SpanJSON {
|
|
22
49
|
data: SpanAttributes;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ClientOptions, SpanV2CompatibleBeforeSendSpanCallback } from '../types-hoist/options';
|
|
2
|
+
import { SpanV2JSON } from '../types-hoist/span';
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper to use the new span format in your `beforeSendSpan` callback.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* Sentry.init({
|
|
9
|
+
* beforeSendSpan: withStreamSpan((span) => {
|
|
10
|
+
* return span;
|
|
11
|
+
* }),
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* @param callback
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function withStreamSpan(callback: (span: SpanV2JSON) => SpanV2JSON): SpanV2CompatibleBeforeSendSpanCallback;
|
|
18
|
+
/**
|
|
19
|
+
* Typesafe check to identify the expected span json format of the `beforeSendSpan` callback.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isV2BeforeSendSpanCallback(callback: ClientOptions['beforeSendSpan']): callback is SpanV2CompatibleBeforeSendSpanCallback;
|
|
22
|
+
//# sourceMappingURL=beforeSendSpan.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ClientOptions } from '../types-hoist/options';
|
|
2
|
-
import { SpanJSON } from '../types-hoist/span';
|
|
2
|
+
import { SpanJSON, SpanV2JSON } 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'>, ignoreSpans: Required<ClientOptions>['ignoreSpans']): boolean;
|
|
6
|
+
export declare function shouldIgnoreSpan(span: Pick<SpanJSON, 'description' | 'op'> | Pick<SpanV2JSON, 'name' | 'attributes'>, 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: Pick<SpanV2JSON, 'parent_span_id' | 'span_id'>[], dropSpan: Pick<SpanV2JSON, 'parent_span_id' | 'span_id'>): void;
|
|
12
12
|
//# sourceMappingURL=should-ignore-span.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { TypedAttributes } from '../attributes';
|
|
1
2
|
import { TraceContext } from '../types-hoist/context';
|
|
2
3
|
import { SpanLink, SpanLinkJSON } from '../types-hoist/link';
|
|
3
|
-
import { Span, SpanAttributes, SpanJSON, SpanTimeInput } from '../types-hoist/span';
|
|
4
|
+
import { Span, SpanAttributes, SpanJSON, SpanTimeInput, SpanV2JSON } from '../types-hoist/span';
|
|
4
5
|
import { SpanStatus } from '../types-hoist/spanStatus';
|
|
5
6
|
export declare const TRACE_FLAG_NONE = 0;
|
|
6
7
|
export declare const TRACE_FLAG_SAMPLED = 1;
|
|
@@ -28,6 +29,12 @@ export declare function spanToTraceparentHeader(span: Span): string;
|
|
|
28
29
|
* If the links array is empty, it returns `undefined` so the empty value can be dropped before it's sent.
|
|
29
30
|
*/
|
|
30
31
|
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;
|
|
31
38
|
/**
|
|
32
39
|
* Convert a span time input into a timestamp in seconds.
|
|
33
40
|
*/
|
|
@@ -36,6 +43,11 @@ export declare function spanTimeInputToSeconds(input: SpanTimeInput | undefined)
|
|
|
36
43
|
* Convert a span to a JSON representation.
|
|
37
44
|
*/
|
|
38
45
|
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;
|
|
39
51
|
/** Exported only for tests. */
|
|
40
52
|
export interface OpenTelemetrySdkTraceBaseSpan extends Span {
|
|
41
53
|
attributes: SpanAttributes;
|
|
@@ -55,6 +67,14 @@ export interface OpenTelemetrySdkTraceBaseSpan extends Span {
|
|
|
55
67
|
export declare function spanIsSampled(span: Span): boolean;
|
|
56
68
|
/** Get the status message to use for a JSON representation of a span. */
|
|
57
69
|
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;
|
|
58
78
|
declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
|
|
59
79
|
declare const ROOT_SPAN_FIELD = "_sentryRootSpan";
|
|
60
80
|
type SpanWithPotentialChildren = Span & {
|
|
@@ -74,7 +94,11 @@ export declare function getSpanDescendants(span: SpanWithPotentialChildren): Spa
|
|
|
74
94
|
/**
|
|
75
95
|
* Returns the root span of a given span.
|
|
76
96
|
*/
|
|
77
|
-
export declare
|
|
97
|
+
export declare const getRootSpan: typeof INTERNAL_getSegmentSpan;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the segment span of a given span.
|
|
100
|
+
*/
|
|
101
|
+
export declare function INTERNAL_getSegmentSpan(span: SpanWithPotentialChildren): Span;
|
|
78
102
|
/**
|
|
79
103
|
* Returns the currently active span.
|
|
80
104
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/core",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.32.0-alpha.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",
|