DynamoDB 모니터링을 위한 CloudWatch 경보 생성 - Amazon DynamoDB

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

DynamoDB 모니터링을 위한 CloudWatch 경보 생성

CloudWatch 경보 상태가 변경될 때 Amazon SNS 메시지를 보내는 경보를 생성할 수 있습니다. 경보는 지정한 기간에 단일 지표를 감시하고 여러 기간에 지정된 임계값에 대한 지표 값을 기준으로 작업을 하나 이상 수행합니다. 이 작업은 Amazon SNS 주제 또는 Auto Scaling 정책으로 전송되는 알림입니다. 경보는 지속적인 상태 변경에 대한 조치만 호출합니다. CloudWatch 경보는 단순히 특정 상태에 있다는 이유만으로 조치를 호출하지 않습니다. 경보는 지정된 기간 동안 상태가 변경되고 유지되어야 합니다.

참고

누락된 차원에 대한 지표는 집계되지 CloudWatch 않으므로 CloudWatch 경보를 만들 때 필요한 모든 측정기준을 지정해야 합니다. 측정기준이 누락된 CloudWatch 경보를 생성해도 경보를 생성할 때 오류가 발생하지 않습니다.

DynamoDB에서 지원되는 지표 및 필요한 차원 목록은 지표 및 차원 보기 단원을 참조하세요.

전체 읽기 용량을 소비하기 전에 어떻게 통보를 받을 수 있습니까?

  1. Amazon SNS 주제 arn:aws:sns:us-east-1:123456789012:capacity-alarm을 생성합니다.

    자세한 내용은 Amazon Simple Notification Service 설정을 참조하세요.

  2. 경보를 만듭니다. 이 예제에서는 할당된 용량을 읽기 용량 단위 5로 가정합니다.

    aws cloudwatch put-metric-alarm \ --alarm-name ReadCapacityUnitsLimitAlarm \ --alarm-description "Alarm when read capacity reaches 80% of my provisioned read capacity" \ --namespace AWS/DynamoDB \ --metric-name ConsumedReadCapacityUnits \ --dimensions Name=TableName,Value=myTable \ --statistic Sum \ --threshold 240 \ --comparison-operator GreaterThanOrEqualToThreshold \ --period 60 \ --evaluation-periods 1 \ --alarm-actions arn:aws:sns:us-east-1:123456789012:capacity-alarm
  3. 경보를 테스트합니다.

    aws cloudwatch set-alarm-state --alarm-name ReadCapacityUnitsLimitAlarm --state-reason "initializing" --state-value OK
    aws cloudwatch set-alarm-state --alarm-name ReadCapacityUnitsLimitAlarm --state-reason "initializing" --state-value ALARM
참고

소비된 읽기 용량이 1분(60초) 동안 초당 4단위(할당된 읽기 용량 단위 5의 80%) 이상이면 경보가 작동합니다. 따라서 threshold는 읽기 용량 단위 240(4단위/초 * 60초)입니다. 읽기 용량을 업데이트할 때마다 경보 계산도 적절히 업데이트해야 합니다. DynamoDB 콘솔을 통해 경보를 생성하면 이 프로세스를 피할 수 있습니다. 이렇게 하면 경보가 자동으로 업데이트됩니다.

테이블의 프로비저닝된 처리량 할당량을 초과하는 요청이 있을 경우 어떻게 통보를 받을 수 있습니까?

  1. Amazon SNS 주제 arn:aws:sns:us-east-1:123456789012:requests-exceeding-throughput를 생성합니다.

    자세한 내용은 Amazon Simple Notification Service 설정을 참조하세요.

  2. 경보를 만듭니다.

    aws cloudwatch put-metric-alarm \ --alarm-name RequestsExceedingThroughputAlarm\ --alarm-description "Alarm when my requests are exceeding provisioned throughput quotas of a table" \ --namespace AWS/DynamoDB \ --metric-name ThrottledRequests \ --dimensions Name=TableName,Value=myTable Name=Operation,Value=aDynamoDBOperation \ --statistic Sum \ --threshold 0 \ --comparison-operator GreaterThanThreshold \ --period 300 \ --unit Count \ --evaluation-periods 1 \ --treat-missing-data notBreaching \ --alarm-actions arn:aws:sns:us-east-1:123456789012:requests-exceeding-throughput
  3. 경보를 테스트합니다.

    aws cloudwatch set-alarm-state --alarm-name RequestsExceedingThroughputAlarm --state-reason "initializing" --state-value OK
    aws cloudwatch set-alarm-state --alarm-name RequestsExceedingThroughputAlarm --state-reason "initializing" --state-value ALARM

시스템 오류가 발생할 경우 어떻게 통보를 받을 수 있습니까?

  1. Amazon SNS 주제 arn:aws:sns:us-east-1:123456789012:notify-on-system-errors를 생성합니다.

    자세한 내용은 Amazon Simple Notification Service 설정을 참조하세요.

  2. 경보를 만듭니다.

    aws cloudwatch put-metric-alarm \ --alarm-name SystemErrorsAlarm \ --alarm-description "Alarm when system errors occur" \ --namespace AWS/DynamoDB \ --metric-name SystemErrors \ --dimensions Name=TableName,Value=myTable Name=Operation,Value=aDynamoDBOperation \ --statistic Sum \ --threshold 0 \ --comparison-operator GreaterThanThreshold \ --period 60 \ --unit Count \ --evaluation-periods 1 \ --treat-missing-data breaching \ --alarm-actions arn:aws:sns:us-east-1:123456789012:notify-on-system-errors
  3. 경보를 테스트합니다.

    aws cloudwatch set-alarm-state --alarm-name SystemErrorsAlarm --state-reason "initializing" --state-value OK
    aws cloudwatch set-alarm-state --alarm-name SystemErrorsAlarm --state-reason "initializing" --state-value ALARM