@@ -93,6 +93,8 @@ describe('SentrySpanProcessor', () => {
9393 expect ( spanToJSON ( sentrySpanTransaction ! ) . description ) . toBe ( 'GET /users' ) ;
9494 expect ( spanToJSON ( sentrySpanTransaction ! ) . start_timestamp ) . toEqual ( startTimestampMs / 1000 ) ;
9595 expect ( sentrySpanTransaction ?. spanContext ( ) . traceId ) . toEqual ( otelSpan . spanContext ( ) . traceId ) ;
96+ expect ( spanToJSON ( sentrySpanTransaction ! ) . parent_span_id ) . toEqual ( otelSpan . parentSpanId ) ;
97+ // eslint-disable-next-line deprecation/deprecation
9698 expect ( sentrySpanTransaction ?. parentSpanId ) . toEqual ( otelSpan . parentSpanId ) ;
9799 expect ( sentrySpanTransaction ?. spanContext ( ) . spanId ) . toEqual ( otelSpan . spanContext ( ) . spanId ) ;
98100
@@ -121,6 +123,9 @@ describe('SentrySpanProcessor', () => {
121123 expect ( sentrySpan ? spanToJSON ( sentrySpan ) . description : undefined ) . toBe ( 'SELECT * FROM users;' ) ;
122124 expect ( spanToJSON ( sentrySpan ! ) . start_timestamp ) . toEqual ( startTimestampMs / 1000 ) ;
123125 expect ( sentrySpan ?. spanContext ( ) . spanId ) . toEqual ( childOtelSpan . spanContext ( ) . spanId ) ;
126+
127+ expect ( spanToJSON ( sentrySpan ! ) . parent_span_id ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
128+ // eslint-disable-next-line deprecation/deprecation
124129 expect ( sentrySpan ?. parentSpanId ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
125130
126131 // eslint-disable-next-line deprecation/deprecation
@@ -162,6 +167,9 @@ describe('SentrySpanProcessor', () => {
162167 expect ( spanToJSON ( sentrySpan ! ) . description ) . toBe ( 'SELECT * FROM users;' ) ;
163168 expect ( spanToJSON ( sentrySpan ! ) . start_timestamp ) . toEqual ( startTimestampMs / 1000 ) ;
164169 expect ( sentrySpan ?. spanContext ( ) . spanId ) . toEqual ( childOtelSpan . spanContext ( ) . spanId ) ;
170+
171+ expect ( spanToJSON ( sentrySpan ! ) . parent_span_id ) . toEqual ( parentOtelSpan . spanContext ( ) . spanId ) ;
172+ // eslint-disable-next-line deprecation/deprecation
165173 expect ( sentrySpan ?. parentSpanId ) . toEqual ( parentOtelSpan . spanContext ( ) . spanId ) ;
166174
167175 // eslint-disable-next-line deprecation/deprecation
@@ -194,8 +202,16 @@ describe('SentrySpanProcessor', () => {
194202 const sentrySpan2 = getSpanForOtelSpan ( span2 ) ;
195203 const sentrySpan3 = getSpanForOtelSpan ( span3 ) ;
196204
205+ expect ( spanToJSON ( sentrySpan1 ! ) . parent_span_id ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
206+ // eslint-disable-next-line deprecation/deprecation
197207 expect ( sentrySpan1 ?. parentSpanId ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
208+
209+ expect ( spanToJSON ( sentrySpan2 ! ) . parent_span_id ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
210+ // eslint-disable-next-line deprecation/deprecation
198211 expect ( sentrySpan2 ?. parentSpanId ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
212+
213+ expect ( spanToJSON ( sentrySpan3 ! ) . parent_span_id ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
214+ // eslint-disable-next-line deprecation/deprecation
199215 expect ( sentrySpan3 ?. parentSpanId ) . toEqual ( sentrySpanTransaction ?. spanContext ( ) . spanId ) ;
200216
201217 expect ( spanToJSON ( sentrySpan1 ! ) . description ) . toEqual ( 'SELECT * FROM users;' ) ;
@@ -255,7 +271,14 @@ describe('SentrySpanProcessor', () => {
255271 expect ( childSpan ) . toBeInstanceOf ( Transaction ) ;
256272 expect ( spanToJSON ( parentSpan ! ) . timestamp ) . toBeDefined ( ) ;
257273 expect ( spanToJSON ( childSpan ! ) . timestamp ) . toBeDefined ( ) ;
274+ expect ( spanToJSON ( parentSpan ! ) . parent_span_id ) . toBeUndefined ( ) ;
275+
276+ expect ( spanToJSON ( parentSpan ! ) . parent_span_id ) . toBeUndefined ( ) ;
277+ // eslint-disable-next-line deprecation/deprecation
258278 expect ( parentSpan ?. parentSpanId ) . toBeUndefined ( ) ;
279+
280+ expect ( spanToJSON ( childSpan ! ) . parent_span_id ) . toEqual ( parentSpan ?. spanContext ( ) . spanId ) ;
281+ // eslint-disable-next-line deprecation/deprecation
259282 expect ( childSpan ?. parentSpanId ) . toEqual ( parentSpan ?. spanContext ( ) . spanId ) ;
260283 } ) ;
261284 } ) ;
0 commit comments