Skip to content

Commit 3773450

Browse files
authored
Update Lambda local.operation name (#105)
*Description of changes:* * Update Lambda local operation name from `/Hander` to `FunctionHandler` * Update sample app to use the new lambda managed policy`CloudWatchLambdaApplicationSignalsExecutionRolePolicy` By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 7ee5904 commit 3773450

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

aws-distro-opentelemetry-node-autoinstrumentation/src/aws-span-processing-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class AwsSpanProcessingUtil {
6363
operation = AwsSpanProcessingUtil.INTERNAL_OPERATION;
6464
}
6565
if (isLambdaEnvironment()) {
66-
operation = process.env[AWS_LAMBDA_FUNCTION_NAME_CONFIG] + '/Handler';
66+
operation = process.env[AWS_LAMBDA_FUNCTION_NAME_CONFIG] + '/FunctionHandler';
6767
} else if (!AwsSpanProcessingUtil.isValidOperation(span, operation)) {
6868
operation = AwsSpanProcessingUtil.generateIngressOperation(span);
6969
}

aws-distro-opentelemetry-node-autoinstrumentation/test/aws-span-processing-util.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ describe('AwsSpanProcessingUtilTest', () => {
375375
(spanDataMock as any).name = validName;
376376
(spanDataMock as any).kind = SpanKind.SERVER;
377377
const actualOperation: string = AwsSpanProcessingUtil.getIngressOperation(spanDataMock);
378-
expect(actualOperation).toEqual('TestFunction/Handler');
378+
expect(actualOperation).toEqual('TestFunction/FunctionHandler');
379379
});
380380

381381
it('should return cloud.resource_id when present', () => {

lambda-layer/terraform/lambda/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ resource "aws_iam_role_policy_attachment" "hello-lambda-cloudwatch" {
6464

6565
resource "aws_iam_role_policy_attachment" "test_xray" {
6666
role = module.hello-lambda-function.lambda_function_name
67-
policy_arn = "arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess"
67+
policy_arn = "arn:aws:iam::aws:policy/CloudWatchLambdaApplicationSignalsExecutionRolePolicy"
6868
}

0 commit comments

Comments
 (0)