Skip to content

Commit 8dcae92

Browse files
committed
improve checking vc_up metric
1 parent 207a517 commit 8dcae92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/prometheus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __init__(self, ton, local, *args, **kwargs):
3939

4040
def get_validator_status_metrics(self, result: list):
4141
status = self.ton.GetValidatorStatus()
42+
is_working = status.is_working or (status.unixtime is not None)
4243
if status.masterchain_out_of_sync is not None:
4344
result.append(METRICS['master_out_of_sync'].to_format(status.masterchain_out_of_sync))
4445
if status.shardchain_out_of_sync is not None:
@@ -49,7 +50,7 @@ def get_validator_status_metrics(self, result: list):
4950
result.append(METRICS['celldb_gc_block'].to_format(status.masterchainblock - status.gcmasterchainblock))
5051
if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None:
5152
result.append(METRICS['celldb_gc_state'].to_format(status.gcmasterchainblock - status.last_deleted_mc_state))
52-
result.append(METRICS['vc_up'].to_format(int(status.is_working)))
53+
result.append(METRICS['vc_up'].to_format(int(is_working)))
5354

5455
def get_validator_validation_metrics(self, result: list):
5556
index = self.ton.GetValidatorIndex()

0 commit comments

Comments
 (0)