@@ -14,7 +14,6 @@ import (
1414 "go.opentelemetry.io/collector/config/configopaque"
1515 "go.opentelemetry.io/collector/config/configoptional"
1616 "go.opentelemetry.io/collector/config/configretry"
17- "go.opentelemetry.io/collector/confmap"
1817 "go.opentelemetry.io/collector/exporter/exporterhelper"
1918
2019 translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/splunk"
@@ -56,22 +55,11 @@ type HecTelemetry struct {
5655 ExtraAttributes map [string ]string `mapstructure:"extra_attributes"`
5756}
5857
59- type DeprecatedBatchConfig struct {
60- Enabled bool `mapstructure:"enabled"`
61- FlushTimeout time.Duration `mapstructure:"flush_timeout"`
62- Sizer exporterhelper.RequestSizerType `mapstructure:"sizer"`
63- MinSize int64 `mapstructure:"min_size"`
64- MaxSize int64 `mapstructure:"max_size"`
65- isSet bool `mapstructure:"-"`
66- }
67-
6858// Config defines configuration for Splunk exporter.
6959type Config struct {
7060 confighttp.ClientConfig `mapstructure:",squash"`
7161 QueueSettings configoptional.Optional [exporterhelper.QueueBatchConfig ] `mapstructure:"sending_queue"`
7262 configretry.BackOffConfig `mapstructure:"retry_on_failure"`
73- // DeprecatedBatcher is the deprecated batcher configuration.
74- DeprecatedBatcher DeprecatedBatchConfig `mapstructure:"batcher"`
7563
7664 // LogDataEnabled can be used to disable sending logs by the exporter.
7765 LogDataEnabled bool `mapstructure:"log_data_enabled"`
@@ -142,36 +130,6 @@ type Config struct {
142130 Telemetry HecTelemetry `mapstructure:"telemetry"`
143131}
144132
145- func (cfg * Config ) Unmarshal (conf * confmap.Conf ) error {
146- if err := conf .Unmarshal (cfg ); err != nil {
147- return err
148- }
149- if conf .IsSet ("batcher" ) {
150- cfg .DeprecatedBatcher .isSet = true
151- if cfg .QueueSettings .HasValue () && cfg .QueueSettings .Get ().Batch .HasValue () {
152- return errors .New (`deprecated "batcher" cannot be set along with "sending_queue::batch"` )
153- }
154- if cfg .DeprecatedBatcher .Enabled {
155- wasEnabled := cfg .QueueSettings .HasValue ()
156-
157- cfg .QueueSettings .GetOrInsertDefault ().Batch = configoptional .Some (exporterhelper.BatchConfig {
158- FlushTimeout : cfg .DeprecatedBatcher .FlushTimeout ,
159- Sizer : cfg .DeprecatedBatcher .Sizer ,
160- MinSize : cfg .DeprecatedBatcher .MinSize ,
161- MaxSize : cfg .DeprecatedBatcher .MaxSize ,
162- })
163-
164- // If the deprecated batcher is enabled without a queue, enable blocking queue to replicate the
165- // behavior of the deprecated batcher.
166- if ! wasEnabled {
167- cfg .QueueSettings .Get ().WaitForResult = true
168- }
169- }
170- }
171-
172- return nil
173- }
174-
175133func (cfg * Config ) getURL () (out * url.URL , err error ) {
176134 out , err = url .Parse (cfg .Endpoint )
177135 if err != nil {
0 commit comments