API Gateway X-Ray 추적 비활성화

REST API의 분산 추적 요구에 맞춰 X-Ray를 구성하세요.

설명

API Gateway REST API 스테이지는 샘플링된 요청의 X-Ray 추적을 시작할 수 있습니다.

잠재적 영향

수동 추적에서는 앞단 서비스가 추적을 시작해야 느린 요청의 경로를 확인할 수 있습니다.

해결 방법

AWS::ApiGateway::Stage에 TracingEnabled: true를 설정하세요. 배포한 스테이지의 샘플 추적이 표시되는지 확인하세요. 백엔드까지 요청을 추적하려면 백엔드의 추적 설정도 확인하세요.

예시

ProdStage가 참조하는 REST API MyRestApi와 배포 리소스 MyDeployment를 템플릿에 정의하세요.

변경 전

yaml
Resources:
  ProdStage:
    Type: AWS::ApiGateway::Stage
    Properties:
      StageName: Prod
      RestApiId: !Ref MyRestApi
      DeploymentId: !Ref MyDeployment
      TracingEnabled: false

변경 후

yaml
Resources:
  ProdStage:
    Type: AWS::ApiGateway::Stage
    Properties:
      StageName: Prod
      RestApiId: !Ref MyRestApi
      DeploymentId: !Ref MyDeployment
      TracingEnabled: true

참조