Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .chloggen/elasticexporte-batcher.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions exporter/elasticsearchexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,6 @@ func (cfg *Config) Validate() error {
if cfg.Retry.MaxRetries < 0 {
return errors.New("retry::max_retries should be non-negative")
}
if batcherCfg, ok := cfg.exporterbatcherConfig(); ok {
if err := batcherCfg.Validate(); err != nil {
return fmt.Errorf("invalid batcher config: %w", err)
}
}

return nil
}
Expand Down Expand Up @@ -319,18 +314,6 @@ func (cfg *Config) endpoints() ([]string, error) {
return endpoints, nil
}

func (cfg *Config) exporterbatcherConfig() (exporterbatcher.Config, bool) {
if cfg.Batcher.Enabled == nil {
return exporterbatcher.Config{}, false
}
return exporterbatcher.Config{
Enabled: *cfg.Batcher.Enabled,
FlushTimeout: cfg.Batcher.FlushTimeout,
MinSizeConfig: cfg.Batcher.MinSizeConfig,
MaxSizeConfig: cfg.Batcher.MaxSizeConfig,
}, true
}

func validateEndpoint(endpoint string) error {
if endpoint == "" {
return errConfigEmptyEndpoint
Expand Down
10 changes: 0 additions & 10 deletions exporter/elasticsearchexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,16 +425,6 @@ func TestConfig_Validate(t *testing.T) {
}),
err: `must not specify both retry::max_requests and retry::max_retries`,
},
"batcher max_size_items less than min_size_items": {
config: withDefaultConfig(func(cfg *Config) {
cfg.Endpoints = []string{"http://test:9200"}
cfg.Batcher.MaxSizeItems = 1000
cfg.Batcher.MinSizeItems = 2000
enableBatcher := true
cfg.Batcher.Enabled = &enableBatcher
}),
err: `max_size_items must be greater than or equal to min_size_items`,
},
}

for name, tt := range tests {
Expand Down
10 changes: 8 additions & 2 deletions exporter/elasticsearchexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,14 @@ func exporterhelperOptions(
exporterhelper.WithShutdown(shutdown),
exporterhelper.WithQueue(cfg.QueueSettings),
}
if batcherCfg, ok := cfg.exporterbatcherConfig(); ok {
opts = append(opts, exporterhelper.WithBatcher(batcherCfg))
if cfg.Batcher.Enabled != nil {
batcherConfig := exporterbatcher.Config{
Enabled: *cfg.Batcher.Enabled,
FlushTimeout: cfg.Batcher.FlushTimeout,
MinSizeConfig: cfg.Batcher.MinSizeConfig,
MaxSizeConfig: cfg.Batcher.MaxSizeConfig,
}
opts = append(opts, exporterhelper.WithBatcher(batcherConfig))

// Effectively disable timeout_sender because timeout is enforced in bulk indexer.
//
Expand Down