diff --git a/pkg/scraper/strategy.go b/pkg/scraper/strategy.go index 1efbe73..d44474b 100644 --- a/pkg/scraper/strategy.go +++ b/pkg/scraper/strategy.go @@ -161,11 +161,12 @@ func (s *scraper) scrapeStruct( } vID := componentID(v) - if c, ok := s.typeCounters[vID]; ok && c > maxRecursiveScrapes { + vUsageKey := fmt.Sprintf("%s-%s", parentID, vID) + if c, ok := s.typeCounters[vUsageKey]; ok && c > maxRecursiveScrapes { s.debug(v, "struct is being used recursively, skipping") return } else { - s.typeCounters[vID]++ + s.typeCounters[vUsageKey]++ } var c model.Component