Consider a situation where you have a downtime issue arising in your machine. Still, the CPU utilization is average, and you cannot think why it is happening. Then custom metrics will come into the picture; you can set some custom metrics like memory utilization metrics to check the downtime is due to high memory utilization or something else.
The first question that strikes in mind is why we need custom metrics when AWS CloudWatch offers a large variety of matrices for your EC2 instances. Sometimes, you need some custom metrics to visualize your instances to know the exact reason for the downtime.
Well, you can achieve custom metrics set up with the help of AWS System Manager, which makes this setup much more effortless and understandable.
AWS System Manager
AWS System Manager (very well known as SSM) is an AWS service that helps to view and control operational data on multiple AWS Resources such as a group of EC2, IoT Devices, On-Prem servers, etc.
It helps you maintain security and compliance by scanning your machines and reporting any violations if found.
Installation of AWS System Manager
By default, AWS SSM is installed on these flavors of EC2 machines-:
- Amazon Linux
- Amazon Linux 2
- Amazon Linux 2 ECS-Optimized Base AMIs
- SUSE Linux Enterprise Server (SLES) 12 and 15
- Ubuntu Server 16.04, 18.04, and 20.04
But if your EC2 doesn’t come in the above category, then you can manually install it on your EC2 server, click below on the basis of your OS, and install it:
- Amazon Linux
- Amazon Linux 2
- Debian Server
- Oracle Linux
- Red Hat Enterprise Linux
- SUSE Linux Enterprise Server
- Ubuntu Server
Setting up Custom Metrics
Create an EC2 role with these policies
Attach an IAM Role to the instances
- Go to Instance and click on actions
- Click on security
- Click on Modify IAM Role and attach the role that you have created
- Go to system-manager and click on the run command
- Select the package
- Keep everything as default and give name as shown, please use the same name as it is case sensitive
- Choose the instance
- Disable S3
- Click on Run
- It will take a couple of seconds to complete
- Click on parameter store to store the configuration from the left navigation
- Click on create parameter
- Give the same name as given below, it is mandatory to use AmazonCloudWatch prefix
- In the values section put json file mentioned below
- Use the json given below in values field and keep everything default and create the parameter
- Click here to get the JSON code
- Repeat for windows if you have windows instance and give name as given below
- Paste the windows config in values
- Copy both parameter name in a notepad
- Go to Run command again in left navigation
- Go to the 4’rth page and select Amazon-cloudwatch-manage-agent as shown below
- Paste the name as you have copied, paste windows parameter name as shown below and keep everything default
- Choose the windows instance as we are setting up for windows one
- Disable S3 and keep everything as default and click on run
- Wait for a few seconds it will complete
- Repeat the process for Linux one
- Give the Linux parameter name as you stored
- Choose the instance and disable the s3 and click on Run, Keep all as default
- Wait for a few minutes it will succeed the installation
- After 5-10 minutes go to CloudWatch click on metrics and select all metrics
- There are 2 custom metrics
- You can well go through each and see your custom metrics
In this world of competition, where there is no room for a lag of your website or serious downtime, you will lose your potential customers who will switch to your competitors. So make your website completely free from such issues by significantly decreasing the downtime, making your application highly available with frequent releases. CloudThat’s team of experts can help you set up a highly available and scalable infrastructure. In addition, we have a special managed service team that will monitor your Infrastructure and resolve issues as soon as possible so that you can focus on your business more than downtime problems.
Here at CloudThat are the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge on cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere.
Feel free to drop a comment or any queries you have regarding AWS services, cloud adoption, consulting, and we will get back to you quickly. To get started, go through our Expert Advisory page and Managed Services Package that is CloudThat’s offerings.