API Gateway REST API stages should have AWS X-Ray tracing enabled
Checks that AWS X-Ray active tracing is on for the REST API stage. Active tracing samples requests and follows them through the API and the services it calls, giving real-time metrics for a faster response to performance changes that could affect the API's availability.
- service
- APIGateway
- severity
- Low
- scope
- evaluated in every region
How to fix it
In the console
API Gateway → APIs → the REST API → Stages → the stage → Logs and tracing
- X-Ray tracing
- On
With the AWS CLI
aws apigateway update-stage --rest-api-id <rest-api-id> --stage-name <stage-name> --patch-operations op=replace,path=/tracingEnabled,value=trueWith Terraform
resource "aws_api_gateway_stage" "this" {
rest_api_id = var.rest_api_id
stage_name = var.stage_name
deployment_id = var.deployment_id
xray_tracing_enabled = true
}
See which of your accounts this check is failing on.
Book a live scan