From f77885b1c128a250b86d998384f4307869266771 Mon Sep 17 00:00:00 2001 From: nischit Date: Mon, 27 Oct 2025 18:19:51 +0545 Subject: [PATCH] is committer live metric --- internal/committer/poollatest.go | 4 ++++ internal/metrics/metrics.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/internal/committer/poollatest.go b/internal/committer/poollatest.go index fc2af26..9380044 100644 --- a/internal/committer/poollatest.go +++ b/internal/committer/poollatest.go @@ -76,6 +76,10 @@ func pollLatest() error { nextBlockNumber = expectedBlockNumber metrics.CommitterNextBlockNumber.WithLabelValues(indexerName, chainIdStr).Set(float64(nextBlockNumber)) + if config.Cfg.CommitterIsLive { + metrics.CommitterIsLive.WithLabelValues(indexerName, chainIdStr).Set(1) + } + if !config.Cfg.CommitterIsLive && latestBlock.Int64()-int64(nextBlockNumber) < 20 && !hasRightsized { log.Debug(). Uint64("latest_block", latestBlock.Uint64()). diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index 6791c1d..8a7f417 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -94,4 +94,9 @@ var ( Name: "committer_rpc_retries_total", Help: "The total number of RPC retries", }, []string{"project_name", "chain_id"}) + + CommitterIsLive = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "committer_is_live", + Help: "Whether the committer is live", + }, []string{"project_name", "chain_id"}) )