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: 27 additions & 0 deletions .chloggen/47498.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: 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]
7 changes: 5 additions & 2 deletions exporter/sumologicexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ exporters:
# time to wait after the first failure before retrying;
# ignored if enabled is false, default = 5s
initial_interval: <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: <multiplier>
# is the upper bound on backoff; ignored if enabled is false, default = 5m
max_interval: <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: <max_elapsed_time>

sending_queue:
Expand Down
6 changes: 6 additions & 0 deletions exporter/sumologicexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
6 changes: 5 additions & 1 deletion exporter/sumologicexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -39,7 +43,7 @@ func createDefaultConfig() component.Config {
Client: DefaultClient,

ClientConfig: createDefaultClientConfig(),
BackOffConfig: configretry.NewDefaultBackOffConfig(),
BackOffConfig: retryConfig,
QueueSettings: qs,
StickySessionEnabled: DefaultStickySessionEnabled,
}
Expand Down
8 changes: 7 additions & 1 deletion exporter/sumologicexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
jagan2221 marked this conversation as resolved.
clientConfig := confighttp.NewDefaultClientConfig()
clientConfig.Timeout = 30 * time.Second
clientConfig.Compression = "gzip"
Expand All @@ -42,7 +48,7 @@ func TestCreateDefaultConfig(t *testing.T) {
Client: "otelcol",

ClientConfig: clientConfig,
BackOffConfig: configretry.NewDefaultBackOffConfig(),
BackOffConfig: retryConfig,
QueueSettings: qs,
}, cfg)

Expand Down
Loading