# Monitoring Tools

* Monitoring tools can be used to
  * Observe systems, collecting performance metrics in AWS environment and then using these to make decisions.
  * Debug issues as they come along.
  * Alert when issues pop up based on your criteria.

## Amazon CloudWatch

* Amazon CloudWatch is a web service that enables you to monitor and manage various metrics in real time and configure alarm actions based on data from those metrics.
* It offers visibility to state of the systems.
* CloudWatch uses metrics to represent the data points for your resources.
* AWS services send metrics to CloudWatch. CloudWatch then uses these metrics to create graphs automatically that show how performance has changed over time.

Read more about monitoring [here](https://aws.amazon.com/products/management-and-governance/use-cases/monitoring-and-observability/?whats-new-cards.sort-by=item.additionalFields.postDateTime\&whats-new-cards.sort-order=desc\&blog-posts-cards.sort-by=item.additionalFields.createdDate\&blog-posts-cards.sort-order=desc)

### CloudWatch Alarm

* With CloudWatch, you can create alarms that automatically triggers to perform actions if the value of your metric has gone above or below a predefined threshold.
* When configuring the alarm, you can specify to receive a notification whenever this alarm is triggered as CloudWatch is integrated with [SNS](05_messaging_queuing).

### CloudWatch dashboard

* The CloudWatch dashboard feature enables you to access all the metrics for your resources and infrastructures _(on AWS cloud and on premise)_ from a single location in near real time.
* You can even customize separate dashboards for different business purposes, applications, or resources.
* It auto refreshes providing updated view of resources.
* It helps to reduces MTTR (Mean Time To Resolution) and improve TCO (Total Cost Of Ownership).
* Gain insights and visibility to optimize applications and operational resources.

## AWS CloudTrail

* [It](https://aws.amazon.com/cloudtrail/) is a **comprehensive API auditing tool**, which records API calls for your account into a Cloud Trail Engine.
* The recorded information includes the identity of the API caller, the time of the API call, the source IP address of the API caller, response to the API call and more.
* It provides a “trail” of breadcrumbs (or a log of actions) that someone has left behind them, which can be saved indefinitely to an S3 bucket.
* Recall that you can use API calls to provision, manage, and configure your AWS resources. With CloudTrail, you can view a complete history of user activity and API calls for your applications and resources.
* Events are typically updated in CloudTrail **within 15 minutes** after an API call. You can filter events by specifying the time and date that an API call occurred, the user who requested the action, the type of resource that was involved in the API call, and more.

Read more about auditing and compliance [here](https://aws.amazon.com/products/management-and-governance/use-cases/configuration-compliance-and-auditing/?whats-new-cards.sort-by=item.additionalFields.postDateTime\&whats-new-cards.sort-order=desc\&blog-posts-cards.sort-by=item.additionalFields.createdDate\&blog-posts-cards.sort-order=desc)

### AWS CloudTrail Insights

* Within CloudTrail, you can also enable [CloudTrail Insights](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html). This **optional feature** allows CloudTrail to automatically detect unusual API activities in your AWS account.

## AWS Truster Advisor

* AWS [Trusted Advisor](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/) is a web service that inspects your AWS environment and provides real-time recommendations in accordance with AWS best practices.
* Trusted Advisor compares its findings to AWS best practices in five categories:
  * Cost optimization
  * Performance
  * Security
  * Fault tolerance
  * Service limits.
* For the checks in each category, Trusted Advisor offers a list of recommended actions and additional resources to learn more about AWS best practices. ![Trusted Advisor](https://574639531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJDnjsv52I3fJ56WbLgHu%2Fuploads%2Fgit-blob-cd0d7b516489a5c49354e5bcbf058a8a1c995c8f%2FTrustedAdvisor.png?alt=media)
* For each category:
  * The **green check** indicates the number of items for which it detected no problems.
  * The **orange triangle** represents the number of recommended investigations.
  * The **red circle** represents the number of recommended actions.
