@@ -8,6 +8,7 @@ import type { Profile } from './profiling';
88import type { ReplayEvent , ReplayRecordingData } from './replay' ;
99import type { SdkInfo } from './sdkinfo' ;
1010import type { SerializedSession , Session , SessionAggregates } from './session' ;
11+ import type { Span } from './span' ;
1112
1213// Based on: https://develop.sentry.dev/sdk/envelopes/
1314
@@ -36,7 +37,8 @@ export type EnvelopeItemType =
3637 | 'replay_event'
3738 | 'replay_recording'
3839 | 'check_in'
39- | 'statsd' ;
40+ | 'statsd'
41+ | 'span' ;
4042
4143export type BaseEnvelopeHeaders = {
4244 [ key : string ] : unknown ;
@@ -77,6 +79,7 @@ type ReplayRecordingItemHeaders = { type: 'replay_recording'; length: number };
7779type CheckInItemHeaders = { type : 'check_in' } ;
7880type StatsdItemHeaders = { type : 'statsd' ; length : number } ;
7981type ProfileItemHeaders = { type : 'profile' } ;
82+ type SpanItemHeaders = { type : 'span' } ;
8083
8184// TODO (v8): Replace `Event` with `SerializedEvent`
8285export type EventItem = BaseEnvelopeItem < EventItemHeaders , Event > ;
@@ -93,13 +96,15 @@ type ReplayRecordingItem = BaseEnvelopeItem<ReplayRecordingItemHeaders, ReplayRe
9396export type StatsdItem = BaseEnvelopeItem < StatsdItemHeaders , string > ;
9497export type FeedbackItem = BaseEnvelopeItem < FeedbackItemHeaders , FeedbackEvent > ;
9598export type ProfileItem = BaseEnvelopeItem < ProfileItemHeaders , Profile > ;
99+ export type SpanItem = BaseEnvelopeItem < SpanItemHeaders , Span > ;
96100
97101export type EventEnvelopeHeaders = { event_id : string ; sent_at : string ; trace ?: DynamicSamplingContext } ;
98102type SessionEnvelopeHeaders = { sent_at : string } ;
99103type CheckInEnvelopeHeaders = { trace ?: DynamicSamplingContext } ;
100104type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders ;
101105type ReplayEnvelopeHeaders = BaseEnvelopeHeaders ;
102106type StatsdEnvelopeHeaders = BaseEnvelopeHeaders ;
107+ type SpanEnvelopeHeaders = BaseEnvelopeHeaders ;
103108
104109export type EventEnvelope = BaseEnvelope <
105110 EventEnvelopeHeaders ,
@@ -110,12 +115,14 @@ export type ClientReportEnvelope = BaseEnvelope<ClientReportEnvelopeHeaders, Cli
110115export type ReplayEnvelope = [ ReplayEnvelopeHeaders , [ ReplayEventItem , ReplayRecordingItem ] ] ;
111116export type CheckInEnvelope = BaseEnvelope < CheckInEnvelopeHeaders , CheckInItem > ;
112117export type StatsdEnvelope = BaseEnvelope < StatsdEnvelopeHeaders , StatsdItem > ;
118+ export type SpanEnvelope = BaseEnvelope < SpanEnvelopeHeaders , SpanItem > ;
113119
114120export type Envelope =
115121 | EventEnvelope
116122 | SessionEnvelope
117123 | ClientReportEnvelope
118124 | ReplayEnvelope
119125 | CheckInEnvelope
120- | StatsdEnvelope ;
126+ | StatsdEnvelope
127+ | SpanEnvelope ;
121128export type EnvelopeItem = Envelope [ 1 ] [ number ] ;
0 commit comments