From 7885d900e07f59b3cc2ae559976ebfbd1276c785 Mon Sep 17 00:00:00 2001 From: AkshatGada <96907514+AkshatGada@users.noreply.github.com> Date: Thu, 30 May 2024 22:47:56 +0530 Subject: [PATCH] added warning if node is unhealthy --- packages/validator/src/validator.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/validator/src/validator.ts b/packages/validator/src/validator.ts index 8590fc1d006..c769912d07c 100644 --- a/packages/validator/src/validator.ts +++ b/packages/validator/src/validator.ts @@ -136,7 +136,10 @@ export class Validator { this.clock.runEverySlot(() => this.fetchBeaconHealth() - .then((health) => metrics.beaconHealth.set(health)) + .then((health) => {metrics.beaconHealth.set(health); + if(health == 0){ + this.logger.warn("Node is unhealthy"); + }}) .catch((e) => this.logger.error("Error on fetchBeaconHealth", {}, e)) ); }