Skip to content

Commit

Permalink
add selfhosted metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fischer committed Dec 27, 2024
1 parent b3c87cb commit 32accab
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions management/server/metrics/selfhosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ func (w *Worker) generateProperties(ctx context.Context) properties {
groups int
routes int
routesWithRGGroups int
networks int
networkResources int
networkRouters int
networkRoutersWithPG int
nameservers int
uiClient int
version string
Expand All @@ -219,6 +223,16 @@ func (w *Worker) generateProperties(ctx context.Context) properties {
}

groups += len(account.Groups)
networks += len(account.Networks)
networkResources += len(account.NetworkResources)

networkRouters += len(account.NetworkRouters)
for _, router := range account.NetworkRouters {
if len(router.PeerGroups) > 0 {
networkRoutersWithPG++
}
}

routes += len(account.Routes)
for _, route := range account.Routes {
if len(route.PeerGroups) > 0 {
Expand Down Expand Up @@ -312,6 +326,10 @@ func (w *Worker) generateProperties(ctx context.Context) properties {
metricsProperties["rules_with_src_posture_checks"] = rulesWithSrcPostureChecks
metricsProperties["posture_checks"] = postureChecks
metricsProperties["groups"] = groups
metricsProperties["networks"] = networks
metricsProperties["network_resources"] = networkResources
metricsProperties["network_routers"] = networkRouters
metricsProperties["network_routers_with_groups"] = networkRoutersWithPG
metricsProperties["routes"] = routes
metricsProperties["routes_with_routing_groups"] = routesWithRGGroups
metricsProperties["nameservers"] = nameservers
Expand Down

0 comments on commit 32accab

Please sign in to comment.