diff --git a/providers/aws/aws.go b/providers/aws/aws.go index 7b1cc8f4d..8e2f7df02 100644 --- a/providers/aws/aws.go +++ b/providers/aws/aws.go @@ -6,6 +6,7 @@ import ( log "github.com/sirupsen/logrus" + "github.com/tailwarden/komiser/models" "github.com/tailwarden/komiser/providers" "github.com/tailwarden/komiser/providers/aws/apigateway" "github.com/tailwarden/komiser/providers/aws/cloudfront" @@ -121,8 +122,9 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } if telemetry { analytics.TrackEvent("discovered_resources", map[string]interface{}{ - "provider": "AWS", - "resources": len(resources), + "provider": "AWS", + "resources": len(resources), + "dependencies": calculateDependencies(resources), }) } } @@ -131,6 +133,14 @@ func FetchResources(ctx context.Context, client providers.ProviderClient, region } } +func calculateDependencies(resources []models.Resource) int { + total := 0 + for _, resource := range resources { + total += len(resource.Relations) + } + return total +} + func getRegions() []string { return []string{"us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-north-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1"} }