From 7561d504e9fbb126259b173e33e6e976c695d2e2 Mon Sep 17 00:00:00 2001 From: Ankcorn Date: Wed, 6 Mar 2024 14:34:34 +0000 Subject: [PATCH] hmm --- sending-data/platforms/aws/aws-lambda/traces/node.js.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sending-data/platforms/aws/aws-lambda/traces/node.js.md b/sending-data/platforms/aws/aws-lambda/traces/node.js.md index dd2df9a87..e18250def 100644 --- a/sending-data/platforms/aws/aws-lambda/traces/node.js.md +++ b/sending-data/platforms/aws/aws-lambda/traces/node.js.md @@ -58,10 +58,12 @@ export async function handler(event) { The [Node.js AWS SDK v3]([link](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/)) is not traced by default using OpenTelemetry on AWS Lambda when bundled as part of your function code. We currently support instrumentation for CommonJS codebases. We currently support instrumentation for CommonJS codebases. Use the following steps to enable tracing of the Node.js AWS SDK v3. 1. Mark `@smithy/middleware-stack` and `@aws-sdk/middleware-stack` as external. -2. Ensure these packages are installed into the node_modules folder of your lambda +2. Ensure your functions `.zip` file includes these dependencies These packages are both extremely small and removing these from your bundle can also decrease your coldstarts +Follow the example below for popular serverless frameworks + +++ AWS CDK Add the following config to your `lambda.NodejsFunction` settings