From 48061e204f675874c51a0ffbeb81c3b4e1739301 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 23 Nov 2022 12:46:14 -0500 Subject: [PATCH] label vote sent with peer_id --- consensus/metrics.go | 2 +- consensus/reactor.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/metrics.go b/consensus/metrics.go index c3359b765..b0c5c6479 100644 --- a/consensus/metrics.go +++ b/consensus/metrics.go @@ -268,7 +268,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Subsystem: MetricsSubsystem, Name: "vote_sent", Help: "Number of votes of each type sent.", - }, append(labels, "vote_type")).With(labelsAndValues...), + }, append(labels, "peer_id", "vote_type")).With(labelsAndValues...), VoteReceived: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ Namespace: namespace, Subsystem: MetricsSubsystem, diff --git a/consensus/reactor.go b/consensus/reactor.go index c42778641..a2b175e97 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -1172,7 +1172,7 @@ func (ps *PeerState) PickSendVote(votes types.VoteSetReader) bool { Vote: vote.ToProto(), }, }, ps.logger) { - ps.conMetrics.VoteSent.With("vote_type", vote.Type.String()).Add(1) + ps.conMetrics.VoteSent.With("peer_id", string(ps.peer.ID()), "vote_type", vote.Type.String()).Add(1) ps.SetHasVote(vote) psVotes := ps.getVoteBitArray(votes.GetHeight(), votes.GetRound(), tmproto.SignedMsgType(votes.Type())) ps.conMetrics.PeerVoteCount.With("peer_id", string(ps.peer.ID()), "vote_type", vote.Type.String()).Set(float64(len(psVotes.GetTrueIndices())))