@@ -32,7 +32,7 @@ import {
3232 InstrumentationNodeModuleFile ,
3333 isWrapped ,
3434} from '@opentelemetry/instrumentation' ;
35- import { SemanticAttributes } from '@opentelemetry/semantic- conventions' ;
35+ import { CODE_FUNCTION , HTTP_METHOD , HTTP_ROUTE , HTTP_STATUS_CODE , HTTP_URL } from '@sentry/ conventions/attributes ' ;
3636import type { Params } from '@remix-run/router' ;
3737import type * as remixRunServerRuntime from '@remix-run/server-runtime' ;
3838import type * as remixRunServerRuntimeData from '@remix-run/server-runtime/dist/data' ;
@@ -192,7 +192,7 @@ export class RemixInstrumentation extends InstrumentationBase {
192192
193193 const routePath = route ?. path ;
194194 if ( span && routePath ) {
195- span . setAttribute ( SemanticAttributes . HTTP_ROUTE , routePath ) ;
195+ span . setAttribute ( HTTP_ROUTE , routePath ) ;
196196 span . updateName ( `remix.request ${ routePath } ` ) ;
197197 }
198198
@@ -220,7 +220,7 @@ export class RemixInstrumentation extends InstrumentationBase {
220220 const span = plugin . tracer . startSpan (
221221 'remix.request' ,
222222 {
223- attributes : { [ SemanticAttributes . CODE_FUNCTION ] : 'requestHandler' } ,
223+ attributes : { [ CODE_FUNCTION ] : 'requestHandler' } ,
224224 } ,
225225 opentelemetry . context . active ( ) ,
226226 ) ;
@@ -256,7 +256,7 @@ export class RemixInstrumentation extends InstrumentationBase {
256256
257257 const span = plugin . tracer . startSpan (
258258 `LOADER ${ params . routeId } ` ,
259- { attributes : { [ SemanticAttributes . CODE_FUNCTION ] : 'loader' } } ,
259+ { attributes : { [ CODE_FUNCTION ] : 'loader' } } ,
260260 opentelemetry . context . active ( ) ,
261261 ) ;
262262
@@ -291,7 +291,7 @@ export class RemixInstrumentation extends InstrumentationBase {
291291 const clonedRequest = params . request . clone ( ) ;
292292 const span = plugin . tracer . startSpan (
293293 `ACTION ${ params . routeId } ` ,
294- { attributes : { [ SemanticAttributes . CODE_FUNCTION ] : 'action' } } ,
294+ { attributes : { [ CODE_FUNCTION ] : 'action' } } ,
295295 opentelemetry . context . active ( ) ,
296296 ) ;
297297
@@ -344,8 +344,8 @@ export class RemixInstrumentation extends InstrumentationBase {
344344
345345const addRequestAttributesToSpan = ( span : Span , request : Request ) : void => {
346346 span . setAttributes ( {
347- [ SemanticAttributes . HTTP_METHOD ] : request . method ,
348- [ SemanticAttributes . HTTP_URL ] : request . url ,
347+ [ HTTP_METHOD ] : request . method ,
348+ [ HTTP_URL ] : request . url ,
349349 } ) ;
350350} ;
351351
@@ -362,7 +362,7 @@ const addMatchAttributesToSpan = (span: Span, match: { routeId: string; params:
362362const addResponseAttributesToSpan = ( span : Span , response : Response | null ) : void => {
363363 if ( response ) {
364364 span . setAttributes ( {
365- [ SemanticAttributes . HTTP_STATUS_CODE ] : response . status ,
365+ [ HTTP_STATUS_CODE ] : response . status ,
366366 } ) ;
367367 }
368368} ;
0 commit comments