diff --git a/packages/aws-serverless/package.json b/packages/aws-serverless/package.json index aa846a1eb3b7..99b0c3b9a68f 100644 --- a/packages/aws-serverless/package.json +++ b/packages/aws-serverless/package.json @@ -69,7 +69,7 @@ "@opentelemetry/api": "^1.9.1", "@opentelemetry/core": "^2.6.1", "@opentelemetry/instrumentation": "^0.214.0", - "@opentelemetry/semantic-conventions": "^1.40.0", + "@sentry/conventions": "^0.11.0", "@sentry/core": "10.58.0", "@sentry/node": "10.58.0", "@sentry/node-core": "10.58.0", diff --git a/packages/aws-serverless/src/integration/aws/vendored/aws-sdk.ts b/packages/aws-serverless/src/integration/aws/vendored/aws-sdk.ts index 124e44a1ca6c..d884762dab79 100644 --- a/packages/aws-serverless/src/integration/aws/vendored/aws-sdk.ts +++ b/packages/aws-serverless/src/integration/aws/vendored/aws-sdk.ts @@ -46,7 +46,7 @@ import { } from './utils'; import { propwrap } from './propwrap'; import { RequestMetadata } from './services/ServiceExtension'; -import { ATTR_HTTP_STATUS_CODE } from './semconv'; +import { HTTP_STATUS_CODE } from '@sentry/conventions/attributes'; import { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core'; const PACKAGE_NAME = '@sentry/instrumentation-aws-sdk'; @@ -289,7 +289,7 @@ export class AwsInstrumentation extends InstrumentationBase { switch (response.request.commandName) { case 'SendMessage': - span.setAttribute(ATTR_MESSAGING_MESSAGE_ID, response?.data?.MessageId); + span.setAttribute(MESSAGING_MESSAGE_ID, response?.data?.MessageId); break; case 'SendMessageBatch': @@ -119,7 +119,7 @@ export class SqsServiceExtension implements ServiceExtension { case 'ReceiveMessage': { const messages: SQS.Message[] = response?.data?.Messages || []; - span.setAttribute(ATTR_MESSAGING_BATCH_MESSAGE_COUNT, messages.length); + span.setAttribute(MESSAGING_BATCH_MESSAGE_COUNT, messages.length); for (const message of messages) { const propagatedContext = propagation.extract( @@ -134,7 +134,7 @@ export class SqsServiceExtension implements ServiceExtension { span.addLink({ context: spanContext, attributes: { - [ATTR_MESSAGING_MESSAGE_ID]: message.MessageId, + [MESSAGING_MESSAGE_ID]: message.MessageId, }, }); } diff --git a/packages/aws-serverless/src/integration/aws/vendored/utils.ts b/packages/aws-serverless/src/integration/aws/vendored/utils.ts index d8412b9b1566..47ea3aea6938 100644 --- a/packages/aws-serverless/src/integration/aws/vendored/utils.ts +++ b/packages/aws-serverless/src/integration/aws/vendored/utils.ts @@ -19,7 +19,8 @@ */ import { Attributes, Context, context } from '@opentelemetry/api'; -import { ATTR_RPC_METHOD, ATTR_RPC_SERVICE, ATTR_RPC_SYSTEM } from './semconv'; +import { RPC_METHOD, RPC_SERVICE } from '@sentry/conventions/attributes'; +import { ATTR_RPC_SYSTEM } from './semconv'; import { AttributeNames } from './enums'; import { NormalizedRequest } from './types'; @@ -45,8 +46,8 @@ export const normalizeV3Request = ( export const extractAttributesFromNormalizedRequest = (normalizedRequest: NormalizedRequest): Attributes => { return { [ATTR_RPC_SYSTEM]: 'aws-api', - [ATTR_RPC_METHOD]: normalizedRequest.commandName, - [ATTR_RPC_SERVICE]: normalizedRequest.serviceName, + [RPC_METHOD]: normalizedRequest.commandName, + [RPC_SERVICE]: normalizedRequest.serviceName, [AttributeNames.CLOUD_REGION]: normalizedRequest.region, }; }; diff --git a/packages/aws-serverless/src/integration/instrumentation-aws-lambda/instrumentation.ts b/packages/aws-serverless/src/integration/instrumentation-aws-lambda/instrumentation.ts index c564a8dc583a..8241ee1f9dbc 100644 --- a/packages/aws-serverless/src/integration/instrumentation-aws-lambda/instrumentation.ts +++ b/packages/aws-serverless/src/integration/instrumentation-aws-lambda/instrumentation.ts @@ -45,17 +45,12 @@ import { isWrapped, safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; -import { - ATTR_URL_FULL, - SEMATTRS_FAAS_EXECUTION, - SEMRESATTRS_CLOUD_ACCOUNT_ID, - SEMRESATTRS_FAAS_ID, -} from '@opentelemetry/semantic-conventions'; +import { CLOUD_ACCOUNT_ID, FAAS_COLDSTART, URL_FULL } from '@sentry/conventions/attributes'; import type { APIGatewayProxyEventHeaders, Callback, Context, Handler, StreamifyHandler } from 'aws-lambda'; import * as fs from 'fs'; import * as path from 'path'; import type { LambdaModule } from './internal-types'; -import { ATTR_FAAS_COLDSTART } from './semconv'; +import { ATTR_FAAS_EXECUTION, ATTR_FAAS_ID } from './semconv'; import type { AwsLambdaInstrumentationConfig, EventContextExtractor } from './types'; import { wrapHandler } from '../../sdk'; import { SDK_VERSION } from '@sentry/core'; @@ -338,10 +333,10 @@ export class AwsLambdaInstrumentation extends InstrumentationBase