Configure alert in Opsgine Alerting System using AWS

Note: Assuming the account had been set up in Opsgine and AWS.

What is an alert

An alert is a notification of software system failure. Certain tools constantly monitor the performance of the system, network failure or infrastructure failures and send a notification.

Senario

Imagine we are running a critical service, due to some network or infrastructure issues this service stops its services. As we are not monitoring the system, we cannot get notified of the alert unless someone experiences the problem. Because of this, there is a significate impact on the company or people using these services.

To overcome the above scenario we need a better alerting tool such as an opsgine alerting system

What is the Opsgine alerts system

  1. Opsgine alerts system an On-call and alert management to keep services always on
  2. it is a Centralize alert and notifies the right people at the right time

An Example for demonstrating Opsigne alert

Consider we got an API, that accepts the data from the client (mobile or web browser). This API sends the data to Queue. There are background workers who will process the data when the data is available in Queue. If there is any delay in processing the data or queue size is increasing exponentially then we can raise an alert.

1.jpg

Steps for configuring alerts

  1. Create an alert in opsgine
  2. Configure cloud watch alarm in AWS
  3. Create a subscription for the Simple Notification Service (SNS) topic

Create an alert in opsgine

Login to Opsgine, click on Teams and integration section

Pic1.jpg

Click on Add Integration

There is a number of subscribers available to capture the alert, here we choose Incoming Amazon SNS

Picture2.png

Here we need to give the relevant name, description, tags and define the type of alert. And save the details. Before saving make sure to copy the endpoint URL details.

Configure cloud watch alarm in AWS

Now Goto to login to aws.amazon.com and navigate to cloud watch.

Picture3.png

Click on all alarms in the left navigation menu, click on new alarm then select metric as shown in below picture

Picture4.png

Search for SQS matric and select queue metric, final select relevant queue along with metric name .

Here I selected the metric name ApproximateAgeOfOldestMessage (if the queue is not able to process the messages then this alarm is raised.)

I had selected statistics as ‘Average’ and selected period as 1 minute. Finally, I selected the threshold as ‘50’. (checking for the condition when the average message count in a queue is 50 for a period of 1 min then the alert is raised )

Picture5.png

Click next for proceeding to next section, it will shows the selection of sns topic, if there is no existing topic then click on create new topic otherwise choose existing topic. Click on Next to proceed

Picture6.png

Finally set the alarm name then click next to create alarm

Picture7.png

Now we need create a channel between Opsgine alert and cloud watch alarm. This can be done by using SNS.

Create a subscription for the SNS topic

Navigate to SNS from the console and click on topics

Picture8.png

Now select the SNS topic you had created then go to subscription tap and click on subscription.

Click on create a subscription, change the protocol to HTTPS and paste the endpoint which had been copied while creating Opsgine alert and click on the created subscription

final.png