File tree Expand file tree Collapse file tree
dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageload-updateSpanName Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ sentryTest(
3434 [ SENTRY_OP ] : { type : 'string' , value : 'pageload' } ,
3535 } ) ;
3636
37- expect ( attributes [ SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME ] ) . toEqual ( { type : 'string' , value : 'new name' } ) ;
37+ expect ( attributes [ SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME ] ) . toBeUndefined ( ) ;
3838
3939 expect ( pageloadSpan . name ) . toBe ( 'new name' ) ;
4040
Original file line number Diff line number Diff line change @@ -270,12 +270,16 @@ function getOtelParentSpanId(span: OpenTelemetrySdkTraceBaseSpan): string | unde
270270 * The returned serilaized spans must not be consumed by users or SDK integrations.
271271 */
272272export function streamedSpanJsonToSerializedSpan ( spanJson : StreamedSpanJSON ) : SerializedStreamedSpan {
273+ const attributes = serializeAttributes ( spanJson . attributes ) ;
274+ // oxlint-disable-next-line typescript/no-dynamic-delete
275+ delete attributes [ SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME ] ;
276+
273277 return {
274278 ...spanJson ,
275279 // We only ever send ended spans, but fall back to the start time (i.e. duration 0) so that
276280 // sent spans always carry an end timestamp.
277281 end_timestamp : spanJson . end_timestamp ?? spanJson . start_timestamp ,
278- attributes : serializeAttributes ( spanJson . attributes ) ,
282+ attributes,
279283 links : spanJson . links ?. map ( link => ( {
280284 ...link ,
281285 attributes : serializeAttributes ( link . attributes ) ,
Original file line number Diff line number Diff line change 66 Scope ,
77 SentryNonRecordingSpan ,
88 SentrySpan ,
9+ SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME ,
910 setCurrentClient ,
1011 SPAN_STATUS_ERROR ,
1112 SPAN_STATUS_OK ,
@@ -681,6 +682,7 @@ describe('spanToStaticSpanJSON', () => {
681682 attr2 : 2 ,
682683 attr3 : true ,
683684 attr4 : [ 1 , 2 , 3 ] ,
685+ [ SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME ] : 'test name' ,
684686 [ SENTRY_OP ] : 'test op' ,
685687 [ SENTRY_ORIGIN ] : 'auto' ,
686688 } ,
You can’t perform that action at this time.
0 commit comments