From 0340b278cffca3411eae2d3de49c2b968a341efe Mon Sep 17 00:00:00 2001 From: yungwine Date: Tue, 28 Jan 2025 11:14:36 +0400 Subject: [PATCH] skip masterchain_out_of_ser and celldb_gc_state metrics if zero values --- modules/prometheus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prometheus.py b/modules/prometheus.py index 598695ac..203872fa 100644 --- a/modules/prometheus.py +++ b/modules/prometheus.py @@ -44,11 +44,11 @@ def get_validator_status_metrics(self, result: list): result.append(METRICS['master_out_of_sync'].to_format(status.masterchain_out_of_sync)) if status.shardchain_out_of_sync is not None: result.append(METRICS['shard_out_of_sync'].to_format(status.shardchain_out_of_sync)) - if status.masterchain_out_of_ser is not None: + if status.masterchain_out_of_ser is not None and status.stateserializermasterchainseqno != 0: result.append(METRICS['out_of_ser'].to_format(status.masterchain_out_of_ser)) if status.masterchainblock is not None and status.gcmasterchainblock is not None: result.append(METRICS['celldb_gc_block'].to_format(status.masterchainblock - status.gcmasterchainblock)) - if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None: + if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None and status.last_deleted_mc_state != 0: result.append(METRICS['celldb_gc_state'].to_format(status.gcmasterchainblock - status.last_deleted_mc_state)) result.append(METRICS['vc_up'].to_format(int(is_working)))