4

What is the difference between Active and PassThrough in Tracing parameter of AWS::Serverless::Function?

Is PassThrough the default value?

niqui
  • 1,562
  • 1
  • 16
  • 28

2 Answers2

14

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

Dunedan
  • 7,848
  • 6
  • 42
  • 52
  • 3
    They've updated the documentation. The info above is now here: https://docs.aws.amazon.com/vsts/latest/userguide/lambda-deploy.html – scw Dec 06 '19 at 17:51
7

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.

captainblack
  • 4,107
  • 5
  • 50
  • 60