cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.19k stars 3.82k forks source link

changefeedccl: add metric tables_watched #118379

Open amruss opened 10 months ago

amruss commented 10 months ago

Add a metric changefeed_tables_watched, that takes the number of tables watched across all changefeeds and aggregates them together. We would expect this number to always be larges than num_changefeeds, since each changefeed watches at least one table.

We may want to change the name if split column tables are counted as multiple "watched tables" even though they are logically one table.

This is important for the cloud 2.0 work and should be backported.

Jira issue: CRDB-35700

blathers-crl[bot] commented 10 months ago

cc @cockroachdb/cdc

miretskiy commented 10 months ago

The metric is fairly straigh forward to add. See change frontier "closeMetrics" method.