diff --git a/internal/beater/beater.go b/internal/beater/beater.go index 2bbd53a1ae2..f6c7f5e4d53 100644 --- a/internal/beater/beater.go +++ b/internal/beater/beater.go @@ -253,7 +253,7 @@ func (s *Runner) Run(ctx context.Context) error { if s.config.Aggregation.ServiceDestinations.MaxGroups <= 0 { s.config.Aggregation.ServiceDestinations.MaxGroups = linearScaledValue(5_000, memLimitGB, 5_000) s.logger.Infof("Aggregation.ServiceDestinations.MaxGroups set to %d based on %0.1fgb of memory", - s.config.Aggregation.Transactions.MaxGroups, memLimitGB, + s.config.Aggregation.ServiceDestinations.MaxGroups, memLimitGB, ) } diff --git a/internal/beater/config/aggregation.go b/internal/beater/config/aggregation.go index 3163d30ba1e..8f4f9c76b57 100644 --- a/internal/beater/config/aggregation.go +++ b/internal/beater/config/aggregation.go @@ -17,10 +17,6 @@ package config -const ( - defaultServiceDestinationAggregationMaxGroups = 10000 -) - // AggregationConfig holds configuration related to various metrics aggregations. type AggregationConfig struct { MaxServices int `config:"max_services"` // if <= 0 then will be set based on memory limits @@ -36,7 +32,7 @@ type TransactionAggregationConfig struct { // ServiceDestinationAggregationConfig holds configuration related to span metrics aggregation for service maps. type ServiceDestinationAggregationConfig struct { - MaxGroups int `config:"max_groups" validate:"min=1"` + MaxGroups int `config:"max_groups"` // if <= 0 then will be set based on memory limits } // ServiceTransactionAggregationConfig holds configuration related to service transaction metrics aggregation. @@ -45,9 +41,5 @@ type ServiceTransactionAggregationConfig struct { } func defaultAggregationConfig() AggregationConfig { - return AggregationConfig{ - ServiceDestinations: ServiceDestinationAggregationConfig{ - MaxGroups: defaultServiceDestinationAggregationMaxGroups, - }, - } + return AggregationConfig{} } diff --git a/internal/beater/config/config_test.go b/internal/beater/config/config_test.go index b43f696dea3..71b4fd03a05 100644 --- a/internal/beater/config/config_test.go +++ b/internal/beater/config/config_test.go @@ -478,7 +478,7 @@ func TestUnpackConfig(t *testing.T) { MaxGroups: 0, // Default value is set as per memory limit }, ServiceDestinations: ServiceDestinationAggregationConfig{ - MaxGroups: 10000, + MaxGroups: 0, // Default value is set as per memory limit }, ServiceTransactions: ServiceTransactionAggregationConfig{ MaxGroups: 0, // Default value is set as per memory limit