Skip to content

Commit

Permalink
feat: update metrics name
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Oct 22, 2022
1 parent 7cd95da commit 5464f11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func peerToMetrics(ts time.Time, deviceName string, peer *wgtypes.Peer) pmetric.
}

func appendPeerMetrics(ms pmetric.MetricSlice, peer *wgtypes.Peer, ts pcommon.Timestamp) {
gaugeI(ms, "peer.usage.rx_bytes", "By", peer.ReceiveBytes, ts)
gaugeI(ms, "peer.usage.tx_bytes", "By", peer.TransmitBytes, ts)
gaugeI(ms, "usage.rx_bytes", "By", peer.ReceiveBytes, ts)
gaugeI(ms, "usage.tx_bytes", "By", peer.TransmitBytes, ts)
}

func initMetric(ms pmetric.MetricSlice, name, unit string) pmetric.Metric {
m := ms.AppendEmpty()
m.SetName(fmt.Sprintf("device.%s", name))
m.SetName(fmt.Sprintf("peer.%s", name))
m.SetUnit(unit)
return m
}
Expand Down

0 comments on commit 5464f11

Please sign in to comment.