mirror of
https://github.com/h44z/wg-portal.git
synced 2026-03-23 16:46:24 +00:00
feat(metrics): add user label to peer metrics (#647)
This commit is contained in:
@@ -30,7 +30,7 @@ type MetricsServer struct {
|
||||
// Wireguard metrics labels
|
||||
var (
|
||||
ifaceLabels = []string{"interface"}
|
||||
peerLabels = []string{"interface", "addresses", "id", "name"}
|
||||
peerLabels = []string{"interface", "addresses", "id", "name", "user"}
|
||||
)
|
||||
|
||||
// NewMetricsServer returns a new prometheus server
|
||||
@@ -126,6 +126,7 @@ func (m *MetricsServer) UpdatePeerMetrics(peer *domain.Peer, status domain.PeerS
|
||||
peer.Interface.AddressStr(),
|
||||
string(status.PeerId),
|
||||
peer.DisplayName,
|
||||
string(peer.UserIdentifier),
|
||||
}
|
||||
|
||||
if status.LastHandshake != nil {
|
||||
|
||||
Reference in New Issue
Block a user