组件配置示例 - Amazon CloudWatch
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

如果我们为英文版本指南提供翻译,那么如果存在任何冲突,将以英文版本指南为准。在提供翻译时使用机器翻译。

组件配置示例

以下示例以 JSON 格式显示了相关服务的组件配置。

Amazon Elastic Compute Cloud (EC2)实例

{ "alarmMetrics" : [ { "alarmMetricName" : "CPUUtilization", "monitor" : true }, { "alarmMetricName" : "StatusCheckFailed" } ], "logs" : [ { "logGroupName" : "my_log_group", "logPath" : "C:\\LogFolder\\*", "logType" : "APPLICATION", "monitor" : true }, { "logGroupName" : "my_log_group_2", "logPath" : "C:\\LogFolder2\\*", "logType" : "IIS", "encoding" : "utf-8" } ], "windowsEvents" : [ { "logGroupName" : "my_log_group_3", "eventName" : "Application", "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ], "monitor" : true }, { "logGroupName" : "my_log_group_4", "eventName" : "System", "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ], "monitor" : true }], "alarms" : [ { "alarmName" : "my_instance_alarm_1", "severity" : "HIGH" }, { "alarmName" : "my_instance_alarm_2", "severity" : "LOW" } ] }

Amazon Relational Database Service 实例

{ "alarmMetrics" : [ { "alarmMetricName" : "BurstBalance", "monitor" : true }, { "alarmMetricName" : "WriteThroughput", "monitor" : false } ], "alarms" : [ { "alarmName" : "my_rds_instance_alarm", "severity" : "MEDIUM" } ] }

Amazon Relational Database Service (RDS)AuroraMysql

{ "alarmMetrics": [ { "alarmMetricName": "CPUUtilization", "monitor": true }, { "alarmMetricName": "CommitLatency", "monitor": true } ], "logs": [ { "logType": "MYSQL", "monitor": true, }, { "logType": "MYSQL_SLOW_QUERY", "monitor": false } ] }

Elastic Load Balancing (ELB)

{ "alarmMetrics" : [ { "alarmMetricName" : "EstimatedALBActiveConnectionCount", }, { "alarmMetricName" : "HTTPCode_Backend_5XX" } ], "instances" : { "alarmMetrics" : [ { "alarmMetricName" : "CPUUtilization", }, { "alarmMetricName" : "StatusCheckFailed" } ], "logs" : [ { "logGroupName" : "my_log_group", "logPath" : "C:\\LogFolder\\*", "logType" : "APPLICATION", } ], "windowsEvents" : [ { "logGroupName" : "my_log_group_2", "eventName" : "Application", "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ], "monitor" : true } ] }, "alarms" : [ { "alarmName" : "my_elb_alarm", "severity" : "HIGH" } ] }

应用 Elastic Load Balancing

{ "alarmMetrics" : [ { "alarmMetricName" : "ActiveConnectionCount", }, { "alarmMetricName" : "TargetResponseTime" } ], "instances" : { "alarmMetrics" : [ { "alarmMetricName" : "CPUUtilization", }, { "alarmMetricName" : "StatusCheckFailed" } ], "logs" : [ { "logGroupName" : "my_log_group", "logPath" : "C:\\LogFolder\\*", "logType" : "APPLICATION", } ], "windowsEvents" : [ { "logGroupName" : "my_log_group_2", "eventName" : "Application", "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ] } ] }, "alarms" : [ { "alarmName" : "my_alb_alarm", "severity" : "LOW" } ] }

Amazon EC2 Auto Scaling (ASG)

{ "alarmMetrics" : [ { "alarmMetricName" : "CPUCreditBalance", }, { "alarmMetricName" : "EBSIOBalance%" } ], "instances" : { "alarmMetrics" : [ { "alarmMetricName" : "CPUUtilization", }, { "alarmMetricName" : "StatusCheckFailed" } ], "logs" : [ { "logGroupName" : "my_log_group", "logPath" : "C:\\LogFolder\\*", "logType" : "APPLICATION", } ], "windowsEvents" : [ { "logGroupName" : "my_log_group_2", "eventName" : "Application", "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ] } ] }, "alarms" : [ { "alarmName" : "my_asg_alarm", "severity" : "LOW" } ] }

Amazon Simple Queue Service (SQS)

{ "alarmMetrics" : [ { "alarmMetricName" : "ApproximateAgeOfOldestMessage" }, { "alarmMetricName" : "NumberOfEmptyReceives" } ], "alarms" : [ { "alarmName" : "my_sqs_alarm", "severity" : "MEDIUM" } ] }

客户分组的 EC2 实例

{ "instances" : { "alarmMetrics" : [ { "alarmMetricName" : "CPUUtilization", }, { "alarmMetricName" : "StatusCheckFailed" } ], "logs" : [ { "logGroupName" : "my_log_group", "logPath" : "C:\\LogFolder\\*", "logType" : "APPLICATION", } ], "windowsEvents" : [ { "logGroupName" : "my_log_group_2", "eventName" : "Application", "eventLevels" : [ "ERROR", "WARNING", "CRITICAL" ] } ] }, "alarms" : [ { "alarmName" : "my_alarm", "severity" : "MEDIUM" } ] }

AWS Lambda 函数

{ "alarmMetrics": [ { "alarmMetricName": "Errors", "monitor": true }, { "alarmMetricName": "Throttles", "monitor": true }, { "alarmMetricName": "IteratorAge", "monitor": true }, { "alarmMetricName": "Duration", "monitor": true } ], "logs": [ { "logType": "DEFAULT", "monitor": true } ] }

Amazon DynamoDB 表

{ "alarmMetrics": [ { "alarmMetricName": "SystemErrors", "monitor": false }, { "alarmMetricName": "UserErrors", "monitor": false }, { "alarmMetricName": "ConsumedReadCapacityUnits", "monitor": false }, { "alarmMetricName": "ConsumedWriteCapacityUnits", "monitor": false }, { "alarmMetricName": "ReadThrottleEvents", "monitor": false }, { "alarmMetricName": "WriteThrottleEvents", "monitor": false }, { "alarmMetricName": "ConditionalCheckFailedRequests", "monitor": false }, { "alarmMetricName": "TransactionConflict", "monitor": false } ], "logs": [] }

SQL Always On 可用性组

{ "instances" : { "alarmMetrics" : [ { "alarmMetricName" : "CPUUtilization", "monitor" : true }, { "alarmMetricName" : "StatusCheckFailed", "monitor" : true }, { "alarmMetricName" : "Processor % Processor Time", "monitor" : true }, { "alarmMetricName" : "Memory % Committed Bytes In Use", "monitor" : true }, { "alarmMetricName" : "Memory Available Mbytes", "monitor" : true }, { "alarmMetricName" : "Paging File % Usage", "monitor" : true }, { "alarmMetricName" : "System Processor Queue Length", "monitor" : true }, { "alarmMetricName" : "Network Interface Bytes Total/sec", "monitor" : true }, { "alarmMetricName" : "PhysicalDisk % Disk Time", "monitor" : true }, { "alarmMetricName" : "SQLServer:Buffer Manager Buffer cache hit ratio", "monitor" : true }, { "alarmMetricName" : "SQLServer:Buffer Manager Page life expectancy", "monitor" : true }, { "alarmMetricName" : "SQLServer:General Statistics Processes blocked", "monitor" : true }, { "alarmMetricName" : "SQLServer:General Statistics User Connections", "monitor" : true }, { "alarmMetricName" : "SQLServer:Locks Number of Deadlocks/sec", "monitor" : true }, { "alarmMetricName" : "SQLServer:SQL Statistics Batch Requests/sec", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica File Bytes Received/sec", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Log Bytes Received/sec", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Log remaining for undo", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Log Send Queue", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Mirrored Write Transaction/sec", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Recovery Queue", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Redo Bytes Remaining", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Redone Bytes/sec", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Total Log requiring undo", "monitor" : true }, { "alarmMetricName" : "SQLServer:Database Replica Transaction Delay", "monitor" : true } ], "windowsEvents" : [ { "logGroupName" : "WINDOWS_EVENTS-Application-<RESOURCE_GROUP_NAME>", "eventName" : "Application", "eventLevels" : [ "WARNING", "ERROR", "CRITICAL", "INFORMATION" ], "monitor" : true, "logType" : "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP" }, { "logGroupName" : "WINDOWS_EVENTS-System-<RESOURCE_GROUP_NAME>", "eventName" : "System", "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ], "monitor" : true, "logType" : "DEFAULT" }, { "logGroupName" : "WINDOWS_EVENTS-Security-<RESOURCE_GROUP_NAME>", "eventName" : "Security", "eventLevels" : [ "WARNING", "ERROR", "CRITICAL" ], "monitor" : true, "logType" : "DEFAULT" } ], "logs" : [ { "logGroupName" : "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP-<RESOURCE_GROUP_NAME>", "logPath" : "C:\\Program Files\\Microsoft SQL Server\\MSSQL**.MSSQLSERVER\\MSSQL\\Log\\ERRORLOG", "logType" : "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP", "monitor" : true, "encoding" : "utf-8" } ] } }

RDS MySQL

{ "alarmMetrics": [ { "alarmMetricName": "CPUUtilization", "monitor": true } ], "logs": [ { "logType": "MYSQL", "monitor": true, }, { "logType": "MYSQL_SLOW_QUERY", "monitor": false } ] }

Amazon S3 存储桶:

{ "alarmMetrics" : [ { "alarmMetricName" : "ReplicationLatency", "monitor" : true }, { "alarmMetricName" : "5xxErrors", "monitor" : true }, { "alarmMetricName" : "BytesDownloaded" "monitor" : true } ] }