Skip to content

Commit

Permalink
Adjust default retry settings for the PRW Exporter (#3416)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rakyll authored Jun 11, 2021
1 parent fd38d74 commit 56a929a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exporter/prometheusremotewriteexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package prometheusremotewriteexporter
import (
"context"
"errors"
"time"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 56a929a

Please sign in to comment.