AdotLambdaExecWrapper

class aws_cdk.aws_lambda.AdotLambdaExecWrapper(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The wrapper script to be used for the Lambda function in order to enable auto instrumentation with ADOT.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_lambda import AdotLambdaExecWrapper, AdotLayerVersion, AdotLambdaLayerJavaScriptSdkVersion


fn = lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_18_X,
    handler="index.handler",
    code=lambda_.Code.from_inline("exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }"),
    adot_instrumentation=lambda.AdotInstrumentationConfig(
        layer_version=AdotLayerVersion.from_java_script_sdk_layer_version(AdotLambdaLayerJavaScriptSdkVersion.LATEST),
        exec_wrapper=AdotLambdaExecWrapper.REGULAR_HANDLER
    )
)

Attributes

INSTRUMENT_HANDLER

Wrapping python lambda handlers see https://aws-otel.github.io/docs/getting-started/lambda/lambda-python.

PROXY_HANDLER

Wrapping regular handlers (implementing RequestHandler) proxied through API Gateway, enabling HTTP context propagation.

REGULAR_HANDLER

Wrapping regular Lambda handlers.

SQS_HANDLER

Wrapping SQS-triggered function handlers (implementing RequestHandler).

STREAM_HANDLER

Wrapping streaming handlers (implementing RequestStreamHandler), enabling HTTP context propagation for HTTP requests.