Skip to content

Commit

Permalink
Always enable service metrics and service summary aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Jan 17, 2023
1 parent ffa566f commit 7c033b1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
1 change: 1 addition & 0 deletions changelogs/head.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ https://github.com/elastic/apm-server/compare/8.6\...main[View commits]
- `transaction.success_count` has been moved to `event.success_count` {pull}9819[9819]
- Stop indexing transaction metrics to `metrics-apm.internal` {pull}9846[9846]
- Stop indexing span destination metrics to `metrics-apm.internal` {pull}9926[9926]
- Service metrics and service summary aggregations are always enabled {pull}9926[9926]

[float]
==== Deprecations
Expand Down
9 changes: 2 additions & 7 deletions internal/beater/config/aggregation.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ type ServiceDestinationAggregationConfig struct {

// ServiceAggregationConfig holds configuration related to service metrics aggregation.
type ServiceAggregationConfig struct {
Enabled bool `config:"enabled"`
MaxGroups int `config:"max_groups"` // if <= 0 then will be set based on memory limits
HDRHistogramSignificantFigures int `config:"hdrhistogram_significant_figures" validate:"min=1, max=5"`
MaxGroups int `config:"max_groups"` // if <= 0 then will be set based on memory limits
HDRHistogramSignificantFigures int `config:"hdrhistogram_significant_figures" validate:"min=1, max=5"`
}

func defaultAggregationConfig() AggregationConfig {
Expand All @@ -59,10 +58,6 @@ func defaultAggregationConfig() AggregationConfig {
MaxGroups: defaultServiceDestinationAggregationMaxGroups,
},
Service: ServiceAggregationConfig{
// NOTE(axw) service metrics are in technical preview,
// disabled by default. Once proven, they may be always
// enabled in a future release, without configuration.
Enabled: false,
HDRHistogramSignificantFigures: defaultServiceAggregationHDRHistogramSignificantFigures,
},
}
Expand Down
52 changes: 25 additions & 27 deletions x-pack/apm-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,32 @@ func newProcessors(args beater.ServerParams) ([]namedProcessor, error) {
}
processors = append(processors, namedProcessor{name: spanName, processor: spanAggregator})

if args.Config.Aggregation.Service.Enabled {
const serviceName = "service metrics aggregation"
args.Logger.Infof("creating %s with config: %+v", serviceName, args.Config.Aggregation.Service)
serviceAggregator, err := servicemetrics.NewAggregator(servicemetrics.AggregatorConfig{
BatchProcessor: args.BatchProcessor,
Interval: metricsInterval,
RollUpIntervals: rollUpMetricsIntervals,
MaxGroups: args.Config.Aggregation.Service.MaxGroups,
HDRHistogramSignificantFigures: args.Config.Aggregation.Service.HDRHistogramSignificantFigures,
})
if err != nil {
return nil, errors.Wrapf(err, "error creating %s", serviceName)
}
processors = append(processors, namedProcessor{name: serviceName, processor: serviceAggregator})

const serviceSummaryName = "service summary aggregation"
args.Logger.Infof("creating %s with config: %+v", serviceSummaryName, args.Config.Aggregation.Service)
serviceSummaryAggregator, err := servicesummarymetrics.NewAggregator(servicesummarymetrics.AggregatorConfig{
BatchProcessor: args.BatchProcessor,
Interval: metricsInterval,
RollUpIntervals: rollUpMetricsIntervals,
MaxGroups: args.Config.Aggregation.Service.MaxGroups,
})
if err != nil {
return nil, errors.Wrapf(err, "error creating %s", serviceSummaryName)
}
processors = append(processors, namedProcessor{name: serviceSummaryName, processor: serviceSummaryAggregator})
const serviceName = "service metrics aggregation"
args.Logger.Infof("creating %s with config: %+v", serviceName, args.Config.Aggregation.Service)
serviceAggregator, err := servicemetrics.NewAggregator(servicemetrics.AggregatorConfig{
BatchProcessor: args.BatchProcessor,
Interval: metricsInterval,
RollUpIntervals: rollUpMetricsIntervals,
MaxGroups: args.Config.Aggregation.Service.MaxGroups,
HDRHistogramSignificantFigures: args.Config.Aggregation.Service.HDRHistogramSignificantFigures,
})
if err != nil {
return nil, errors.Wrapf(err, "error creating %s", serviceName)
}
processors = append(processors, namedProcessor{name: serviceName, processor: serviceAggregator})

const serviceSummaryName = "service summary aggregation"
args.Logger.Infof("creating %s with config: %+v", serviceSummaryName, args.Config.Aggregation.Service)
serviceSummaryAggregator, err := servicesummarymetrics.NewAggregator(servicesummarymetrics.AggregatorConfig{
BatchProcessor: args.BatchProcessor,
Interval: metricsInterval,
RollUpIntervals: rollUpMetricsIntervals,
MaxGroups: args.Config.Aggregation.Service.MaxGroups,
})
if err != nil {
return nil, errors.Wrapf(err, "error creating %s", serviceSummaryName)
}
processors = append(processors, namedProcessor{name: serviceSummaryName, processor: serviceSummaryAggregator})

if args.Config.Sampling.Tail.Enabled {
const name = "tail sampler"
Expand Down

0 comments on commit 7c033b1

Please sign in to comment.