Day78 ---> 90DaysOfDevOps Challenge @TWS

Day78 ---> 90DaysOfDevOps Challenge @TWS

Create Grafana Alerting for An AWS EC2 instance and AWS account billing

Pre-requisites--->

  • Grafana server configured with Data Source: Prometheus Refer

  • An AWS account for monitoring billing alerts Refer

  • A Linux Ec2 Instance running and registered with Prometheus as a Target machine.

image

image

Let's get started

Setting up alerts for our AWS EC2 instance. (Linux-Ubuntu_22.04_LTS)

  1. Start by logging into your Grafana Server.

image

  1. Navigate to the "Alerting" section in the left sidebar and click on "Notification channels".

image

image

  1. Add the appropriate notification channel, such as email or a messaging service like Slack, where you want to receive the alerts.

Follow the instructions provided by Grafana to set up the notification channel.

image

image

image

image

image

image

  1. Once the notification channel is set up, go back to the "Alerting" section and click on "New alert".

image

Configure the alert rule:

  1. Give the alert rule a name that clearly describes its purpose, such as "EC2 Instance Monitoring".

    image

    image

    image

    image

    image

    image

    image

    In the "Conditions" section, click on "Add condition" and select the metric you want to monitor. Some commonly used metrics for EC2 instance monitoring include:

    • CPU Utilization (%): Monitors the percentage of CPU utilization by the EC2 instance.

    • Memory Usage (%): Monitors the percentage of memory (RAM) usage by the EC2 instance.

    • Disk Space (%): Monitors the percentage of disk space usage on the EC2 instance's disk(s).

    • Network In (Bytes): Monitors the incoming network traffic in bytes.

    • Network Out (Bytes): Monitors the outgoing network traffic in bytes.

    • Status Check Failed: Monitors if the EC2 instance's status checks are failing.

image

image

image

image

image

image

Select the appropriate metric(s) based on your monitoring requirements. You can add multiple conditions by clicking on "Add condition" again.

Specify the notification channel you added earlier to receive the alerts. Select the appropriate channel from the "Send to" dropdown menu.

image

Grafana will start monitoring the selected EC2 instance based on your defined conditions and send alerts to the configured notification channel when triggered.

image

image

Have you received any alerts on the slack channel? Let's check--->

image

image

image

image

image

How to Set up Grafana for AWS Billing Alerts using CloudWatch as a Data source.

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

Happy Learning!

Day 78 task is complete!

90DaysOfDevOps Tasks👇

github.com/Chaitannyaa/90DaysOfDevOps.git

Chaitannyaa Gaikwad | LinkedIn