From 27e60e6dd185ce452e7de5c692fa5ef2ae4c83cc Mon Sep 17 00:00:00 2001 From: libotony Date: Tue, 28 May 2024 17:41:21 +0800 Subject: [PATCH] node: fix block metric label (#762) --- cmd/thor/node/node.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/thor/node/node.go b/cmd/thor/node/node.go index 37938b688..62a18090a 100644 --- a/cmd/thor/node/node.go +++ b/cmd/thor/node/node.go @@ -409,17 +409,17 @@ func (n *Node) processBlock(newBlock *block.Block, stats *blockStats) (bool, err stats.UpdateQueued(1) case err == errBFTRejected: // TODO: capture metrics - log.Debug(fmt.Sprintf("block rejected by BFT engine: \n%v\n", newBlock.Header())) + log.Debug(fmt.Sprintf("block rejected by BFT engine\n%v\n", newBlock.Header())) case consensus.IsCritical(err): - msg := fmt.Sprintf(`failed to process block due to consensus failure \n%v\n`, newBlock.Header()) + msg := fmt.Sprintf(`failed to process block due to consensus failure\n%v\n`, newBlock.Header()) log.Error(msg, "err", err) default: log.Error("failed to process block", "err", err) } - metricBlockProcessedCount().AddWithLabel(1, map[string]string{"type": "proposed", "success": "false"}) + metricBlockProcessedCount().AddWithLabel(1, map[string]string{"type": "received", "success": "false"}) return false, err } - metricBlockProcessedCount().AddWithLabel(1, map[string]string{"type": "proposed", "success": "true"}) + metricBlockProcessedCount().AddWithLabel(1, map[string]string{"type": "received", "success": "true"}) return *isTrunk, nil }