Log Service can send alert notifications through various methods, including SMS, voice call, email, DingTalk, DingTalk chatbot webhook, custom webhook, and Message Center. This topic describes how to configure each method.
Message Center (recommended)
If you configure Message Center as the notification method, Log Service sends alert notifications to specified recipients via Message Center when an alert is triggered.
- Configure message recipients in the Alibaba Cloud Message Center.
- Log on to the Alibaba Cloud Message Center.
- Choose , and then click Modify to the right of Simple Log Service Alarm Notification.
- In the Modify Contact dialog box, select the recipients and click Save.
To add a new recipient, click + Add Receiver and enter the recipient's email address, phone number, and job title. Only the account owner can configure a phone number for a recipient.Note
- Mobile number andThe recipient can receive notifications only after completing the verification.
- You must configure at least one recipient.
- The default notification method is email and SMS. This setting cannot be changed.
- Configure the notification method in the Log Service console.
- When you configure an alert, select Message Center from the Notifications and click Add.
- Configure the message content.
The content can be 1 to 500 characters long. You can customize the content and use template variables. For more information, see Template variables for legacy alerts.
- Click Submit.
The preceding steps explain how to add one notification method. To add multiple methods, repeat the steps for each method, and then click Submit.
SMS
If you select SMS as a notification method, Log Service sends an SMS alert to the specified phone numbers when an alert is triggered.
Note The phone number used to send SMS alerts is randomly selected and cannot be specified.
- When you configure an alert, select SMS from the Notifications and click Add.
- Configure the following parameters.
Parameter Description Mobile Phone Number Enter the phone numbers to receive alert notifications. Separate multiple phone numbers with commas (,). Send Content Enter the content of the SMS alert. The content can be 1 to 100 characters long. You can use template variables. For more information, see Template variables for legacy alerts. - Click Submit.
The preceding steps explain how to add one notification method. To add multiple methods, repeat the steps for each method, and then click Submit.
Voice call
If you configure voice call as the notification method, Log Service calls the specified phone numbers when an alert is triggered. The voice message includes the project name, alert name, and the configured content.
Note
- If a voice call is not answered, an SMS notification is sent as a backup.
- Log Service uses the following numbers to make alert voice calls. To ensure you receive these calls, add these numbers to your phone's allowlist.
02388560936, 02031241964, 02031341953, 02386133954, 02386133948, 051068094476, 051068094459, 051068094479, 051068094489, 051068094436, 051068094429, 051068094426, 057126886446, 057126886464, 057126886644, 057126886767, 057126886776
- When you configure an alert, select Voice Call from the Notifications and click Add.
- Configure the following parameters.
Parameter Description Mobile Phone Number Enter the phone numbers to receive alert notifications. Separate multiple phone numbers with commas (,). Send Content Enter the content of the voice alert. The content can be 1 to 100 characters long. You can use template variables. For more information, see Template variables for legacy alerts. Note For optimal performance, we recommend using Chinese for the message content. - Click Submit.
The preceding steps explain how to add one notification method. To add multiple methods, repeat the steps for each method, and then click Submit.
If you configure email as the notification method, Log Service sends an email notification to the specified email addresses when an alert is triggered.
Note Log Service uses the monitor@monitor.aliyun.com email address to send alert notifications. To prevent these emails from being marked as spam, add this address to your allowlist.
- When you configure an alert, select Email from the Notifications and click Add.
- Configure the following parameters.
Parameter Description Recipient Enter the email addresses to receive alert notifications. Separate multiple email addresses with commas (,). Subject The subject of the alert email. The subject can be 1 to 100 characters long. You can customize the subject and use template variables. For more information, see Template variables for legacy alerts. Send Content Enter the content of the alert notification email. The content can be 1 to 500 characters long. You can use template variables. For more information, see Template variables for legacy alerts. - Click Submit.
The preceding steps explain how to add one notification method. To add multiple methods, repeat the steps for each method, and then click Submit.
DingTalk chatbot webhook
If you use a DingTalk chatbot webhook for notifications, Log Service sends alerts to a specified DingTalk group via the configured chatbot. You can also use this method to notify specific members.
Note Each chatbot can send a maximum of 20 alert notifications per minute.
- Configure a DingTalk chatbot.
- Open the DingTalk client and go to your DingTalk group.
- In the upper-right corner, click the Group Settings icon, and then click .
- In the ChatBot dialog box, click the + icon in the Add Robot area.
- Select Custom (Custom message services via Webhook) and click Add.
- In the Add Robot dialog box, enter a Chatbot name, configure the Security Settings, select I have read and accepted DingTalk Custom Robot Service Terms of Service, and then click Complete.
Note We recommend that you select Custom Keywords for Security Settings. You can set up to 10 keywords. The chatbot only sends messages that contain at least one of these keywords. We suggest setting Alert as one of the keywords. For more information about security settings, see DingTalk Open Platform.
- Click Copy to copy the webhook URL.
- Configure the notification method in the Log Service console.
- When you configure an alert, select Webhook - DingTalk ChatBot from the Notifications and click Add.
- Configure the following parameters.
Parameter Description Request URL Enter the webhook URL that you copied in Step 1. Title The title of the alert. The title can be 1 to 100 characters long. You can customize the title and use template variables. For more information, see Template variables for legacy alerts. Recipients Specifies who to notify. Options are None, All, and Specified Members. If you select Specified Members, you must enter the phone numbers of the members in the Tagged Users field. Separate multiple phone numbers with commas (,). Send Content A default template is provided. The content can be 1 to 500 characters long and can be customized with template variables. For more information, see Template variables for legacy alerts. Note To notify a specific member, you must add@<phone_number>to the Send Content field. - Click Submit.
The preceding steps explain how to add one notification method. To add multiple methods, repeat the steps for each method, and then click Submit.
Custom webhook
If you configure a custom webhook as the notification method, Log Service sends alert notifications to the specified webhook URL when an alert is triggered.
Note The timeout for this method is 5 seconds. If no response is received within this period, the request times out and the delivery is considered failed.
- When you configure an alert, select WebHook-Custom from the Notifications and click Add.
- Configure the following parameters.
Parameter Description Request URL The custom webhook URL. The URL must be publicly accessible over the internet. Request Method Supported request methods include GET, POST, DELETE, PUT, and OPTIONS. The default request header is Content-Type: application/json;charset=utf-8. Click Add Request Header to add more request headers.
Send Content A default template is provided. The content can be 1 to 500 characters long and can be customized with template variables. For more information, see Template variables for legacy alerts. - Click Submit.
The preceding steps explain how to add one notification method. To add multiple methods, repeat the steps for each method, and then click Submit.
该文章对您有帮助吗?