From 26711166b4de08eec2946160dbc4de8c6fe249a2 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Tue, 11 May 2021 15:04:13 +0200 Subject: [PATCH] fix: move faas_id and cloud_account_id to semantic conventions --- .../src/aws-lambda.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/aws-lambda.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/aws-lambda.ts index 1ca0468eef..656aaa234b 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/aws-lambda.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/aws-lambda.ts @@ -32,8 +32,10 @@ import { SpanStatusCode, TracerProvider, } from '@opentelemetry/api'; -import { CLOUD_RESOURCE } from '@opentelemetry/resources'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { + SemanticAttributes, + ResourceAttributes, +} from '@opentelemetry/semantic-conventions'; import { Callback, Context, Handler } from 'aws-lambda'; @@ -121,8 +123,8 @@ export class AwsLambdaInstrumentation extends InstrumentationBase { kind: SpanKind.SERVER, attributes: { [SemanticAttributes.FAAS_EXECUTION]: context.awsRequestId, - 'faas.id': context.invokedFunctionArn, - [CLOUD_RESOURCE.ACCOUNT_ID]: AwsLambdaInstrumentation._extractAccountId( + [ResourceAttributes.FAAS_ID]: context.invokedFunctionArn, + [ResourceAttributes.CLOUD_ACCOUNT_ID]: AwsLambdaInstrumentation._extractAccountId( context.invokedFunctionArn ), },