Tracing

class aws_cdk.aws_lambda.Tracing(value)

Bases: enum.Enum

X-Ray Tracing Modes (https://docs.aws.amazon.com/lambda/latest/dg/API_TracingConfig.html).

Example:

fn = lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_12_X,
    handler="index.handler",
    code=lambda_.Code.from_inline("exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }"),
    tracing=lambda_.Tracing.ACTIVE
)

Attributes

ACTIVE

Lambda will respect any tracing header it receives from an upstream service.

If no tracing header is received, Lambda will call X-Ray for a tracing decision.

DISABLED

Lambda will not trace any request.

PASS_THROUGH

Lambda will only trace the request from an upstream service if it contains a tracing header with “sampled=1”.