# RDS Enhanced Monitoring & CloudWatch

* **RDS provides metrics in real time for the operating system that your database instance runs on**.<br>
* You can **view the metrics for your database instance using the console**, or **consume the Enhanced Monitoring JSON output from CloudWatch Logs** in a monitoring system of your choice.<br>
* **By default, Enhanced Monitoring metrics are stored in the CloudWatch Logs for 30 days**.<br>
  * **To modify the amount of time the metrics are stored in the CloudWatch Logs, change the retention** for the `RDSOSMetrics` log group in the CloudWatch console.<br>
* Take note that **there are certain differences between CloudWatch and Enhanced Monitoring Metrics:**<br>
  * **CloudWatch gathers metrics about CPU utilization from the hypervisor for a DB instance**.<br>
  * **Enhanced Monitoring gathers its metrics from an agent on the instance**.<br>
  * **As a result, you might find differences between the measurements, because the hypervisor layer performs a small amount of work**.<br>
  * The **differences can be greater if your DB instances use smaller instance classes**, because then there are **likely more VMs that are managed by the hypervisor layer on a single physical instance**.<br>
* **Enhanced Monitoring metrics are useful when you want to see how different processes or threads on a DB instance use the CPU**.<br>
* For example, if you want to **closely monitor how the different processes or threads on a DB instance use the CPU, including the percentage of the CPU bandwidth and total memory consumed by each process:**<br>
  * You **use enhanced monitoring on RDS**.<br>
  * You **do not use CloudWatch to monitor the CPU Utilization of your database because although it can monitor the CPU Utilization of your database instance, it does not provide the percentage of the CPU bandwidth and total memory consumed** by each database process in your RDS instance.
    * **CloudWatch gathers metrics about CPU utilization from the hypervisor for a DB instance** while **RDS Enhanced Monitoring gathers its metrics from an agent on the instance**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://karansingh.gitbook.io/tutorialsdojo-wrong-answers/test-1-70/rds-enhanced-monitoring-and-cloudwatch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
