API Gateway X-Ray 추적 비활성화

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

설명

API Gateway REST API 단계의 X-Ray 추적이 꺼져 있으면 해당 단계에서 능동적으로 요청 추적을 시작하지 않습니다. 추적은 서비스 간 지연과 오류를 분석하는 데 도움이 됩니다.

잠재적 영향

다른 추적 수단도 없다면 요청의 병목이나 실패 구간을 찾는 데 더 오래 걸릴 수 있습니다.

해결 방법

X-Ray 추적이 필요한 단계에 TracingEnabled: true를 설정하고 백엔드 서비스의 추적 연계와 샘플링 설정을 확인하세요.

예시

같은 REST API 단계에서 추적 설정만 바꾸는 발췌 예시입니다. 참조하는 API와 배포 리소스는 별도로 정의해야 합니다.

변경 전

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

참조