Skip to content

Commit

Permalink
fix: move faas_id and cloud_account_id to semantic conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm committed May 11, 2021
1 parent 69d5f8a commit 2671116
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
),
},
Expand Down

0 comments on commit 2671116

Please sign in to comment.