What is the difference between Active
and PassThrough
in Tracing
parameter of AWS::Serverless::Function
?
Is PassThrough
the default value?
What is the difference between Active
and PassThrough
in Tracing
parameter of AWS::Serverless::Function
?
Is PassThrough
the default value?
The documentation of the Tracing
parameter for AWS::Serverless:Function
links to a page explaining how to use AWS X-Ray with AWS Lambda. Unfortunately that page doesn't state anything about the tracing mode at all, so it's probably just linking to the wrong page.
The correct page would be the API documentation of AWS Lambda which does explain what the purpose of the TracingConfig
is:
Mode
Can be either PassThrough or Active. If PassThrough, Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1". If 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.
Type: String
Valid Values:
Active
|PassThrough
Required: No
From the docs for Setting Up AWS X-Ray with Lambda:
There are two modes of tracing for a Lambda function:
Pass Through: This is the default setting for all Lambda functions if you have added tracing permissions to your function's execution role. This approach means the Lambda function is only traced if X-Ray has been enabled on an upstream service, such as AWS Elastic Beanstalk.
Active: When a Lambda function has this setting, Lambda automatically samples invocation requests, based on the sampling algorithm specified by X-Ray.