Skip to content

Commit dd92175

Browse files
committed
Fix peer info metrics
1 parent 00b6470 commit dd92175

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rolling-shutter/p2p/dht.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func findPeers(ctx context.Context, h host.Host, d discovery.Discoverer, ns stri
9393
if p.ID == h.ID() {
9494
continue
9595
}
96-
metricsP2PPeerConnectedness.WithLabelValues(ourId, p.ID.String()).Add(float64(h.Network().Connectedness(p.ID)))
96+
metricsP2PPeerConnectedness.WithLabelValues(ourId, p.ID.String()).Set(float64(h.Network().Connectedness(p.ID)))
9797
peerPing := h.Peerstore().LatencyEWMA(p.ID)
9898
if peerPing != 0 {
9999
metricsP2PPeerPing.WithLabelValues(ourId, p.ID.String()).Set(peerPing.Seconds())

rolling-shutter/p2p/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var metricsP2PPeerPing = prometheus.NewGaugeVec(
5757

5858
func collectPeerAddresses(p peer.AddrInfo) {
5959
for _, multiAddr := range p.Addrs {
60-
metricsP2PPeerTuples.WithLabelValues(p.ID.String(), multiAddr.String()).Add(1)
60+
metricsP2PPeerTuples.WithLabelValues(p.ID.String(), multiAddr.String()).Set(1)
6161
}
6262
}
6363

0 commit comments

Comments
 (0)