In this blog, We would discuss about both CloudWatch and CloudTrail and its differences.
CloudWatch and CloudTrail are both AWS monitoring and logging services.
What is AWS CloudWatch?
AWS CloudWatch provides real-time monitoring of AWS resources within your infrastructure. Its mainly concerned with what’s happening with your resources, So that you can review and respond to it.
CloudWatch collects monitoring and operational data in the form of logs, metrics and events. With metrics, you can analyze the data points which represent the value of a variable over a time (eg – EC2 Memory Utilization). Logs captures the details information of your application for debugging. Events is the change of environment of a resources in AWS. For EC2, the change of event for a state can be “pending” to “running”. Alarm is used to automatically trigger an action on your behalf. You set a condition for the action to be trigger and that’s status is updated via alarm. You could deep dive and analyze your metrices, logs and traces to better understand how to improve your application performance.
AWS CloudWatch offers two types of monitoring that are Basic monitoring and Detailed monitoring.
Basic Monitoring – Its free and comes inbuild with AWS services. It supports only limited metrices and AWS does not charge for it. Metrics of this type displays the result in every 5 minutes.
Detailed Monitoring – Its chargeable and it offers wide range of metrices. Metrics of this type displays the result in every 1 minute.
What is CloudTrail?
Its a service that enables governance, compliance, operational and risk auditing of your AWS account. Its mainly concerned with “Who did what on AWS“. You can create a trail which is basically a configuration that enables delivery of event to amazon s3 to analyze and respond to changes in your AWS resources. AWS allows you to create trail for either trail to all regions or trail to one region. Its recommend to create trail to all region. Otherwise, creating trail to one region would record the event in that region only and adding future trail would require separate s3 bucket to records the event.
What is the Difference?
- It mainly focuses on the health and performance of AWS services
- It focuses on resources and services
- It helps collecting and tracking metrices, log files and setting alarms
- Its mainly focuses on the who and when performed an action from where and what time in your AWS account.
- It focuses on user activities in your AWS account.
As we saw both of these services has its own functionalities in AWS. Hence, both of these services are recommended to fit in your application architecture as per their usage.
I hope this blog helps. Please like and comment if you have any queries related to this blog.