File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
experimental/packages/opentelemetry-instrumentation-http Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,6 @@ export const getIncomingRequestAttributes = (
453453 }
454454
455455 if ( requestUrl ) {
456- attributes [ SemanticAttributes . HTTP_ROUTE ] = requestUrl . pathname || '/' ;
457456 attributes [ SemanticAttributes . HTTP_TARGET ] = requestUrl . pathname || '/' ;
458457 }
459458
Original file line number Diff line number Diff line change @@ -466,6 +466,21 @@ describe('Utility', () => {
466466 } ) ;
467467 } ) ;
468468
469+ describe ( 'getIncomingRequestAttributes()' , ( ) => {
470+ it ( 'should not set http.route in http span attributes' , ( ) => {
471+ const request = {
472+ url : 'http://hostname/user/:id' ,
473+ method : 'GET'
474+ } as IncomingMessage ;
475+ request . headers = {
476+ 'user-agent' : 'chrome' ,
477+ 'x-forwarded-for' : '<client>, <proxy1>, <proxy2>'
478+ }
479+ const attributes = utils . getIncomingRequestAttributes ( request , { component : 'http' } )
480+ assert . strictEqual ( attributes [ SemanticAttributes . HTTP_ROUTE ] , undefined )
481+ } ) ;
482+ } ) ;
483+
469484 describe ( 'headers to span attributes capture' , ( ) => {
470485 let span : Span ;
471486
You can’t perform that action at this time.
0 commit comments