Skip to content

Commit 79aa845

Browse files
authored
Merge pull request #419 from yungwine/prometheus
skip masterchain_out_of_ser and celldb_gc_state metrics if zero values
2 parents 44d83f0 + 0340b27 commit 79aa845

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/prometheus.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def get_validator_status_metrics(self, result: list):
4444
result.append(METRICS['master_out_of_sync'].to_format(status.masterchain_out_of_sync))
4545
if status.shardchain_out_of_sync is not None:
4646
result.append(METRICS['shard_out_of_sync'].to_format(status.shardchain_out_of_sync))
47-
if status.masterchain_out_of_ser is not None:
47+
if status.masterchain_out_of_ser is not None and status.stateserializermasterchainseqno != 0:
4848
result.append(METRICS['out_of_ser'].to_format(status.masterchain_out_of_ser))
4949
if status.masterchainblock is not None and status.gcmasterchainblock is not None:
5050
result.append(METRICS['celldb_gc_block'].to_format(status.masterchainblock - status.gcmasterchainblock))
51-
if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None:
51+
if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None and status.last_deleted_mc_state != 0:
5252
result.append(METRICS['celldb_gc_state'].to_format(status.gcmasterchainblock - status.last_deleted_mc_state))
5353
result.append(METRICS['vc_up'].to_format(int(is_working)))
5454

0 commit comments

Comments
 (0)