From 56a929aad6c80fbdc32437b8c7f32991fa5c478d Mon Sep 17 00:00:00 2001 From: Jaana Dogan Date: Thu, 10 Jun 2021 22:46:39 -0700 Subject: [PATCH] Adjust default retry settings for the PRW Exporter (#3416) The default retry settings are far off from the Prometheus Server's behavior. Retry more aggressively to avoid excessive in-memory buffering. Also fixes open-telemetry/wg-prometheus#54 because the test times out before the retry is sent. --- exporter/prometheusremotewriteexporter/factory.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exporter/prometheusremotewriteexporter/factory.go b/exporter/prometheusremotewriteexporter/factory.go index ea4f9af06da..7be21cc7b0d 100644 --- a/exporter/prometheusremotewriteexporter/factory.go +++ b/exporter/prometheusremotewriteexporter/factory.go @@ -17,6 +17,7 @@ package prometheusremotewriteexporter import ( "context" "errors" + "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" @@ -79,7 +80,12 @@ func createDefaultConfig() config.Exporter { Namespace: "", ExternalLabels: map[string]string{}, TimeoutSettings: exporterhelper.DefaultTimeoutSettings(), - RetrySettings: exporterhelper.DefaultRetrySettings(), + RetrySettings: exporterhelper.RetrySettings{ + Enabled: true, + InitialInterval: 50 * time.Millisecond, + MaxInterval: 200 * time.Millisecond, + MaxElapsedTime: 1 * time.Minute, + }, HTTPClientSettings: confighttp.HTTPClientSettings{ Endpoint: "http://some.url:9411/api/prom/push", // We almost read 0 bytes, so no need to tune ReadBufferSize.