Back to Yugabyte Db

Monitor CDC (logical replication) in YugabyteDB

docs/content/v2024.1/additional-features/change-data-capture/using-logical-replication/monitor.md

2026.1.0.0-b254.4 KB
Original Source

Catalog objects and views

pg_publication

Contains all publication objects contained in the database.

Column nameData typeDescription
oidoidRow identifier
pubnamenameName of the publication
pubowneroidOID of the owner.
puballtablesboolIf true, this publication includes all tables in the database including those added in the future.
pubinsertboolIf true, INSERT operations are replicated for tables in the publication.
pubupdateboolIf true, UPDATE operations are replicated for tables in the publication.
pubdeleteboolIf true, DELETE operations are replicated for tables in the publication.
pubtruncateboolIf true, TRUNCATE operations are replicated for tables in the publication.

pg_publication_rel

Contains mapping between publications and tables. This is a many-to-many mapping.

Column nameData typeDescription
oidoidRow identifier.
prpubidoidOID of the publication. References pg_publication.oid.
prrelidoidOID of the relation. References pg_class.oid.

pg_publication_tables

Contains mapping between publications and tables. It is a wrapper over pg_publication_rel as it expands the publications defined as FOR ALL TABLES, so for such publications there will be a row for each eligible table.

Column nameData typeDescription
pubnamenameName of publication.
schemanamenameName of schema containing table.
tablenamenameName of table.

pg_replication_slots

Provides a list of all replication slots that currently exist on the database cluster, along with their metadata.

Column nameData typeDescription
slot_namenameName of the replication slot.
pluginnameOutput plugin name (Always yboutput).
slot_typetextAlways logical.
datoidoidThe OID of the database this slot is associated with.
databasetextThe name of the database this slot is associated with.
temporarybooleanTrue if this is a temporary replication slot. Temporary slots are automatically dropped on error or when the session has finished.
activebooleanTrue if this slot is currently actively being used. In YSQL, an "active" replication slot means a slot which has been consumed at least once in a certain time frame. The time is defined using the ysql_cdc_active_replication_slot_window_ms flag, which has a default of 5 minutes.
active_pidintegerThe process ID of the session using this slot if the slot is currently actively being used. NULL if no replication process is ongoing.
xminxidThe oldest transaction that this slot needs the database to retain.
catalog_xminxidNot applicable for YSQL. Always set to xmin.
restart_lsnpg_lsnThe Log Sequence Number (LSN) of the oldest change record which still might be required by the consumer of this slot and thus won't be automatically removed during checkpoints.
confirmed_flush_lsnpg_lsnThe LSN up to which the logical slot's consumer has confirmed receiving data. Data older than this is not available anymore. Transactions with commit LSN lower than the confirmed_flush_lsn are not available anymore.
yb_stream_idtextUUID of the CDC stream
yb_restart_commit_htint8A uint64 representation of the commit Hybrid Time corresponding to the restart_lsn. This can be used by the client (like YugabyteDB connector) to perform a consistent snapshot (as of the consistent_point) in the case when a replication slot already exists.

CDC Service metrics

Provide information about CDC service in YugabyteDB.

Metric nameTypeDescription
cdcsdk_change_event_countlongThe 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).

Connector metrics

<!-- TODO (Siddharth): Fix link to connector metrics section -->

Refer to Monitoring for information on YugabyteDB connector metrics.