@@ -4,13 +4,13 @@ import { context, SpanKind, trace } from '@opentelemetry/api';
44import type { RPCMetadata } from '@opentelemetry/core' ;
55import { getRPCMetadata , isTracingSuppressed , RPCType , setRPCMetadata } from '@opentelemetry/core' ;
66import {
7- ATTR_HTTP_RESPONSE_STATUS_CODE ,
8- ATTR_HTTP_ROUTE ,
9- SEMATTRS_HTTP_STATUS_CODE ,
10- SEMATTRS_NET_HOST_IP ,
11- SEMATTRS_NET_HOST_PORT ,
12- SEMATTRS_NET_PEER_IP ,
13- } from '@opentelemetry/semantic- conventions' ;
7+ HTTP_RESPONSE_STATUS_CODE ,
8+ HTTP_ROUTE ,
9+ HTTP_STATUS_CODE ,
10+ NET_HOST_IP ,
11+ NET_HOST_PORT ,
12+ NET_PEER_IP ,
13+ } from '@sentry/ conventions/attributes ' ;
1414import type {
1515 Event ,
1616 HttpClientRequest ,
@@ -375,30 +375,25 @@ function getIncomingRequestAttributesOnResponse(
375375 const { statusCode, statusMessage } = response ;
376376
377377 const newAttributes : SpanAttributes = {
378- [ ATTR_HTTP_RESPONSE_STATUS_CODE ] : statusCode ,
379- // eslint-disable-next-line deprecation/deprecation
380- [ SEMATTRS_HTTP_STATUS_CODE ] : statusCode ,
378+ [ HTTP_RESPONSE_STATUS_CODE ] : statusCode ,
379+ [ HTTP_STATUS_CODE ] : statusCode ,
381380 'http.status_text' : statusMessage ?. toUpperCase ( ) ,
382381 } ;
383382
384383 const rpcMetadata = getRPCMetadata ( context . active ( ) ) ;
385384 if ( socket ) {
386385 const { localAddress, localPort, remoteAddress, remotePort } = socket ;
387- // eslint-disable-next-line deprecation/deprecation
388- newAttributes [ SEMATTRS_NET_HOST_IP ] = localAddress ;
389- // eslint-disable-next-line deprecation/deprecation
390- newAttributes [ SEMATTRS_NET_HOST_PORT ] = localPort ;
391- // eslint-disable-next-line deprecation/deprecation
392- newAttributes [ SEMATTRS_NET_PEER_IP ] = remoteAddress ;
386+ newAttributes [ NET_HOST_IP ] = localAddress ;
387+ newAttributes [ NET_HOST_PORT ] = localPort ;
388+ newAttributes [ NET_PEER_IP ] = remoteAddress ;
393389 newAttributes [ 'net.peer.port' ] = remotePort ;
394390 }
395- // eslint-disable-next-line deprecation/deprecation
396- newAttributes [ SEMATTRS_HTTP_STATUS_CODE ] = statusCode ;
391+ newAttributes [ HTTP_STATUS_CODE ] = statusCode ;
397392 newAttributes [ 'http.status_text' ] = ( statusMessage || '' ) . toUpperCase ( ) ;
398393
399394 if ( rpcMetadata ?. type === RPCType . HTTP && rpcMetadata . route !== undefined ) {
400395 const routeName = rpcMetadata . route ;
401- newAttributes [ ATTR_HTTP_ROUTE ] = routeName ;
396+ newAttributes [ HTTP_ROUTE ] = routeName ;
402397 }
403398
404399 return newAttributes ;
0 commit comments