@@ -7,6 +7,7 @@ import type { Profile } from './profiling';
77import type { ReplayEvent , ReplayRecordingData } from './replay' ;
88import type { SdkInfo } from './sdkinfo' ;
99import type { SerializedSession , Session , SessionAggregates } from './session' ;
10+ import type { Span } from './span' ;
1011import type { Transaction } from './transaction' ;
1112import type { UserFeedback } from './user' ;
1213
@@ -41,7 +42,8 @@ export type EnvelopeItemType =
4142 | 'replay_event'
4243 | 'replay_recording'
4344 | 'check_in'
44- | 'statsd' ;
45+ | 'statsd'
46+ | 'span' ;
4547
4648export type BaseEnvelopeHeaders = {
4749 [ key : string ] : unknown ;
@@ -82,6 +84,7 @@ type ReplayRecordingItemHeaders = { type: 'replay_recording'; length: number };
8284type CheckInItemHeaders = { type : 'check_in' } ;
8385type StatsdItemHeaders = { type : 'statsd' ; length : number } ;
8486type ProfileItemHeaders = { type : 'profile' } ;
87+ type SpanItemHeaders = { type : 'span' } ;
8588
8689// TODO (v8): Replace `Event` with `SerializedEvent`
8790export type EventItem = BaseEnvelopeItem < EventItemHeaders , Event > ;
@@ -98,13 +101,15 @@ type ReplayRecordingItem = BaseEnvelopeItem<ReplayRecordingItemHeaders, ReplayRe
98101export type StatsdItem = BaseEnvelopeItem < StatsdItemHeaders , string > ;
99102export type FeedbackItem = BaseEnvelopeItem < FeedbackItemHeaders , FeedbackEvent > ;
100103export type ProfileItem = BaseEnvelopeItem < ProfileItemHeaders , Profile > ;
104+ export type SpanItem = BaseEnvelopeItem < SpanItemHeaders , Span > ;
101105
102106export type EventEnvelopeHeaders = { event_id : string ; sent_at : string ; trace ?: DynamicSamplingContext } ;
103107type SessionEnvelopeHeaders = { sent_at : string } ;
104108type CheckInEnvelopeHeaders = { trace ?: DynamicSamplingContext } ;
105109type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders ;
106110type ReplayEnvelopeHeaders = BaseEnvelopeHeaders ;
107111type StatsdEnvelopeHeaders = BaseEnvelopeHeaders ;
112+ type SpanEnvelopeHeaders = BaseEnvelopeHeaders ;
108113
109114export type EventEnvelope = BaseEnvelope <
110115 EventEnvelopeHeaders ,
@@ -115,12 +120,14 @@ export type ClientReportEnvelope = BaseEnvelope<ClientReportEnvelopeHeaders, Cli
115120export type ReplayEnvelope = [ ReplayEnvelopeHeaders , [ ReplayEventItem , ReplayRecordingItem ] ] ;
116121export type CheckInEnvelope = BaseEnvelope < CheckInEnvelopeHeaders , CheckInItem > ;
117122export type StatsdEnvelope = BaseEnvelope < StatsdEnvelopeHeaders , StatsdItem > ;
123+ export type SpanEnvelope = BaseEnvelope < SpanEnvelopeHeaders , SpanItem > ;
118124
119125export type Envelope =
120126 | EventEnvelope
121127 | SessionEnvelope
122128 | ClientReportEnvelope
123129 | ReplayEnvelope
124130 | CheckInEnvelope
125- | StatsdEnvelope ;
131+ | StatsdEnvelope
132+ | SpanEnvelope ;
126133export type EnvelopeItem = Envelope [ 1 ] [ number ] ;
0 commit comments