Create a webhook alert

Updated at:

Send alert notifications to a custom webhook address. Prometheus supports webhook alerts to groups in applications such as Lark, WeChat, and DingTalk. This topic uses Lark as an example.

Note ARMS no longer supports the alert feature of the old version. You can use the new alert management feature to customize Webhook notification recipients. For more information, see Send alert notifications to a custom webhook.

Step 1: Generate a webhook link

  1. Open and log on to Lark.

  2. Click the + icon, and then click Create Group to create a new group for sending alerts.

  3. Click the group settings icon, and then click the Group Bot tab.

  4. On the Group Bot tab, click Add Bot.

    Add a Feishu bot

  5. In the Add Bot panel, select Custom Bot.

    Feishu - Custom bot

  6. On the configuration page, set the display name and description, and then click Add.

    Feishu - Configure the bot

  7. Click Copy to save the webhook address from the Addition Status area, and then click Done.

    Feishu - Webhook

Step 2: Create a webhook alert

  1. Log on to the Managed Service for Prometheus console.

  2. In the navigation pane on the left, choose Alert Management > Contact Management.

  3. On the Contacts tab, click Create Webhook in the upper-right corner.

  4. In the Create Webhook dialog box, enter the configuration information.

    The following table describes the basic parameters.

    Parameter

    Description

    Webhook Name

    Required. The custom name of the webhook.

    Post and Get

    Required. The request method. The URL cannot exceed 100 characters.

    In this example, select Post, and paste the webhook address that you saved in Step 1: Generate a webhook link into the text box on the right.

    Header and Param

    Optional. The request header, which cannot exceed 200 characters. Click Add to add more headers or parameters. The default request header is Content-Type: text/plain; charset=UTF-8. You can specify up to six headers and parameters in total.

    In this example, set the following two Headers:

    • Arms-Content-Type : json

    • Content-Type : application/json

    Body

    Optional. Available only when the request method is Post. Use the $content placeholder in the Body string to include the alert content. The string cannot exceed 500 characters.

    In this example, set the alert text format as follows:

    {"msg_type": "text","content": {"text": "$content"}}
  5. Optional: Click Test to verify that the configuration is successful.

  6. Click Create.

Step 3: Set a notification recipient

Create or edit a dispatch rule. Set Recipient to the webhook contact that you added. In the Notification Method area, select WebHook. For more information, see Notification policies.

Note

The webhook alert has a timeout period of 5 seconds. If no response is received within 5 seconds after the request is sent, the alert fails to be delivered.