diff --git a/.chloggen/prometheusremotewrite_sanitize_retry_defaults.yaml b/.chloggen/prometheusremotewrite_sanitize_retry_defaults.yaml new file mode 100644 index 0000000000000..bcba3020ae8c8 --- /dev/null +++ b/.chloggen/prometheusremotewrite_sanitize_retry_defaults.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: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: prometheusremotewriteexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: sanitize retry default settings + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [30286] + +# (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] \ No newline at end of file diff --git a/exporter/prometheusremotewriteexporter/factory.go b/exporter/prometheusremotewriteexporter/factory.go index f90aa41b21ace..23018de43b8ec 100644 --- a/exporter/prometheusremotewriteexporter/factory.go +++ b/exporter/prometheusremotewriteexporter/factory.go @@ -8,7 +8,6 @@ import ( "errors" "time" - "github.com/cenkalti/backoff/v4" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/configopaque" @@ -67,19 +66,15 @@ func createMetricsExporter(ctx context.Context, set exporter.CreateSettings, } func createDefaultConfig() component.Config { + retrySettings := exporterhelper.NewDefaultRetrySettings() + retrySettings.InitialInterval = 50 * time.Millisecond + return &Config{ Namespace: "", ExternalLabels: map[string]string{}, MaxBatchSizeBytes: 3000000, TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(), - RetrySettings: exporterhelper.RetrySettings{ - Enabled: true, - InitialInterval: 50 * time.Millisecond, - MaxInterval: 200 * time.Millisecond, - MaxElapsedTime: 1 * time.Minute, - RandomizationFactor: backoff.DefaultRandomizationFactor, - Multiplier: backoff.DefaultMultiplier, - }, + RetrySettings: retrySettings, AddMetricSuffixes: true, SendMetadata: false, HTTPClientSettings: confighttp.HTTPClientSettings{