@@ -513,7 +513,7 @@ describe('SentrySpanProcessor', () => {
513513 } ) ;
514514 } ) ;
515515
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 ( ) => {
517517 const tracer = provider . getTracer ( 'default' ) ;
518518
519519 tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
@@ -533,7 +533,27 @@ describe('SentrySpanProcessor', () => {
533533 } ) ;
534534 } ) ;
535535
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 ( ) => {
537557 const tracer = provider . getTracer ( 'default' ) ;
538558
539559 tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
@@ -553,14 +573,34 @@ describe('SentrySpanProcessor', () => {
553573 } ) ;
554574 } ) ;
555575
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 ( ) => {
557597 const tracer = provider . getTracer ( 'default' ) ;
558598
559599 tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
560600 tracer . startActiveSpan ( 'HTTP GET' , child => {
561601 const sentrySpan = getSpanForOtelSpan ( child ) ;
562602
563- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
603+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
564604
565605 child . end ( ) ;
566606
@@ -571,14 +611,14 @@ describe('SentrySpanProcessor', () => {
571611 } ) ;
572612 } ) ;
573613
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 ( ) => {
575615 const tracer = provider . getTracer ( 'default' ) ;
576616
577617 tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
578618 tracer . startActiveSpan ( 'HTTP GET' , child => {
579619 const sentrySpan = getSpanForOtelSpan ( child ) ;
580620
581- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
621+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
582622 child . setAttribute ( SemanticAttributes . HTTP_ROUTE , '/my/route/{id}' ) ;
583623 child . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
584624 child . setAttribute ( SemanticAttributes . HTTP_URL , 'http://example.com/my/route/123' ) ;
@@ -604,14 +644,14 @@ describe('SentrySpanProcessor', () => {
604644 } ) ;
605645 } ) ;
606646
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 ( ) => {
608648 const tracer = provider . getTracer ( 'default' ) ;
609649
610650 tracer . startActiveSpan ( 'GET /users' , parentOtelSpan => {
611651 tracer . startActiveSpan ( 'HTTP GET' , child => {
612652 const sentrySpan = getSpanForOtelSpan ( child ) ;
613653
614- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
654+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
615655 child . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
616656 child . setAttribute ( SemanticAttributes . HTTP_URL , 'http://example.com/my/route/123' ) ;
617657
@@ -643,7 +683,7 @@ describe('SentrySpanProcessor', () => {
643683 tracer . startActiveSpan ( 'HTTP GET' , child => {
644684 const sentrySpan = getSpanForOtelSpan ( child ) ;
645685
646- child . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
686+ child . setAttribute ( 'http.request.method' , 'GET' ) ;
647687 child . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
648688 child . setAttribute ( SemanticAttributes . HTTP_URL , 'http://example.com/my/route/123?what=123#myHash' ) ;
649689
@@ -676,7 +716,7 @@ describe('SentrySpanProcessor', () => {
676716 tracer . startActiveSpan ( 'GET /users' , otelSpan => {
677717 const sentrySpan = getSpanForOtelSpan ( otelSpan ) ;
678718
679- otelSpan . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
719+ otelSpan . setAttribute ( 'http.request.method' , 'GET' ) ;
680720 otelSpan . setAttribute ( SemanticAttributes . HTTP_TARGET , '/my/route/123' ) ;
681721
682722 otelSpan . end ( ) ;
@@ -692,7 +732,7 @@ describe('SentrySpanProcessor', () => {
692732 tracer . startActiveSpan ( 'GET /' , otelSpan => {
693733 const sentrySpan = getSpanForOtelSpan ( otelSpan ) ;
694734
695- otelSpan . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
735+ otelSpan . setAttribute ( 'http.request.method' , 'GET' ) ;
696736 otelSpan . setAttribute ( SemanticAttributes . HTTP_TARGET , '/' ) ;
697737
698738 otelSpan . end ( ) ;
@@ -708,7 +748,7 @@ describe('SentrySpanProcessor', () => {
708748 tracer . startActiveSpan ( 'GET /users' , otelSpan => {
709749 const sentrySpan = getSpanForOtelSpan ( otelSpan ) ;
710750
711- otelSpan . setAttribute ( SemanticAttributes . HTTP_METHOD , 'GET' ) ;
751+ otelSpan . setAttribute ( 'http.request.method' , 'GET' ) ;
712752 otelSpan . setAttribute ( SemanticAttributes . HTTP_ROUTE , '/my/route/:id' ) ;
713753
714754 otelSpan . end ( ) ;
0 commit comments