Updated on 2023-05-06 GMT+08:00

Configuring Alarm Rules

This section describes the alarm rules of some metrics and how to configure them. In actual services, you are advised to configure alarm rules for metrics based on the following alarm policies:

Table 1 Kafka instance metrics to configure alarm rules for

Metric ID

Metric

Alarm Policy

Metric Description and Alarm Handling

broker_disk_usage

Disk Capacity Usage

Alarm threshold: original value > 80%

Number of consecutive periods: 1

Alarm severity: critical

Metric description: disk usage of the Kafka VM.

Alarm handling: Modify the instance storage space. For details, see Modifying Instance Specifications.

broker_cpu_core_load

Average Load per CPU Core

Alarm threshold: original value > 2

Number of consecutive periods: 3

Alarm severity: major

Metric description: average load of each CPU core of the Kafka VM.

Alarm handling: Check whether the metric has been approaching or exceeding the alarm threshold for a long time. If yes, modify the instance bandwidth or the number of brokers. For details, see Modifying Instance Specifications.

broker_memory_usage

Memory Usage

Alarm threshold: original value > 90%

Number of consecutive periods: 3

Alarm severity: critical

Metric description: memory usage of the Kafka VM.

Alarm handling: Modify the instance bandwidth or the number of brokers. For details, see Modifying Instance Specifications.

current_partitions

Partitions

Alarm threshold: original value > 90% of the maximum allowed number of partitions. The partition limit varies depending on instance specifications. For details, see Specifications.

Number of consecutive periods: 1

Alarm severity: major

Metric description: number of used partitions in the instance.

Alarm handling: If new topics are required, modify the instance bandwidth or the number of brokers, or split the service to multiple instances. For details about how to modify the instance bandwidth or the number of brokers, see Modifying Instance Specifications.

broker_cpu_usage

CPU Usage

Alarm threshold: original value > 90%

Number of consecutive periods: 3

Alarm severity: major

Metric description: CPU usage of the Kafka VM.

Alarm handling: Check whether the metric has been approaching or exceeding the alarm threshold for a long time. If yes, modify the instance bandwidth or the number of brokers. For details, see Modifying Instance Specifications.

group_msgs

Accumulated Messages

Alarm threshold: original value > 90% of the upper limit. The upper limit is customized.

Number of consecutive periods: 1

Alarm severity: major

Metric description: total number of accumulated messages in all consumer groups of the instance.

Alarm handling: Delete idle consumer groups, if any. You can also accelerate message retrieval, for example, by increasing the number of consumers.

topic_messages_remained

Topic Available Messages

Alarm threshold: original value > 90% of the upper limit. The upper limit is customized.

Number of consecutive periods: 1

Alarm severity: major

Metric description: number of remaining messages that can be retrieved from the specified topic in the consumer group.

Alarm handling: Check whether the consumer code logic is correct, for example, by checking whether the consumer stops consuming messages due to an exception. You can also accelerate message retrieval, for example, by adding topic consumers. Ensure that the number of partitions is greater than or equal to the number of consumers.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Application > Distributed Message Service for Kafka to open the console of DMS for Kafka.
  4. Click next to a Kafka instance name.

    You are redirected to the Cloud Eye console page displaying metrics of the selected instance.

  5. Hover the mouse pointer over a metric and click to create an alarm rule for the metric.
  6. Specify the alarm details.

    For more information about creating alarm rules, see Creating an Alarm Rule.

    1. Set the alarm name and description.
    2. Specify the alarm policy and alarm severity.

      As shown in the following figure, if the original disk capacity usage exceeds 85% for three consecutive periods, an alarm is generated. If the alarm is not handled on time, an alarm notification is sent.

      Figure 1 Setting the alarm policy and alarm severity
    3. Set the alarm notification configurations. If you enable Alarm Notification, set the validity period, notification object, and trigger condition.
    4. Click Create.