Chuyển tới nội dung chính

Quy chuẩn thiết lập CloudWatch Alarm

Lưu ý

  • Bật Detailed Monitoring cho một số resource như EC2, RDS ...
  • Mỗi môi trường (dev/stag/prod) nên gửi cảnh báo vào một channel/group riêng
  • Nếu gửi cảnh báo vào các ứng dụng chat (Slack/Telegram/Teams…) nên cấu hình gửi All trong channel/group
  • Tùy từng hệ thống điều chỉnh threshold và datapoint cho phù hợp

Danh sách Alarm Standards

No.ServiceMetricThresholdPeriodDataPointNote
1EC2 InstanceMemoryUtilizationAverage > 80%1'2 out of 2
2EC2 InstanceStatusCheckFailedAverage > 01'1 out of 1
3EC2 InstanceDiskSpaceUtilizationAverage > 70%1'1 out of 1
4EC2 InstanceCPUUtilizationAverage > 70%1'2 out of 2
5ECS ServiceMemoryUtilizationAverage > 80%1'2 out of 2
6ECS ServiceCPUUtilizationAverage > 70%1'2 out of 2
7ALBHTTPCode_ELB_4XX_CountSum > 10001'2 out of 2Nếu kiểm tra thấy không phải là lỗi và không ảnh hưởng lớn hiệu năng hệ thống thì tăng dần mức cảnh báo. Nếu ảnh hưởng thì fix bug hoặc block IP
8ALBHTTPCode_ELB_5XX_CountSum > 01'1 out of 1
9ALBHTTPCode_Target_5XX_CountSum > 01'1 out of 1
10ALBTargetResponseTimeAverage > 5s1'2 out of 2Phụ thuộc non-functional, nếu không có thì phụ thuộc functional hệ thống
11ALBRequestCountSum > 20001'1 out of 1Tăng dần cho đến khi xuất hiện cảnh báo về High Memory, High CPU trong hệ thống thì dừng
12ALBUnHealthyHostCountMaximum > 01'1 out of 1
13RedisEngineCPUUtilizationAverage > 70%1'2 out of 2
14RedisCPUUtilizationAverage > 70%1'2 out of 2
15RedisDatabaseMemoryUsagePercentageAverage > 70%1'1 out of 1
16RedisCurrConnectionsMaximum > 10001'1 out of 1Tăng dần cho đến khi xuất hiện cảnh báo về High Memory, High CPU trong hệ thống thì dừng. AWS limit connect 65k
17RedisEvictionsSum > 21'1 out of 1
18RedisReplicationLagMaximum > 1000 ms1'2 out of 2
19RedisFreeableMemoryAverage < 20%1'2 out of 2
20RDSCPUUtilizationAverage > 70%1'2 out of 2
21RDSFreeableMemoryAverage < 20%1'2 out of 2
22RDSDatabaseConnectionsMaximum > 60% of Max1'1 out of 1Từng spec sẽ có số limit default tương ứng
23RDSReadIOPSAverage > 60% of Max1'2 out of 2
24RDSWriteIOPSAverage > 60% of Max1'2 out of 2
25RDSDiskQueueDepthAverage > 21'2 out of 2
26RDSFreeStorageSpaceAverage < 20%1'1 out of 1
27RDSReplicaLagAverage > 1000 ms1'2 out of 2
28AuroraCPUUtilizationAverage > 70%1'2 out of 2
29AuroraFreeableMemoryAverage < 20%1'2 out of 2
30AuroraDatabaseConnectionsMaximum > 60% of Max1'1 out of 1Từng spec sẽ có số limit default tương ứng
31AuroraReadIOPSAverage > 10001'2 out of 2
32AuroraWriteIOPSAverage > 10001'2 out of 2
33AuroraDiskQueueDepthAverage > 21'2 out of 2
34AuroraAuroraReplicaLagAverage > 1000 ms1'2 out of 2
35OpenSearchCPUUtilizationAverage > 70%5'2 out of 2
36OpenSearchFreeStorageSpaceAverage < 25%1'1 out of 1
37OpenSearchClusterStatus.yellowAverage >= 11'1 out of 1
38OpenSearchClusterStatus.redAverage >= 11'1 out of 1
39OpenSearchClusterIndexWritesBlockedSum >= 11'1 out of 1
40OpenSearchNodesAverage < x1'1 out of 1x là số node data + node master trong cluster
41OpenSearchAutomatedSnapshotFailureMaximum >= 11'1 out of 1
42OpenSearchJVMMemoryPressureMaximum >= 95%1'3 out of 3
43OpenSearchOldGenJVMMemoryPressureMaximum >= 80%1'3 out of 3
44OpenSearchMasterCPUUtilizationMaximum >= 50%5'3 out of 3
45OpenSearchMasterJVMMemoryPressureMaximum >= 95%1'3 out of 3
46OpenSearch5xxSum >= 11'1 out of 1
47OpenSearchThreadpoolWriteQueueAverage >= 1001'1 out of 1
48OpenSearchThreadpoolSearchQueueAverage >= 5001'1 out of 1
49OpenSearchThreadpoolSearchQueueMaximum >= 50001'1 out of 1
50OpenSearchThreadpoolSearchRejectedMaximum >= 11'1 out of 1Giá trị này sẽ liên tục tăng, chỉ reset về 0 khi OpenSearch restart => Sau mỗi lần alert thì tăng giá trị lên cho phù hợp
51OpenSearchThreadpoolWriteRejectedMaximum >= 11'1 out of 1Giá trị này sẽ liên tục tăng, chỉ reset về 0 khi OpenSearch restart => Sau mỗi lần alert thì tăng giá trị lên cho phù hợp
52SESBounce rateAverage >= 0.021'1 out of 1
53SESComplaint rateAverage >= 0.00051'1 out of 1
54WAFBlockedRequestsSum > 101'2 out of 2
55Budget-Actual cost is greater than 80%
Actual cost is greater than 100%
Actual cost is greater than 105%
N/AN/ABudget alerts không sử dụng Period/DataPoint như CloudWatch Alarm; ngưỡng được cấu hình trực tiếp trong AWS Budgets.
56Amplify4xxErrorsSum > 10001'1 out of 1Nếu kiểm tra thấy không phải là lỗi và không ảnh hưởng lớn hiệu năng hệ thống thì tăng dần mức cảnh báo. Nếu ảnh hưởng thì fix bug hoặc block IP
57Amplify5xxErrorsSum > 01'1 out of 1
58AmplifyLatencyAverage > 5s1'2 out of 2Phụ thuộc non-functional, nếu không có thì phụ thuộc functional hệ thống
59LambdaErrorsSum > 11'1 out of 1Nếu hệ thống sử dụng lambda chỉ cho việc gửi cảnh báo thì có thể không cần monitor metric này
60CloudFront5xxErrorRateAverage > 5%1'2 out of 2
61API Gateway5XXErrorSum > 01'2 out of 2
62API GatewayCountSum > 20001'1 out of 1Tăng dần cho đến khi xuất hiện cảnh báo về High Memory, High CPU trong hệ thống thì dừng
63API GatewayLatencyAverage > 5s1'2 out of 2Phụ thuộc non-functional, nếu không có thì phụ thuộc functional hệ thống