All Products
Search
Document Center

ApsaraDB for OceanBase:Create a notification channel

Last Updated:Nov 15, 2024

This topic describes how to create a notification channel.

Create a notification channel

  1. Log on to the OceanBase Developer Center (ODC) console. Choose Projects > Notification. On the Notification tab, choose Notification Channels > Create Notification Channel.

    image

  2. On the Create Notification Channel page, configure the channel information.

    image

    Parameter

    Description

    Channel Name

    The name of the channel.

    Channel Type

    The webhook URL of the channel.

    When you add a DingTalk or Lark chatbot, you must enter ODC in the Custom Keywords field in the Security Settings section.

    image

    Signature Key

    The signature key of the chatbot.

    Specified User

    The mobile number of the user.

    Notification Template

    The template for sending notifications in the specific language.

    Notification Limit Settings

    The number of times to send notifications within the specified period.

    Description

    Optional. Additional information about the notification channel, which cannot exceed 200 characters in length.

  3. Click Send Test Message. If a test message is successfully sent, click Create.

    image

Channel types

ODC supports sending notifications by using DingTalk, Lark, WeCom, and custom methods.

Channel type

Parameter

DingTalk

  • Obtain the webhook URL of a DingTalk chatbot.

  • Signature Key: the signature key of the DingTalk chatbot.

  • Specified User: the mobile number of the user.

  • Notification Template: the template for sending notifications, which is available in Simplified Chinese, Traditional Chinese, and English.

  • Notification Limit Settings: the number of times to send notifications within the specified period.

Lark

  • Webhook URL.

  • Signature Key: The signature key of the Lark chatbot.

  • Notification Template: the template for sending notifications, which is available in Simplified Chinese, Traditional Chinese, and English.

  • Notification Limit Settings: the number of times to send notifications within the specified period.

WeCom

  • WeCom chatbots.

  • Specified User: the mobile number of the user.

  • Notification Template: the template for sending notifications, which is available in Simplified Chinese, Traditional Chinese, and English.

  • Notification Limit Settings: the number of times to send notifications within the specified period.

Custom

  • Webhook URL.

  • Proxy: the URL of the proxy server, in the format of "http://ip:port".

  • Request Method: Valid values:POST,GET, andPUT. Default value:POST.

  • Notification Template: the template for sending notifications, which is available in Simplified Chinese, Traditional Chinese, and English.

  • Notification Limit Settings: the number of times to send notifications within the specified period.

Notification templates

ODC allows you to define notification templates separately in Simplified Chinese, Traditional Chinese, and English. By default, the notification templates are in the Markdown format.

  • Simplified Chinese

    ### ODC ${taskType}-${taskStatus}
     - 任务ID: ${taskId}
     - 项目: ${projectName}
     - 数据库: ${databaseName}
     - 发起人: ${creatorName}
     - 触发时间: ${triggerTime}
    
  • Traditional Chinese

    ### ODC ${taskType}-${taskStatus}
     - 任務ID: ${taskId}
     - 項目: ${projectName}
     - 數據庫: ${databaseName}
     - 發起人: ${creatorName}
     - 觸發時間: ${triggerTime}
    
  • English

    ### ODC ${taskType}-${taskStatus}
     - task ID: ${taskId}
     - project: ${projectName}
     - database: ${databaseName}
     - creator: ${creatorName}
     - trigger time: ${triggerTime}
    

    The following table describes the supported labels.

    Label name

    Description

    region

    The region of ApsaraDB for OceanBase.

    taskType

    The type of the task.

    taskStatus

    The status of the task.

    projectId

    The ID of the project.

    projectName

    The name of the project.

    creatorId

    The ID of the creator.

    creatorName

    The username of the creator.

    taskId

    The ID of the task.

    connectionId

    The ID of the data source.

    databaseId

    The ID of the database.

    databaseName

    The name of the database.

    clusterName

    The name of the cluster.

    tenantName

    The name of the tenant.

    environment

    The environment of the data source.

    triggerTime

    The time when the event was triggered.

    message

    The body of the notification.

    title

    The title of the notification.

    approverId

    The ID of the user that approved the task.

    approverName

    The username of the user that approved the task.

    description

    The description of the ticket.

    ticketUrl

    The link to the ticket. Two methods are available for obtaining the domain name of ODC. The first method has a higher priority.

    1. Obtain the ODC domain name from the odc.site.url parameter in the config_system_configuration table of the MetaDB.

    2. Use the IP address of the ODC server as the ODC domain name.

Notification throttling settings

The frequency to send notifications is limited on some notification platforms. For example, a custom DingTalk chatbot supports sending at most 20 notifications per minute. If this threshold is reached, the chatbot will be throttled for 10 minutes. If you receive a large number of messages within a short period of time, important messages may be missed.

Therefore, ODC provides the notification throttling feature. You can set the maximum number of notifications that can be sent per minute, hour, or day through a specific channel. You can select either of the following options to handle notifications when the specified threshold is exceeded.

  • Ignore: Notifications generated after the specified threshold is exceeded are ignored and will not be resent. In this case, the notifications are in the Ignore state on the Notification History page.

  • Resend: After the throttling period of time elapses, notifications generated after the specified threshold is exceeded are automatically resent. The notifications are in the To Be Sent state before being resent.

References