X-Ray tracing disabled for a Serverless Framework REST API

Enable X-Ray tracing when a REST API needs distributed call analysis.

Description

Active tracing lets a REST API stage created by Serverless Framework start X-Ray traces. With tracing off, the stage can still participate in a trace started upstream.

Potential impact

Sampled traces help locate delays or errors across service calls.

Remediation

Set provider.tracing.apiGateway: true. Enable tracing in the backend services you need to follow, and use access logs when you need a record of each request.

Examples

For an external API imported with provider.apiGateway.restApiId, enable tracing on that API’s stage.

Before

yaml
provider:
  name: aws
  tracing:
    apiGateway: false

After

yaml
provider:
  name: aws
  tracing:
    apiGateway: true

References