So now, let's talk about Amazon CloudWatch.
And the first service I wanna talk about
within CloudWatch is CloudWatch Metrics.
So CloudWatch provides metrics
for every services out there in AWS,
and so, therefore, you can monitor everything
that's happening in your accounts.
And a metric is just a variable you wanna monitor.
For example, for an EC2 instance,
it could be the CPUUtilization, the NetworkIn, and so on.
For Amazon S3, it could be your bucket size and so on.
So metrics belong to namespaces, and, therefore,
they are bucketed in two different namespaces.
You have one namespace per service, basically.
So you have dimensions,
and they are attributes of a metric.
For example, a metric about CPUUtilization
can be related to a specific instance id,
or a specific environment, and so on.
And you have up to 10 dimensions per metric.
So the metrics are time-based,
so, therefore, they must have a timestamp.
And then once you have a lot of metrics,
you can create a CloudWatch dashboard of metrics
so that you can see them all at once in a specific manner.
Also, you can create CloudWatch Custom Metrics.
So instead of relying on the metrics
that are provided by every services in AWS,
you can create your own custom metric.
For example, to extract the memory usage
out of an EC2 instance.
That is a classic use case
of using a CloudWatch Custom Metric.
The other thing you can do with your CloudWatch Metrics
is to stream them outside of CloudWatch.
So the idea is that you want to continuously stream
CloudWatch Metrics to a destination of your choice.
You're gonna get near real-time delivery and low latency.
And that destination is Amazon Kinesis Data Firehose,
and from there, you can send it to anywhere you want.
Or you can also send your CloudWatch Metrics
directly into a third-party service provider,
such as Datadog, Dynatrace, New Relic,
Splunk, Sumo Logic, and so on.
So how does that work?
Well, your CloudWatch Metrics are going to be streamed
near real-time into Kinesis Data Firehose,
and you obviously have to set that up for it to work.
And from Kinesis Data Firehose you can, for example,
send them into an Amazon S3 bucket from which you can use
Amazon Athena to analyze your data in Amazon S3,
or you can use Amazon Redshift
to have a data warehousing for your metrics,
or Amazon OpenSearch to build dashboards
from Amazon OpenSearch, or do analytics there.
And you can have the choice to stream
all your metrics for all your namespaces
or to only filter a few namespaces in
so that you only have a subset of your metrics
filtered and sent to Kinesis Data Firehose.
Now let's go have a look in the console.
So when you are in the CloudWatch dashboard
on the left-hand side, there is Metrics,
and you can find all the metrics.
Now, as you can see, we see all the namespaces
in here for our metrics.
If you have a look, we have, based on services, for example,
ELB, Auto Scaling, EBS, EC2, EFS, and so on.
So a lot of information given to you here.
So we can click on EC2,
and we can have a per instance metric
just to see one metric.
And I'm going to type credit
to see the CPUCreditBalance, for example.
I will take this instance,
which was created a long time ago,
and then what I'm going to do
is I'm going to choose a custom range,
which is going to be one month, to find some data in here.
Okay, so we have the data here.
And so, the cool thing with CloudWatch Metrics
is that you can just click
and select the time span you want.
And here we go, we're getting some information
around our metrics.
So, as you can see, we get metrics every five minutes here.
So every data point is every five minutes
because detailed monitoring was not enabled
for this instance, okay,
but if I did enable detail monitoring,
I would get data every one minute.
So this is just the basics of CloudWatch Metrics.
Nothing too, too fancy,
but we can definitely filter by time.
We can view it as a different line,
so Stacked area, or Line, or Number, or Pie chart.
You can add it to a dashboard.
You can download it to a .csv. You can share it, okay.
So CloudWatch Metric is very very handy,
and you can have a look at all the metrics, you know,
based on the region you want,
based on the dimension you want, the resource id you want,
so you can filter everything.
So that's it for CloudWatch Metrics.
I hope you liked it,
and I will see you in the next lecture.