diff --git a/.chloggen/47498.yaml b/.chloggen/47498.yaml new file mode 100644 index 0000000000000..5840c604deec1 --- /dev/null +++ b/.chloggen/47498.yaml @@ -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: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog) +component: exporter/sumologic + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Modify default retry settings to prevent dropping data on transient backend unavailability + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [47503] + +# (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] diff --git a/exporter/sumologicexporter/README.md b/exporter/sumologicexporter/README.md index a027b6d75e698..1c80fca31c94c 100644 --- a/exporter/sumologicexporter/README.md +++ b/exporter/sumologicexporter/README.md @@ -124,10 +124,13 @@ exporters: # time to wait after the first failure before retrying; # ignored if enabled is false, default = 5s initial_interval: - # is the upper bound on backoff; ignored if enabled is false, default = 30s + # multiplier is the factor applied to the previous delay to calculate the next retry delay; + # ignored if enabled is false, default = 1.2 + multiplier: + # is the upper bound on backoff; ignored if enabled is false, default = 5m max_interval: # is the maximum amount of time spent trying to send a batch; - # ignored if enabled is false, default = 120s + # ignored if enabled is false, default = 1h max_elapsed_time: sending_queue: diff --git a/exporter/sumologicexporter/config.go b/exporter/sumologicexporter/config.go index 88b6e0f4a79d8..e02806cf4e54d 100644 --- a/exporter/sumologicexporter/config.go +++ b/exporter/sumologicexporter/config.go @@ -190,4 +190,10 @@ const ( DefaultDropRoutingAttribute string = "" // DefaultStickySessionEnabled defines default StickySessionEnabled value DefaultStickySessionEnabled bool = false + // DefaultRetryOnFailureMultiplier defines default retry_on_failure multiplier value + DefaultRetryOnFailureMultiplier float64 = 1.2 + // DefaultRetryOnFailureMaxInterval defines default retry_on_failure max_interval value + DefaultRetryOnFailureMaxInterval time.Duration = 5 * time.Minute + // DefaultRetryOnFailureMaxElapsedTime defines default retry_on_failure max_elapsed_time value + DefaultRetryOnFailureMaxElapsedTime time.Duration = 1 * time.Hour ) diff --git a/exporter/sumologicexporter/factory.go b/exporter/sumologicexporter/factory.go index 4c999f4395cd4..558bdaddf4173 100644 --- a/exporter/sumologicexporter/factory.go +++ b/exporter/sumologicexporter/factory.go @@ -31,6 +31,10 @@ func NewFactory() exporter.Factory { func createDefaultConfig() component.Config { qs := configoptional.Default(exporterhelper.NewDefaultQueueConfig()) + retryConfig := configretry.NewDefaultBackOffConfig() + retryConfig.Multiplier = DefaultRetryOnFailureMultiplier + retryConfig.MaxInterval = DefaultRetryOnFailureMaxInterval + retryConfig.MaxElapsedTime = DefaultRetryOnFailureMaxElapsedTime return &Config{ MaxRequestBodySize: DefaultMaxRequestBodySize, @@ -39,7 +43,7 @@ func createDefaultConfig() component.Config { Client: DefaultClient, ClientConfig: createDefaultClientConfig(), - BackOffConfig: configretry.NewDefaultBackOffConfig(), + BackOffConfig: retryConfig, QueueSettings: qs, StickySessionEnabled: DefaultStickySessionEnabled, } diff --git a/exporter/sumologicexporter/factory_test.go b/exporter/sumologicexporter/factory_test.go index 50c07a72765a9..e3e995e23b7e0 100644 --- a/exporter/sumologicexporter/factory_test.go +++ b/exporter/sumologicexporter/factory_test.go @@ -29,6 +29,12 @@ func TestCreateDefaultConfig(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() qs := configoptional.Default(exporterhelper.NewDefaultQueueConfig()) + retryConfig := configretry.NewDefaultBackOffConfig() + retryConfig.Enabled = true + retryConfig.InitialInterval = 5 * time.Second + retryConfig.Multiplier = 1.2 + retryConfig.MaxInterval = 5 * time.Minute + retryConfig.MaxElapsedTime = 1 * time.Hour clientConfig := confighttp.NewDefaultClientConfig() clientConfig.Timeout = 30 * time.Second clientConfig.Compression = "gzip" @@ -42,7 +48,7 @@ func TestCreateDefaultConfig(t *testing.T) { Client: "otelcol", ClientConfig: clientConfig, - BackOffConfig: configretry.NewDefaultBackOffConfig(), + BackOffConfig: retryConfig, QueueSettings: qs, }, cfg)