Description
When X-Ray tracing is disabled for an API Gateway REST API stage, that stage does not actively initiate request traces. Tracing helps investigate latency and errors across services.
Potential impact
Without another tracing mechanism, identifying a request’s bottleneck or failure point can take longer.
Remediation
Set TracingEnabled: true on stages that need X-Ray tracing, and check backend instrumentation and sampling settings.
Examples
These excerpts change only tracing on the same REST API stage. Define the referenced API and deployment resources separately.
Before
yaml
Resources:
ProdStage:
Type: AWS::ApiGateway::Stage
Properties:
StageName: Prod
RestApiId: !Ref MyRestApi
DeploymentId: !Ref MyDeployment
TracingEnabled: false
After
yaml
Resources:
ProdStage:
Type: AWS::ApiGateway::Stage
Properties:
StageName: Prod
RestApiId: !Ref MyRestApi
DeploymentId: !Ref MyDeployment
TracingEnabled: true