From 6a6eee643327eb5ef21251880800c6edf81a893e Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 6 Aug 2024 14:53:38 -0700 Subject: [PATCH] fix(zetaclient): use name in pending tx metric (#2642) --- zetaclient/context/chain.go | 4 ++++ zetaclient/orchestrator/orchestrator.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/zetaclient/context/chain.go b/zetaclient/context/chain.go index b3ec993766..a5c17768f1 100644 --- a/zetaclient/context/chain.go +++ b/zetaclient/context/chain.go @@ -132,6 +132,10 @@ func (c Chain) ID() int64 { return c.chainInfo.ChainId } +func (c Chain) Name() string { + return c.chainInfo.Name +} + func (c Chain) Params() *observer.ChainParams { return c.observerParams } diff --git a/zetaclient/orchestrator/orchestrator.go b/zetaclient/orchestrator/orchestrator.go index 36e1046b2e..884cbdc485 100644 --- a/zetaclient/orchestrator/orchestrator.go +++ b/zetaclient/orchestrator/orchestrator.go @@ -372,7 +372,7 @@ func (oc *Orchestrator) runScheduler(ctx context.Context) error { cctxList := cctxMap[chainID] metrics.PendingTxsPerChain. - WithLabelValues(fmt.Sprintf("chain_%d", chainID)). + WithLabelValues(chain.Name()). Set(float64(len(cctxList))) if len(cctxList) == 0 {