From db4a027e915173ba3c52b80a425fe8adafa89717 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 23 Nov 2022 12:53:49 -0500 Subject: [PATCH] add peer id to receive --- 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 b0c5c6479..a4564467b 100644 --- a/consensus/metrics.go +++ b/consensus/metrics.go @@ -274,7 +274,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Subsystem: MetricsSubsystem, Name: "vote_received", Help: "Number of votes of each type received.", - }, append(labels, "vote_type")).With(labelsAndValues...), + }, append(labels, "peer_id", "vote_type")).With(labelsAndValues...), PeerVoteCount: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ Namespace: namespace, Subsystem: MetricsSubsystem, diff --git a/consensus/reactor.go b/consensus/reactor.go index a2b175e97..f19812f78 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -234,7 +234,7 @@ func (conR *Reactor) ReceiveEnvelope(e p2p.Envelope) { } if m, ok := e.Message.(*consensus.Vote); ok { - conR.Metrics.VoteReceived.With("vote_type", m.Vote.Type.String()).Add(1) + conR.Metrics.VoteReceived.With("peer_id", string(e.Src.ID()), "vote_type", m.Vote.Type.String()).Add(1) } m := e.Message if wm, ok := m.(p2p.Wrapper); ok {