0
0
AWScloud~30 mins

Default vs custom metrics in AWS - Hands-On Comparison

Choose your learning style9 modes available
Default vs Custom Metrics in AWS CloudWatch
📖 Scenario: You are managing a web application hosted on AWS. You want to monitor its performance using AWS CloudWatch metrics. AWS provides default metrics automatically, but you also want to create a custom metric to track the number of user sign-ups per hour.
🎯 Goal: Build an AWS CloudWatch setup that includes both default metrics for an EC2 instance and a custom metric for user sign-ups.
📋 What You'll Learn
Create a CloudWatch metric namespace called MyAppMetrics
Use the default CPU utilization metric for an EC2 instance
Create a custom metric called UserSignUps under the MyAppMetrics namespace
Set the custom metric value to 5 sign-ups
💡 Why This Matters
🌍 Real World
Monitoring cloud resources with both default and custom metrics helps keep applications healthy and responsive.
💼 Career
Cloud engineers and DevOps professionals often create and manage custom metrics alongside default ones to get detailed insights.
Progress0 / 4 steps
1
Create a CloudWatch metric namespace and default metric reference
Create a variable called namespace and set it to the string 'MyAppMetrics'. Then create a variable called default_metric and set it to the string 'CPUUtilization' which represents the default EC2 CPU metric.
AWS
Need a hint?

Use simple string assignments for namespace and default_metric.

2
Define the custom metric name and value
Create a variable called custom_metric_name and set it to the string 'UserSignUps'. Then create a variable called custom_metric_value and set it to the integer 5 representing the number of sign-ups.
AWS
Need a hint?

Assign the exact string and integer values to the variables.

3
Create a dictionary representing the custom metric data
Create a dictionary called custom_metric_data with keys 'Namespace', 'MetricName', and 'Value'. Set their values to the variables namespace, custom_metric_name, and custom_metric_value respectively.
AWS
Need a hint?

Use a dictionary with the exact keys and assign the variables as values.

4
Add the default metric to a list with the custom metric data
Create a list called metrics_to_monitor that contains two items: the string default_metric and the dictionary custom_metric_data.
AWS
Need a hint?

Create a list with the exact two items in order.