CloudWatch
Metrics: Collect and track key metrics
- Metric is a variable to monitor (CPUUtilization, NetworkIn...)
- Metrics belong to namespaces
- Dimension is an attribute of a metric (instance id, env...)
- Up to 10 dimensions per metric
- Metric have timestamps
- EC2: have metrics "every 5 minutes" by default, detailed monitoring - every 1 minute
- EC2 Memory usage is not pushed by default ( use custom metric)
- Custom Metrics:
- by default: 1 minute/metric
- high resolution: up to 1 second/metric (use
StorageResolution
API parameter)
- use API call
PutMetricData
- use exponential back off in case of throttle errors
Logs: Collect, monitor, analyze and store log files
- Logs storage architecture:
- Log groups: arbitrary name, usually representing an application
- Log stream: instances within application/log files/containers
- can define log expiration policies (never expire - by default, 30 days...)
- using the AWS CLI can tail logs
- sending logs to CloudWatch require IAM permission
- encrypt logs using KMS at Group Level
Events: Send notifications when certain events happen