Add PeerDAS metrics to track subnets without peers (#6928)

Currently we track a key metric `PEERS_PER_COLUMN_SUBNET` in a getter `good_peers_on_sampling_subnets`. Another PR https://github.com/sigp/lighthouse/pull/6922 deletes that function, so we have to move the metric anyway. This PR moves that metric computation to the metrics spawned task which is refreshed every 5 seconds.

I also added a few more useful metrics. The total set and intended usage is:

- `sync_peers_per_column_subnet`: Track health of overall subnets in your node
- `sync_peers_per_custody_column_subnet`: Track health of the subnets your node needs. We should track this metric closely in our dashboards with a heatmap and bar plot
- ~~`sync_column_subnets_with_zero_peers`: Is equivalent to the Grafana query `count(sync_peers_per_column_subnet == 0) by (instance)`. We may prefer to skip it, but I believe it's the most important metric as if `sync_column_subnets_with_zero_peers > 0` your node stalls.~~
- ~~`sync_custody_column_subnets_with_zero_peers`: `count(sync_peers_per_custody_column_subnet == 0) by (instance)`~~
This commit is contained in:
Lion - dapplion
2025-02-11 03:56:38 -03:00
committed by GitHub
parent 3992d6ba74
commit d60388134d
3 changed files with 46 additions and 14 deletions

View File

@@ -234,6 +234,11 @@ impl<E: EthSpec> PeerInfo<E> {
self.custody_subnets.contains(subnet)
}
/// Returns an iterator on this peer's custody subnets
pub fn custody_subnets_iter(&self) -> impl Iterator<Item = &DataColumnSubnetId> {
self.custody_subnets.iter()
}
/// Returns true if the peer is connected to a long-lived subnet.
pub fn has_long_lived_subnet(&self) -> bool {
// Check the meta_data