label vote sent with peer_id

This commit is contained in:
William Banfield
2022-11-23 12:46:14 -05:00
parent a46e11c36d
commit 48061e204f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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())))