Amazon CloudWatch has some [[Site Reliability Engineering]] properties: > Amazon CloudWatch enables you to set alarms and automate actions based on either predefined thresholds, or on machine learning algorithms that identify anomalous behavior in your metrics. For example, it can start Amazon EC2 Auto Scaling automatically, or stop an instance to reduce billing overages. You can also use CloudWatch Events for serverless to trigger workflows with services like AWS Lambda, [[Amazon SNS]], and [[AWS CloudFormation]]. You can create custom "metrics" based on filters in the logs (such as error rates). Alarms can be sent based on thresholds. They can be sent to [[Amazon Simple Notification Service]]. See [Getting started with CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_GettingStarted.html). ## Logs [What is Amazon CloudWatch Logs?](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html): You can use Amazon CloudWatch Logs to monitor, store, and access your log files from Amazon Elastic Compute Cloud ([[Amazon Elastic Compute Cloud|Amazon EC2]]) instances, [[AWS CloudTrail]], [[Amazon Route 53|Route 53]], and other sources. **Log Route 53 DNS queries** – You can use CloudWatch Logs to log information about the DNS queries that Route 53 receives. For more information, see [Logging DNS Queries](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html) in the _Amazon Route 53 Developer Guide_. On [[Amazon Elastic Compute Cloud|EC2]] instances, the so-called _unified_ CloudWatch agent can be used: ```sh sudo yum install amazon-cloudwatch-agent ``` [[Vector]] can also be used with its [CloudWatch sink](https://vector.dev/docs/reference/configuration/sinks/aws_cloudwatch_logs/). ## Events [What Is Amazon CloudWatch Events?](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html): Amazon CloudWatch Events delivers a near real-time stream of system events that describe changes in Amazon Web Services (AWS) resources. ## Metrics ## Container Insights Use CloudWatch Container Insights to collect, aggregate, and summarize metrics and logs from your containerized applications and microservices. Container Insights is available for Amazon Elastic Container Service (Amazon ECS), Amazon Elastic Kubernetes Service (Amazon EKS), and Kubernetes platforms on Amazon EC2. Amazon ECS support includes support for Fargate. CloudWatch automatically collects metrics for many resources, such as CPU, memory, disk, and network. Container Insights also provides diagnostic information, such as container restart failures, to help you isolate issues and resolve them quickly. You can also set CloudWatch alarms on metrics that Container Insights collects. Container Insights collects data as _performance log events_ using [embedded metric format](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format.html). These performance log events are entries that use a structured JSON schema that enables high-cardinality data to be ingested and stored at scale. From this data, CloudWatch creates aggregated metrics at the cluster, node, pod, task, and service level as CloudWatch metrics. The metrics that Container Insights collects are available in CloudWatch automatic dashboards, and also viewable in the **Metrics** section of the CloudWatch console.