@@ -513,7 +513,7 @@ describe('SentrySpanProcessor', () => {
513
513
} ) ;
514
514
} ) ;
515
515
516
- it ( 'updates based on attributes for HTTP_METHOD for client' , async ( ) => {
516
+ it ( 'updates based on attributes for deprecated HTTP_METHOD for client' , async ( ) => {
517
517
const tracer = provider . getTracer ( 'default' ) ;
518
518
519
519
tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
@@ -533,7 +533,27 @@ describe('SentrySpanProcessor', () => {
533
533
} ) ;
534
534
} ) ;
535
535
536
- it ( 'updates based on attributes for HTTP_METHOD for server' , async ( ) => {
536
+ it ( 'updates based on attributes for HTTP_REQEUST_METHOD for client' , async ( ) => {
537
+ const tracer = provider . getTracer ( 'default' ) ;
538
+
539
+ tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
540
+ tracer . startActiveSpan ( '/users/all' , { kind : SpanKind . CLIENT } , child => {
541
+ const sentrySpan = getSpanForOtelSpan ( child ) ;
542
+
543
+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
544
+
545
+ child . end ( ) ;
546
+
547
+ // eslint-disable-next-line deprecation/deprecation
548
+ expect ( sentrySpan ?. op ) . toBe ( 'http.client' ) ;
549
+ expect ( spanToJSON ( sentrySpan ! ) . op ) . toBe ( 'http.client' ) ;
550
+
551
+ parentOtelSpan . end ( ) ;
552
+ } ) ;
553
+ } ) ;
554
+ } ) ;
555
+
556
+ it ( 'updates based on attributes for deprecated HTTP_METHOD for server' , async ( ) => {
537
557
const tracer = provider . getTracer ( 'default' ) ;
538
558
539
559
tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
@@ -553,14 +573,34 @@ describe('SentrySpanProcessor', () => {
553
573
} ) ;
554
574
} ) ;
555
575
556
- it ( 'updates op/description based on attributes for HTTP_METHOD without HTTP_ROUTE' , async ( ) => {
576
+ it ( 'updates based on attributes for HTTP_REQUEST_METHOD for server' , async ( ) => {
577
+ const tracer = provider . getTracer ( 'default' ) ;
578
+
579
+ tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
580
+ tracer . startActiveSpan ( '/users/all' , { kind : SpanKind . SERVER } , child => {
581
+ const sentrySpan = getSpanForOtelSpan ( child ) ;
582
+
583
+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
584
+
585
+ child . end ( ) ;
586
+
587
+ // eslint-disable-next-line deprecation/deprecation
588
+ expect ( sentrySpan ?. op ) . toBe ( 'http.server' ) ;
589
+ expect ( spanToJSON ( sentrySpan ! ) . op ) . toBe ( 'http.server' ) ;
590
+
591
+ parentOtelSpan . end ( ) ;
592
+ } ) ;
593
+ } ) ;
594
+ } ) ;
595
+
596
+ it ( 'updates op/description based on attributes for HTTP_REQUEST_METHOD without HTTP_ROUTE' , async ( ) => {
557
597
const tracer = provider . getTracer ( 'default' ) ;
558
598
559
599
tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
560
600
tracer . startActiveSpan ( 'HTTP GET' , child => {
561
601
const sentrySpan = getSpanForOtelSpan ( child ) ;
562
602
563
- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
603
+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
564
604
565
605
child . end ( ) ;
566
606
@@ -571,14 +611,14 @@ describe('SentrySpanProcessor', () => {
571
611
} ) ;
572
612
} ) ;
573
613
574
- it ( 'updates based on attributes for HTTP_METHOD with HTTP_ROUTE' , async ( ) => {
614
+ it ( 'updates based on attributes for HTTP_REQUEST_METHOD with HTTP_ROUTE' , async ( ) => {
575
615
const tracer = provider . getTracer ( 'default' ) ;
576
616
577
617
tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
578
618
tracer . startActiveSpan ( 'HTTP GET' , child => {
579
619
const sentrySpan = getSpanForOtelSpan ( child ) ;
580
620
581
- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
621
+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
582
622
child . setAttribute ( SemanticAttributes . HTTP_ROUTE , '/my/route/{id}' ) ;
583
623
child . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
584
624
child . setAttribute ( SemanticAttributes . HTTP_URL , 'http://example.com/my/route/123' ) ;
@@ -604,14 +644,14 @@ describe('SentrySpanProcessor', () => {
604
644
} ) ;
605
645
} ) ;
606
646
607
- it ( 'updates based on attributes for HTTP_METHOD with HTTP_TARGET' , async ( ) => {
647
+ it ( 'updates based on attributes for HTTP_REQUEST_METHOD with HTTP_TARGET' , async ( ) => {
608
648
const tracer = provider . getTracer ( 'default' ) ;
609
649
610
650
tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
611
651
tracer . startActiveSpan ( 'HTTP GET' , child => {
612
652
const sentrySpan = getSpanForOtelSpan ( child ) ;
613
653
614
- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
654
+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
615
655
child . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
616
656
child . setAttribute ( SemanticAttributes . HTTP_URL , 'http://example.com/my/route/123' ) ;
617
657
@@ -643,7 +683,7 @@ describe('SentrySpanProcessor', () => {
643
683
tracer . startActiveSpan ( 'HTTP GET' , child => {
644
684
const sentrySpan = getSpanForOtelSpan ( child ) ;
645
685
646
- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
686
+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
647
687
child . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
648
688
child . setAttribute ( SemanticAttributes . HTTP_URL , 'http://example.com/my/route/123?what=123#myHash' ) ;
649
689
@@ -676,7 +716,7 @@ describe('SentrySpanProcessor', () => {
676
716
tracer . startActiveSpan ( 'GET /users' , otelSpan => {
677
717
const sentrySpan = getSpanForOtelSpan ( otelSpan ) ;
678
718
679
- otelSpan . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
719
+ otelSpan . setAttribute ( 'http.request.method' , 'GET' ) ;
680
720
otelSpan . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
681
721
682
722
otelSpan . end ( ) ;
@@ -692,7 +732,7 @@ describe('SentrySpanProcessor', () => {
692
732
tracer . startActiveSpan ( 'GET /' , otelSpan => {
693
733
const sentrySpan = getSpanForOtelSpan ( otelSpan ) ;
694
734
695
- otelSpan . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
735
+ otelSpan . setAttribute ( 'http.request.method' , 'GET' ) ;
696
736
otelSpan . setAttribute ( SemanticAttributes . HTTP_TARGET , '/' ) ;
697
737
698
738
otelSpan . end ( ) ;
@@ -708,7 +748,7 @@ describe('SentrySpanProcessor', () => {
708
748
tracer . startActiveSpan ( 'GET /users' , otelSpan => {
709
749
const sentrySpan = getSpanForOtelSpan ( otelSpan ) ;
710
750
711
- otelSpan . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
751
+ otelSpan . setAttribute ( 'http.request.method' , 'GET' ) ;
712
752
otelSpan . setAttribute ( SemanticAttributes . HTTP_ROUTE , '/my/route/:id' ) ;
713
753
714
754
otelSpan . end ( ) ;
0 commit comments