Skip to content

Commit

Permalink
node: fix block metric label (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
libotony authored May 28, 2024
1 parent 5fb5896 commit 27e60e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/thor/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 27e60e6

Please sign in to comment.