Task - 01
Setup alerts for EC2 instance.
Setup alerts for AWS Billing Alerts.
For effective monitoring in DevOps using Grafana, follow these steps:
Begin by visiting "Grafana.com" through a Google search and proceed to create a free account, making the process easy and convenient. I recommend using Google for registration.
Once your account is set up, select your Team URL and Deployment Region, and then click on "Finish Setup."
Grafana will work in the background to create an instance for you.
At this stage, focus on the initial step of "Creating a Dashboard."
Choose the "Linux Dashboard" from the various available options.
Specify your OS as Debian, Architecture as Amd64, and provide the Hostname as the Public IP of your EC2 instance. Click on "Install Integration."
Post "Install Integration," a custom installation will be generated, along with an API key connecting Grafana Cloud and your EC2 instance.
Copy the API key, SSH into your server, and paste the key to initiate the installation.
Configure the grafana config yaml file as given in the instructions below.
The yaml file will look like this:
Note: To prevent any sort of errors in this step make sure the indentation is correct.
Execute the command sudo systemctl restart grafana-agent.service
to restart the Grafana agent.
Verify the agent's status to ensure it is running smoothly.
Return to the Grafana Dashboard and click on "Test Integration." You can also install pre-installed dashboards.
Proceed to "View Dashboard."
Navigate to the desired choice to access server monitoring data on Grafana.
Now let's set up Data Source that is CloudWatch.
Go to Connections> Add new Connection and search for CloudWatch.
Configure the Connection Details by inserting IAM UserName and Access Key.
Make sure the IAM user which you are adding has access to this.
Now, Click on Save and Test if it is successfully Configured.
You can check the Dashboards that can be accessed using it.
Search for the Billing Usage and go to that Dashboard.
To establish alert rules, go to the Alerts & IRM section in the console and click on "Alert Rules."
Choose the CloudWatch option and proceed to create a new alert.
Adjust the alert rule settings to specifically configure the AWS Billing alert.
This configuration enables us to receive notifications whenever there is a surge in AWS resource usage billing.
In the same way, we can monitor other resources.
Thanks for reading until here. See you in the next one.