# Monitoring

## Cloud Watch Metrics

* Provide metrics including CPU Utilization, networking
* Having dimension (instance id, environment)

## Cloud Watch Logs

* Containing different log groups representing different applications
* Different log stream including the logs of the instance
* The log can be exported to s3, open search, etc
* Can provide the query to get the desired fields, calculating the result to obtain the insight
* Subscription filter can be set to filter which log can be delivered to destination
* The log agent can be set to EC2 or on premise server to push the log into the stream

## Cloud Watch Alarms

* Alarm is used to trigger notification for any metric
* The alarm target can be SNS, triggering auto scaling action
* Composite alarm can be set to set up multiple metric with and / or operator



## Cloud Watch Insight

* Container Insight: collect and summarize the metrics and logs from container service (ECS ,EKS, ... )
* Lambda Insight: The detailed metrics of lambda
* Contributors Insight: The "Top-N" contributors through the cloud log
* Application Insight: The insight of all of application including EC2, ECS, lambda, etc

## CloudTrail

![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFW3x2aqEO8GF2kr3VU%2Fuploads%2FzB7Zq6sF3COBgpdDqdAR%2Fscreenshot-www.udemy.com-2023.08.24-02_05_26.png?alt=media\&token=f99471d7-97a6-4d4c-b6b5-8fd5feee6546)

* Get the history of event/API call made in AWS account
* Can export the logs to S3
* Enable the insight to detect the unusual activities including inaccurate resource provisioning, hitting AWS service limit
* Events are stored for 90 days

## AWS Config

![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFW3x2aqEO8GF2kr3VU%2Fuploads%2FD3QWSM870L7fbhLQKOmo%2Fscreenshot-www.udemy.com-2023.08.24-02_15_58.png?alt=media\&token=071021a9-4f17-4cc7-bd3d-353f7aa19b7a)

![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFW3x2aqEO8GF2kr3VU%2Fuploads%2F0RnUBOp0zXQo8cGIiSpC%2Fscreenshot-www.udemy.com-2023.08.24-02_15_39.png?alt=media\&token=ab1fecdb-468a-4bd1-8c23-f88f0540e60a)

* Define the rules for compliance of the AWS resources
* Remediation can be automatically triggered for non-compliant resources, e.g: create jira task...
* Can make good use of event bridge to send notification when there are non-compliant resources
