buvb opened a new pull request, #1662: URL: https://github.com/apache/fluss/pull/1662
### Purpose Linked issue: close #1571 This PR adds partition count metrics to help users monitor partition distribution across tables and the entire cluster. This addresses the issue where users create many unexpected partitions that can cause cluster instability, making it difficult to locate such problems without proper metrics. ### Brief change log - **Added metric names**: `PARTITION_COUNT` for table-level and `TOTAL_PARTITION_COUNT` for cluster-level monitoring - **Implemented MutableGauge**: A thread-safe, updatable gauge implementation for dynamic partition count tracking - **Enhanced CoordinatorMetricGroup**: Added cluster-wide total partition count metric - **Enhanced PhysicalTableMetricGroup**: Added per-table partition count metric - **Real-time updates**: Implemented event-driven metric updates when partitions are added/removed - **Updated CoordinatorContext**: Added methods to retrieve partition counts and callback mechanism for real-time updates - **Updated TabletServerMetadataCache**: Added partition count metric updates when metadata changes ### API and Format - **New Metrics**: - `partitionCount`: Per-table partition count (Integer gauge) - `totalPartitionCount`: Cluster-wide partition count (Integer gauge) - **No breaking changes**: All changes are additive and backward compatible ### Documentation This change introduces new monitoring capabilities: - **Table-level monitoring**: Track partition count per table to identify tables with excessive partitions - **Cluster-level monitoring**: Track total partition count across the cluster to prevent cluster instability - **Real-time updates**: Metrics reflect partition changes immediately without polling delays -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@fluss.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org