From 7bd449ead0f77e1e1cb236a8815006406fd1a570 Mon Sep 17 00:00:00 2001 From: branberry Date: Thu, 12 Oct 2023 13:51:56 -0500 Subject: [PATCH] [DOP-4033]: Add adot instrumentation --- .../lib/constructs/api/webhook-api-construct.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cdk-infra/lib/constructs/api/webhook-api-construct.ts b/cdk-infra/lib/constructs/api/webhook-api-construct.ts index 52c71b95f..7e655f202 100644 --- a/cdk-infra/lib/constructs/api/webhook-api-construct.ts +++ b/cdk-infra/lib/constructs/api/webhook-api-construct.ts @@ -1,6 +1,13 @@ import { Duration } from 'aws-cdk-lib'; import { Cors, CorsOptions, LambdaIntegration, LambdaRestApi } from 'aws-cdk-lib/aws-apigateway'; -import { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda'; +import { + AdotLambdaExecWrapper, + AdotLambdaLayerJavaScriptSdkVersion, + AdotLayerVersion, + Code, + Function, + Runtime, +} from 'aws-cdk-lib/aws-lambda'; import { SqsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources'; import { BundlingOptions, NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; import { IQueue } from 'aws-cdk-lib/aws-sqs'; @@ -72,6 +79,10 @@ export class WebhookApiConstruct extends Construct { bundling, environment, timeout, + adotInstrumentation: { + execWrapper: AdotLambdaExecWrapper.REGULAR_HANDLER, + layerVersion: AdotLayerVersion.fromJavaScriptSdkLayerVersion(AdotLambdaLayerJavaScriptSdkVersion.V1_7_0), + }, }); const githubDeleteArtifactsLambda = new NodejsFunction(this, 'githubDeleteArtifactsLambda', {