Monitoring is an important part of maintaining the reliability, availability, and performance of CodeDeploy and your AWS solutions. You should collect monitoring data from all of the parts of your AWS solution so that you can more easily debug a multi-point failure if one occurs. Before you start monitoring CodeDeploy, however, you should create a monitoring plan that includes answers to the following questions:
The next step is to establish a baseline for normal CodeDeploy performance in your environment, by measuring performance at various times and under different load conditions. As you monitor CodeDeploy, store historical monitoring data so that you can compare it with current performance data, identify normal performance patterns and performance anomalies, and devise methods to address issues.
For example, if you’re using CodeDeploy, you can monitor the status of deployments and target instances. When deployments or instances fail, you might need to reconfigure an application specification file, reinstall or update the CodeDeploy agent, update settings in an application or deployment group, or make changes to instance settings or an AppSpec file.
To establish a baseline, you should, at a minimum, monitor the following items:
AWS provides various tools that you can use to monitor CodeDeploy. You can configure some of these tools to do the monitoring for you, while some of the tools require manual intervention. We recommend that you automate monitoring tasks as much as possible.
You can use the following automated monitoring tools to watch CodeDeploy and report when something is wrong:
Amazon CloudWatch Alarms – Watch a single metric over a time period that you specify, and perform one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon Simple Notification Service (Amazon SNS) topic or Amazon EC2 Auto Scaling policy. CloudWatch alarms do not invoke actions simply because they are in a particular state; the state must have changed and been maintained for a specified number of periods. For more information, see Monitoring Deployments with Amazon CloudWatch Tools .
For information about updating your service role to work with CloudWatch alarm monitoring, see Grant CloudWatch permissions to a CodeDeploy service role . For information about adding CloudWatch alarm monitoring to your CodeDeploy operations, see Create an application with CodeDeploy , Create a deployment group with CodeDeploy , or Change deployment group settings with CodeDeploy .
Amazon CloudWatch Logs – Monitor, store, and access your log files from AWS CloudTrail or other sources. For more information, see Monitoring Log Files in the Amazon CloudWatch User Guide.
For information about using the CloudWatch console to view CodeDeploy logs, see View CodeDeploy logs in CloudWatch Logs console .
Amazon CloudWatch Events – Match events and route them to one or more target functions or streams to make changes, capture state information, and take corrective action. For more information, see What is Amazon CloudWatch Events in the Amazon CloudWatch User Guide.
For information about using CloudWatch Events in your CodeDeploy operations, see Monitoring deployments with Amazon CloudWatch Events .
AWS CloudTrail Log Monitoring – Share log files between accounts, monitor CloudTrail log files in real time by sending them to CloudWatch Logs, write log processing applications in Java, and validate that your log files have not changed after delivery by CloudTrail. For more information, see Working with CloudTrail Log Files in the AWS CloudTrail User Guide.
For information about using CloudTrail with CodeDeploy, see Monitoring Deployments .
Amazon Simple Notification Service — Configure event-driven triggers to receive SMS or email notifications about deployment and instance events, such as success or failure. For more information, see Create a topic and What is Amazon Simple Notification Service .
For information about setting up Amazon SNS notifications for CodeDeploy, see Monitoring Deployments with Amazon SNS Event Notifications .
需要单独安装cloudwach log agent
此时只能使用sns当作trigger
其他和cloudwatch event一样