Monitoring the state of Apache Kafka® clusters and hosts
Data on the cluster and host state is available in the management console
Diagnostic information about cluster states is presented as graphs.
Chart update rate:
- Standard hosts and hosts with an increased RAM to vCPU ratio (
memory-optimized): 15 seconds. - Hosts with a guaranteed vCPU share under 100% (
burstable): 150 seconds.
Note
The most appropriate multiple units (MB, GB, and more) are automatically used in charts.
You can configure alerts in Yandex Monitoring to receive notifications about cluster failures. In Yandex Monitoring, there are two alert thresholds: Warning and Alarm. If the specified threshold is exceeded, you will receive alerts via the configured notification channels.
Monitoring cluster state
To view detailed information about the Managed Service for Apache Kafka® cluster state:
-
In the management console
, go to the appropriate folder. -
In the list of services, select Managed Service for Kafka.
-
Click the cluster name and open the Monitoring tab.
-
To get started with Yandex Monitoring metrics, dashboards, or alerts, click Open in Monitoring in the top panel.
The page displays the following charts:
- Alive brokers: Number of functional brokers for each host with the
KAFKArole. - Offline partitions: Displays the parameter values below:
OfflineReplicaCount: Number of partitions without a leader. These partitions do not support message writes or reads.Underreplicated partitions: Number of partitions whose replication factor is greater than the number of their in-sync replicas (ISRs).Under min ISR partitions: Number of partitions with a number of in-sync replicas below the minimum allowed value specified in the settings.
- Errors: Number of failed requests by error type.
- Free space: Free disk space for each host with the
KAFKArole, in bytes. - Messages in: Message write rate, in messages per second.
- Bytes In/Out: Write and message read speed for each host with the
KAFKArole, in bytes per second. - Top 5 topics by size: Amount of data for each of the 5 largest topics, in bytes.
- Replicated bytes: Replication data streaming rate for each host with the
KAFKArole, in bytes per second. - Partitions: Total number of partition replicas.
- Replication lag [messages]: Greatest replication lag for each host with the
KAFKArole, in messages. - Request time (0.95 quantile): Request processing time in the 0.95 quantile by request type.
- Requests: Request rate by request type, in requests per second.
Monitoring the state of hosts
To view detailed information about the state of individual Managed Service for Apache Kafka® hosts:
- In the management console
, go to the appropriate folder. - In the list of services, select Managed Service for Kafka.
- Click the cluster name and select the Hosts → Monitoring tab.
- Select the host from the drop-down list.
This page displays charts showing the load on an individual host in the cluster:
- CPU usage: Usage of processor cores. As the load goes up, the
Idlevalue goes down. - Memory usage: Use of RAM, in bytes. At high loads, the
Freevalue goes down, while the other values go up. - Disk read/write bytes: Speed of disk operations, in bytes per second.
- Disk IOPS: Number of disk operations per second.
- Network bytes: Speed of data exchange over the network, in bytes per second.
- Network packets: Number of packets exchanged over the network, per second.
- Free space: Free disk space, in bytes.
Alert settings in Yandex Monitoring
To configure cluster and host state metric alerts:
- In the management console
, select the folder with the cluster you want to configure alerts for. - In the list of services, select
Monitoring. - Under Service dashboards, select Managed Service for Apache Kafka® — Cluster Overview.
- In the chart you need, click
and select Create alert. - If the chart shows multiple metrics, select a data query to generate a metric and click Continue. You can learn more about the query language in the Yandex Monitoring documentation.
- Set the
AlarmandWarningthreshold values to trigger the alert. - Click Create alert.
To have other cluster health indicators monitored automatically:
- Create an alert.
- Add a status metric.
- In the alert parameters, set the alert thresholds.
The recommended thresholds for some metrics are as follows:
| Metric | Parameter | Alarm |
Warning |
|---|---|---|---|
| Number of healthy hosts | kafka_is_alive |
<number of hosts> - 2 |
<number of hosts> - 1 |
| Partition replication state | kafka_server_ReplicaManager_UnderReplicatedPartitions |
— | Greater than 0 |
| Number of lagging replicas | kafka_server_ReplicaManager_UnderMinIsrPartitionCount |
Greater than 0 |
— |
| Storage space used | disk.used_bytes |
90% of the storage size | 80% of the storage size |
For the disk.used_bytes metric, the Alarm and Warning thresholds are only set in bytes. For example, the recommended values for a 100 GB disk are as follows:
Alarm:96,636,764,160bytes (90%)Warning:85,899,345,920bytes (80%)
You can view the current storage size in the detailed information about the cluster. For a complete list of supported metrics, see the Monitoring documentation.
Cluster state and status
The State of a cluster shows the health of its hosts, while the Status shows whether the cluster is started, stopped, or is at an intermediate stage.
To view a cluster's state and status:
- Go to the folder page
and select Managed Service for Kafka. - Hover over the indicator in the Availability column in the required cluster row.
Cluster states
| State | Description | Suggested actions |
|---|---|---|
| ALIVE | Cluster is operating normally. | No action is required. |
| DEGRADED | Cluster is not running at its full capacity: the state of at least one of the hosts is other than ALIVE. |
Run the diagnostics:
|
| DEAD | The cluster is down: none of its hosts are running. | Make a support request
|
| UNKNOWN | Cluster state is unknown. | Make a support request
|
Cluster statuses
| Status | Description | Suggested actions |
|---|---|---|
| CREATING | Preparing for the first start | Wait a while and get started. The time it takes to create a cluster depends on the host class. |
| RUNNING | The cluster is operating normally | No action is required. |
| STOPPING | The cluster is stopping | After a while, the cluster status will switch to STOPPED and the cluster will be disabled. No action is required. |
| STOPPED | The cluster is stopped | Start the cluster to get it running again. |
| STARTING | Starting the cluster that was stopped earlier | After a while, the cluster status will switch to RUNNING. Wait a while and get started. |
| UPDATING | Updating the cluster's configuration | Once the update is complete, the cluster will get the status it had prior to the update: RUNNING or STOPPED. |
| ERROR | Error when performing an operation with the cluster or during a maintenance window | If the cluster remains in this status for a long time, contact support |
| STATUS_UNKNOWN | The cluster is unable to determine its status | If the cluster remains in this status for a long time, contact support |