All technological notes.
Amazon CloudWatchCloudWatch is a monitoring service that allows you to monitor your applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. It is used to monitor your applications’ performance and metrics.CloudWatch - MetricsCloudWatch provides metrics for every services in AWS
Metric
Metrics belong to namespaces(one namespace per service)Metrics have timestampsCloudWatch dashboards of metricsCan create CloudWatch Custom Metrics (for the RAM for example)
Dimension
Metric Streams
Target:
Amazon Kinesis Data Firehose (and then its destinations)Option to filter metrics to only stream a subset of them

CloudWatch - LogsUsage:
Log groups:
Log stream:
CloudWatch Logs can send logs to:
S3 (exports)Kinesis Data StreamsKinesis Data FirehoseLambdaOpenSearchCan define log expiration policies (never expire, 1 day to 10 years…)
Security
KMS-based encryption with your own keysElastic Beanstalk:
ECS:
AWS Lambda:
VPC Flow Logs:
API Gateway:
CloudTrail based on filterRoute53:
Usage
CloudWatch Logs
Provides a purpose-built query language
CloudWatch DashboardsLog Groups in different AWS accounts
Log data can take up to 12 hours to become available for batch export
CreateExportTask
a batch export

CloudWatch Logs for processing and analysisKinesis Data Streams, Kinesis Data Firehose, or Lambda

























CloudWatch AgentCloudWatch Agent
CloudWatchEC2 machine will go to CloudWatchCloudWatch agent on EC2 to push the log files you wantIAM permissions are correctCloudWatch log agent can be setup on-premises too
Both for virtual servers (EC2 instances, on-premises servers…)
CloudWatch Logs Agent
CloudWatch LogsCloudWatch Unified Agent
CloudWatch LogsSSM Parameter StoreSample:
Unified Agent
Linux server / EC2 instanceMetrics
CloudWatch - AlarmsAlarms
Alarm States:
OK: not triggeredINSUFFICIENT_DATA: not enough data to determine a stateALARM: the threhold has been breached and a notification will be sent.Period:
Integration:
Alarms can be created based on CloudWatch Logs Metrics Filters
Test
Alarm using CLIaws cloudwatch set-alarm-state --alarm-name "myalarm" --state-value ALARM --state-reason "testing purposes"
3 types of Alarm target
EC2
EC2 Auto Scaling
SNS
SNS (from which you can do pretty much anything)Sample:
Composite Alarms
CloudWatch Alarms are on a single metricAND and OR conditions
Status Check:


















CloudWatch - InsightsAvailable for containers on…
Amazon Elastic Container Service (Amazon ECS)Amazon Elastic Kubernetes Services (Amazon EKS)Kubernetes platforms on EC2Fargate (both for ECS and EKS)CloudWatch Insights is using a containerized version of the CloudWatch Agent to discover containers.都是使用 Agent, 不过是 container 版本.
Lambda LayerAnalyze log data and create time series that display contributor data.
Works for any AWS-generated logs (VPC, DNS, etc..)

SageMaker internallyEventBridge and SSM OpsCenterCloudWatch Container Insights
CloudWatch Lambda Insights
CloudWatch Contributors Insights
CloudWatch Application Insights