add peer id to receive

This commit is contained in:
William Banfield
2022-11-23 12:53:49 -05:00
parent 48061e204f
commit db4a027e91
2 changed files with 2 additions and 2 deletions

View File

@@ -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,

View File

@@ -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 {