To monitor a specific Lambda function, add the
lumigo:auto-trace tag and set it to
true. Add the following to your CDK code.
import * as cdk from "@aws-cdk/core"; cdk.Tags.of(myfunc).add("lumigo:auto-trace", "true");
To monitor all the functions in a stack, you can use the Stack construct's
[getAllFunctions](https://docs.serverless-stack.com/constructs/Stack#getallfunctions) method and do the following at the bottom of your stack definition.
import * as cdk from "@aws-cdk/core"; this.getAllFunctions().forEach(fn => cdk.Tags.of(fn).add("lumigo:auto-trace", "true") );
For more info, check out the SST docs.
Updated about 2 years ago