Skip to content

Commit

Permalink
Use apm-server limits
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Jul 11, 2023
1 parent 6ecf778 commit 92a3c21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions x-pack/apm-server/aggregation/lsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Aggregator struct {
// NewAggregator returns a new instance of aggregator.
func NewAggregator(
ctx context.Context,
maxSvcs int, maxTxGroups int,
nextProcessor modelpb.BatchProcessor,
logger *logp.Logger,
) (*Aggregator, error) {
Expand All @@ -37,14 +38,14 @@ func NewAggregator(
baseaggregator, err := aggregators.New(
aggregators.WithDataDir(dir),
aggregators.WithLimits(aggregators.Limits{
MaxSpanGroups: 1000,
MaxSpanGroupsPerService: 100,
MaxTransactionGroups: 1000,
MaxTransactionGroupsPerService: 100,
MaxServiceTransactionGroups: 1000,
MaxServiceTransactionGroupsPerService: 100,
MaxServiceInstanceGroupsPerService: 100,
MaxServices: 1000,
MaxSpanGroups: 10000,
MaxSpanGroupsPerService: 1000,
MaxTransactionGroups: maxTxGroups,
MaxTransactionGroupsPerService: maxTxGroups / 10,
MaxServiceTransactionGroups: maxSvcs,
MaxServiceTransactionGroupsPerService: maxSvcs / 10,
MaxServiceInstanceGroupsPerService: maxSvcs / 10,
MaxServices: maxSvcs,
}),
aggregators.WithProcessor(wrapNextProcessor(nextProcessor)),
aggregators.WithAggregationIntervals([]time.Duration{time.Minute, 10 * time.Minute, time.Hour}),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/apm-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func newProcessors(args beater.ServerParams) ([]namedProcessor, error) {
processors := make([]namedProcessor, 0)

name := "LSM aggregator"
agg, err := aggregation.NewAggregator(context.TODO(), args.BatchProcessor, args.Logger)
agg, err := aggregation.NewAggregator(context.TODO(), args.Config.Aggregation.Transactions.MaxServices, args.Config.Aggregation.Transactions.MaxTransactionGroups, args.BatchProcessor, args.Logger)
if err != nil {
return nil, errors.Wrapf(err, "error creating %s", name)
}
Expand Down

0 comments on commit 92a3c21

Please sign in to comment.