Skip to content

Commit

Permalink
Add routing groups metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon committed Sep 29, 2023
1 parent c81b83b commit 0c1aaf4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions management/server/metrics/selfhosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func (w *Worker) generateProperties() properties {
rulesDirection map[string]int
groups int
routes int
routesWithRGGroups int
nameservers int
uiClient int
version string
Expand All @@ -201,6 +202,11 @@ func (w *Worker) generateProperties() properties {

groups = groups + len(account.Groups)
routes = routes + len(account.Routes)
for _, route := range account.Routes {
if len(route.PeerGroups) > 0 {
routesWithRGGroups++
}
}
nameservers = nameservers + len(account.NameServerGroups)

for _, policy := range account.Policies {
Expand Down Expand Up @@ -282,6 +288,7 @@ func (w *Worker) generateProperties() properties {
metricsProperties["rules"] = rules
metricsProperties["groups"] = groups
metricsProperties["routes"] = routes
metricsProperties["routes_with_routing_groups"] = routesWithRGGroups
metricsProperties["nameservers"] = nameservers
metricsProperties["version"] = version
metricsProperties["min_active_peer_version"] = minActivePeerVersion
Expand Down

0 comments on commit 0c1aaf4

Please sign in to comment.