mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 10:30:38 +00:00
This series introduces per-table metrics support for Alternator. It includes the following commits: Add optional per-table metrics for Alternator Introduces a shared_ptr-based mechanism that allows Alternator to register per-table metrics. These metrics follow the table's lifecycle, similar to how CQL metrics are handled. The use of shared_ptr ensures no direct dependency between table stats and Alternator. Enable registration of stats objects per table Adds support for registering a stats object using a keyspace and table name. Per-table metrics are prefixed with alternator_table to differentiate them from per-shard metrics. Metrics are reported once per node, and those not meaningful at the table level (e.g. create/delete) are excluded. All metrics use the skip_when_empty flag. Update per-table metrics handling Adds a helper function to retrieve the stats object from a table schema. Updates both per-shard and per-table metrics, resulting in some code duplication. Add tests for per-table metrics Extends existing tests to also validate the per-table metrics. These tests ensure that the new metrics are correctly registered and updated. This series improves observability in Alternator by enabling fine-grained per-table metrics without disrupting existing per-shard metrics. **No need to backport** Fixes #19824 Closes scylladb/scylladb#24046 * github.com:scylladb/scylladb: alternator/test_metrics.py: Test the per-table metrics alternator/executor.cc: Update per-table metrics alternator/stats: Add per-table metrics replica/database.hh: Add alternator per-table metrics alternator/stats.hh: Introduce a per-table stats container