Introduction: Alert Manager is a service for processing alarm information in Prometheus, an open source monitoring system. By configuring open alarms of the log service as a Receiver in The Alert Manager, alarm messages generated by the Alert Manager can be sent to the log service.

SLS alarm management

AlertManager, a member of the Prometheus ecosystem, provides a variety of alarm management services including silence, suppression, and notification. At the same time, the actual use of AlertManager has more or less shortcomings, such as too few notification channels and cumbersome rule configuration process.

To solve alarm notification and management problems, aliyun log service launches the log service alarm center to provide customers with a one-stop alarm solution. The following figure compares the functions of SLS alarms with those of AlertManager+Prometheus. SLS alarms provide enterprise-level services, greatly facilitating users’ work.

The SLS alarm is open

The SLS alarm provides the open alarm function, which can easily connect alarm messages from three systems to the SLS alarm center without any modification of the existing system. The following figure shows the alarm message flows after AlertManager connects to SLS alarms:

The following describes the process for connecting AlertManager to SLS alarms, including SLS alarm configuration and AlertManager configuration.

SLS alarm configuration

1. Create an action policy

The action policy determines how and through what channels SLS notifies you when it receives an Alert Manager Alert message. To do this, you need to open the alarm center, click Alarm Management, and select action policy from the drop-down list.

Then click the Add button in the upper left corner of the page, configure the new action policy in the pop-up dialog box, and then click ** to confirm. ** At present, the system supports voice, SMS, email, nail and enterprise wechat notification channels. For the specific configuration method of action policy, please refer to the official document to create action policy.

2. Create the open alarm service

First, open the alarm center, click Alarm Management, and select Open Alarms from the drop-down list:

Click the create button in the upper left corner of the page, configure the new open alarm service in the pop-up dialog box, including the service ID and service name, and then click Save:

3. Create an open alarm application

Select the service created in the previous step and click the Apply button of the service in the action bar:

In the dialog box that pops up, click Create, add a new application, and click Save. Set the protocol to AlertManager, action policy to the policy configured in step 1, and other options to the default values.

4. Obtain the open alarm application interface

You now have a new alarm application in the open Alarm service that you created in step 2. Click the interface button in the operation bar of the application to obtain the interface information:

The interface address consists of two parts:

  • Domain name: The access address of the SLS is related to the region. Each region has its own access address.
  • Subpath: Includes the Access Key Id for sending messages and the application Id for opening alarms. Note that the user needs to replace {ACCESS_KEY_ID} in the sub-path part with the Access Key Id of the specific Ali Cloud RAM account and assign the permission policy AliyunLogOpenEventWrite to the account.

Alert Manager access configuration

In the Alert Manager configuration file, you first need to create a receiver for the alarm messages. To do this, you need to add a Webhook receiver under the Receivers configuration, filling in the URL field with the interface address obtained in the previous step. You then need to add the recipient created earlier under the Route configuration item. A typical configuration file looks like this:

route:

receiver: ‘{RECIEVER_NAME}’

.

.

receivers:

– name: ‘{RECIEVER_NAME}’

webhook_configs:

– url: ‘http://{ALIYUN_SLS_ENDPOINT}/event/webhook/RAMAK_{ACCESS_KEY_ID}/{WEBHOOK_APP_ID}’

– name: …

{RECIVER_NAME} is the name defined by the user for the recipient.

Results show

Viewing Alarm Messages

In the transaction view of the alarm center, you can view the list of received alarm messages and the details of the alarm messages.

Alarm Access Overview

On the open alarm tray, you can view alarm message filtering and sending.

Alarm Notification Overview

Alarm tray Displays an overview of all alarm messages and displays the volume of alarm messages sent through different notification channels.

The original link

This article is the original content of Aliyun and shall not be reproduced without permission.