Back to Yugabyte Db

Monitor CDC (gRPC replication) in YugabyteDB

docs/content/v2024.2/additional-features/change-data-capture/using-yugabytedb-grpc-replication/cdc-monitor.md

2026.1.0.0-b296.9 KB
Original Source

Status of the deployed connector

You can use the rest APIs to monitor your deployed connectors. The following operations are available:

  • List all connectors

    sh
    curl -X GET localhost:8083/connectors/
    
  • Get a connector's configuration

    sh
    curl -X GET localhost:8083/connectors/<connector-name>
    
  • Get the status of all tasks with their configuration

    sh
    curl -X GET localhost:8083/connectors/<connector-name>/tasks
    
  • Get the status of the specified task

    sh
    curl -X GET localhost:8083/connectors/<connector-name>/tasks/<task-id>
    
  • Get the connector's status, and the status of its tasks

    sh
    curl -X GET localhost:8083/connectors/<connector-name>/status
    

{{< note title= "How to check task status">}}

It is possible that upon retrieving the status of the connector, it can show a RUNNING state while no data is being ingested to Kafka. As a connector consists of one or more tasks, the tasks have likely failed, independently from the connector. To verify this, you need to check for the status of the tasks.

To show the status, use the following command:

sh
curl -X GET localhost:8083/connectors/<connector-name>/status

You can also get the status of a specific task by passing in the task ID as follows:

sh
curl -X GET localhost:8083/connectors/<connector-name>/tasks/<task-id>/status

{{< /note >}}

Metrics

In addition to the built-in support for JMX metrics that Zookeeper, Kafka, and Kafka Connect provide, the YugabyteDB source connector provides the following types of metrics.

CDC service metrics

Provide information about the CDC service in YugabyteDB.

Metric nameTypeDescription
cdcsdk_change_event_countlongThe Change Event Count metric shows the number of records sent by the CDC Service.
cdcsdk_traffic_sentlongTotal traffic sent, in bytes.
cdcsdk_sent_lag_microslongThe LAG metric is calculated by subtracting the timestamp of the latest record in the WAL of a tablet from the last record sent to the CDC connector.
cdcsdk_expiry_time_mslongThe time left to read records from WAL is tracked by the Stream Expiry Time (ms).

CDC service metrics are calculated for every tablet that is of interest for a replication slot. In the scenario where you aren't interested in polling all the tables (and consequently all the tablets) in a database, the metrics are calculated considering the unpolled tablets until cdcsdk_tablet_not_of_interest_timeout_secs interval.

Snapshot metrics

The MBean is debezium.yugabytedb:type=connector-metrics,server=<database.server.name>,task=<task.id>,context=snapshot.

Snapshot metrics are only available when a snapshot operation is active, or if a snapshot has occurred since the last connector start. The following snapshot metrics are available:

Metric nameTypeDescription
LastEventstringThe last snapshot event that the connector has read.
MilliSecondsSinceLastEventlongThe number of milliseconds since the connector has read and processed the most recent event.
TotalNumberOfEventsSeenlongThe total number of events that this connector has seen since the last start or metrics reset.
NumberOfEventsFilteredlongThe number of events that have been filtered by include/exclude list filtering rules configured on the connector.
QueueTotalCapacityintThe length the queue used to pass events between the snapshotter and the main Kafka Connect loop.
QueueRemainingCapacityintThe free capacity of the queue used to pass events between the snapshotter and the main Kafka Connect loop.
SnapshotRunningbooleanWhether the snapshot is currently running.
SnapshotPausedbooleanWhether the snapshot was paused one or more times.
SnapshotAbortedbooleanWhether the snapshot has been aborted.
SnapshotCompletedbooleanWhether the snapshot has been completed.
SnapshotDurationInSecondslongThe total number of seconds that the snapshot has taken so far, even if not complete. Includes also time when snapshot was paused.
SnapshotPausedDurationInSecondslongThe total number of seconds that the snapshot was paused. If the snapshot was paused more than once, this is the cumulative pause time.
MaxQueueSizeInByteslongThe maximum buffer of the queue, in bytes. This metric is available if max.queue.size.in.bytes is set to a positive long value.
CurrentQueueSizeInByteslongThe current volume, in bytes, of records in the queue.

Streaming metrics

The MBean is debezium.yugabytedb:type=connector-metrics,server=<database.server.name>,task=<task.id>,context=streaming.

The following streaming metrics are available:

Metric nameTypeDescription
LastEventstringThe last streaming event that the connector has read.
MilliSecondsSinceLastEventlongThe number of milliseconds since the connector has read and processed the most recent event.
TotalNumberOfEventsSeenlongThe total number of events that this connector has seen since the last start or metrics reset.
TotalNumberOfCreateEventsSeenlongThe total number of create events that this connector has seen since the last start or metrics reset.
TotalNumberOfUpdateEventsSeenlongThe total number of update events that this connector has seen since the last start or metrics reset.
TotalNumberOfDeleteEventsSeenlongThe total number of delete events that this connector has seen since the last start or metrics reset.
NumberOfEventsFilteredlongThe total number of events (since the last start or metrics reset) that have been filtered by include/exclude list filtering rules configured on the connector.
QueueTotalCapacityintThe length the queue used to pass events between the streamer and the main Kafka Connect loop.
QueueRemainingCapacityintThe free capacity of the queue used to pass events between the streamer and the main Kafka Connect loop.
ConnectedbooleanIndicates whether the connector is currently connected to the database server.
MilliSecondsBehindSourcelongThe number of milliseconds between the last change event's timestamp and when the connector processed it. The value incorporates any differences between the clocks on the machines where the database server and the connector are running.
SourceEventPositionMap<String, String>The coordinates of the last received event.
LastTransactionIdstringTransaction identifier of the last processed transaction.
MaxQueueSizeInByteslongThe maximum buffer of the queue in bytes. This metric is available if max.queue.size.in.bytes is set to a positive long value.
CurrentQueueSizeInByteslongThe current volume, in bytes, of records in the queue.