Skip to content

Remove deprecated batcher config for splunkhecexporter, use sending_queue #39961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 27 additions & 0 deletions .chloggen/rm-batcher-splunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: splunkhecexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated batcher config for splunkhecexporter, use sending_queue::batch

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [39961]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
6 changes: 1 addition & 5 deletions exporter/splunkhecexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@
confighttp.ClientConfig `mapstructure:",squash"`
QueueSettings exporterhelper.QueueBatchConfig `mapstructure:"sending_queue"`
configretry.BackOffConfig `mapstructure:"retry_on_failure"`

// Experimental: This configuration is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
BatcherConfig exporterhelper.BatcherConfig `mapstructure:"batcher"` //nolint:staticcheck


Check failure on line 70 in exporter/splunkhecexporter/config.go

View workflow job for this annotation

GitHub Actions / lint-matrix (windows, exporter-3)

File is not properly formatted (gci)

Check failure on line 70 in exporter/splunkhecexporter/config.go

View workflow job for this annotation

GitHub Actions / lint-matrix (linux, exporter-3)

File is not properly formatted (gci)
// LogDataEnabled can be used to disable sending logs by the exporter.
LogDataEnabled bool `mapstructure:"log_data_enabled"`

Expand Down
14 changes: 5 additions & 9 deletions exporter/splunkhecexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,12 @@ func TestLoadConfig(t *testing.T) {
QueueSettings: exporterhelper.QueueBatchConfig{
Enabled: true,
NumConsumers: 2,
QueueSize: 10,
QueueSize: 1000,
Sizer: exporterhelper.RequestSizerTypeRequests,
},
BatcherConfig: exporterhelper.BatcherConfig{ //nolint:staticcheck
Enabled: true,
FlushTimeout: time.Second,
SizeConfig: exporterhelper.SizeConfig{ //nolint:staticcheck
Sizer: exporterhelper.RequestSizerTypeItems,
MinSize: 1,
MaxSize: 10,
Batch: &exporterhelper.BatchConfig{
FlushTimeout: time.Second,
MinSize: 10,
MaxSize: 100,
},
},
OtelAttrsToHec: splunk.HecToOtelAttrs{
Expand Down
7 changes: 0 additions & 7 deletions exporter/splunkhecexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ func NewFactory() exporter.Factory {
}

func createDefaultConfig() component.Config {
batcherCfg := exporterhelper.NewDefaultBatcherConfig() //nolint:staticcheck
batcherCfg.Enabled = false

defaultMaxConns := defaultMaxIdleCons
defaultIdleConnTimeout := defaultIdleConnTimeout

Expand All @@ -79,7 +76,6 @@ func createDefaultConfig() component.Config {
SplunkAppName: defaultSplunkAppName,
BackOffConfig: configretry.NewDefaultBackOffConfig(),
QueueSettings: exporterhelper.NewDefaultQueueConfig(),
BatcherConfig: batcherCfg,
DisableCompression: false,
MaxContentLengthLogs: defaultContentLengthLogsLimit,
MaxContentLengthMetrics: defaultContentLengthMetricsLimit,
Expand Down Expand Up @@ -132,7 +128,6 @@ func createTracesExporter(
exporterhelper.WithQueue(cfg.QueueSettings),
exporterhelper.WithStart(c.start),
exporterhelper.WithShutdown(c.stop),
exporterhelper.WithBatcher(cfg.BatcherConfig), //nolint:staticcheck
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -166,7 +161,6 @@ func createMetricsExporter(
exporterhelper.WithQueue(cfg.QueueSettings),
exporterhelper.WithStart(c.start),
exporterhelper.WithShutdown(c.stop),
exporterhelper.WithBatcher(cfg.BatcherConfig), //nolint:staticcheck
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -200,7 +194,6 @@ func createLogsExporter(
exporterhelper.WithQueue(cfg.QueueSettings),
exporterhelper.WithStart(c.start),
exporterhelper.WithShutdown(c.stop),
exporterhelper.WithBatcher(cfg.BatcherConfig), //nolint:staticcheck
)
if err != nil {
return nil, err
Expand Down
3 changes: 0 additions & 3 deletions exporter/splunkhecexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.opentelemetry.io/collector/exporter/exportertest"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter/internal/metadata"
Expand Down Expand Up @@ -111,8 +110,6 @@ func TestFactory_EnabledBatchingMakesExporterMutable(t *testing.T) {
require.NoError(t, err)
assert.False(t, le.Capabilities().MutatesData)

config.BatcherConfig = exporterhelper.NewDefaultBatcherConfig() //nolint:staticcheck

me, err = createMetricsExporter(context.Background(), exportertest.NewNopSettings(metadata.Type), config)
require.NoError(t, err)
assert.True(t, me.Capabilities().MutatesData)
Expand Down
12 changes: 6 additions & 6 deletions exporter/splunkhecexporter/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ splunk_hec/allsettings:
sending_queue:
enabled: true
num_consumers: 2
queue_size: 10
queue_size: 1000
sizer: "items"
batch:
flush_timeout: 1s
min_size: 10
max_size: 100
retry_on_failure:
enabled: true
initial_interval: 10s
max_interval: 60s
max_elapsed_time: 10m
batcher:
enabled: true
flush_timeout: 1s
min_size: 1
max_size: 10
splunk_app_name: "OpenTelemetry-Collector Splunk Exporter"
splunk_app_version: "v0.0.1"
otel_attrs_to_hec_metadata:
Expand Down
Loading