enum Tracing
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.Tracing |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#Tracing |
Java | software.amazon.awscdk.services.lambda.Tracing |
Python | aws_cdk.aws_lambda.Tracing |
TypeScript (source) | aws-cdk-lib » aws_lambda » Tracing |
X-Ray Tracing Modes (https://docs.aws.amazon.com/lambda/latest/dg/API_TracingConfig.html).
Example
const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_18_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
tracing: lambda.Tracing.ACTIVE,
});
Members
Name | Description |
---|---|
ACTIVE | Lambda will respect any tracing header it receives from an upstream service. |
PASS_THROUGH | Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1". |
DISABLED | Lambda will not trace any request. |
ACTIVE
Lambda will respect any tracing header it receives from an upstream service.
If no tracing header is received, Lambda will sample the request based on a fixed rate. Please see the Using AWS Lambda with AWS X-Ray documentation for details on this sampling behavior.
PASS_THROUGH
Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1".
DISABLED
Lambda will not trace any request.