mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-07 16:54:16 +01:00
Account ephemeral setup keys metrics (#1128)
This commit is contained in:
parent
c9b2ce08eb
commit
7682fe2e45
@ -166,6 +166,8 @@ func (w *Worker) generateProperties() properties {
|
||||
peers int
|
||||
peersSSHEnabled int
|
||||
setupKeysUsage int
|
||||
ephemeralPeersSKs int
|
||||
ephemeralPeersSKUsage int
|
||||
activePeersLastDay int
|
||||
osPeers map[string]int
|
||||
userPeers int
|
||||
@ -224,6 +226,10 @@ func (w *Worker) generateProperties() properties {
|
||||
|
||||
for _, key := range account.SetupKeys {
|
||||
setupKeysUsage = setupKeysUsage + key.UsedTimes
|
||||
if key.Ephemeral {
|
||||
ephemeralPeersSKs++
|
||||
ephemeralPeersSKUsage = ephemeralPeersSKUsage + key.UsedTimes
|
||||
}
|
||||
}
|
||||
|
||||
for _, peer := range account.Peers {
|
||||
@ -269,6 +275,8 @@ func (w *Worker) generateProperties() properties {
|
||||
metricsProperties["peers_ssh_enabled"] = peersSSHEnabled
|
||||
metricsProperties["peers_login_expiration_enabled"] = expirationEnabled
|
||||
metricsProperties["setup_keys_usage"] = setupKeysUsage
|
||||
metricsProperties["ephemeral_peers_setup_keys"] = ephemeralPeersSKs
|
||||
metricsProperties["ephemeral_peers_setup_keys_usage"] = ephemeralPeersSKUsage
|
||||
metricsProperties["active_peers_last_day"] = activePeersLastDay
|
||||
metricsProperties["user_peers"] = userPeers
|
||||
metricsProperties["rules"] = rules
|
||||
|
Loading…
Reference in New Issue
Block a user