Class RetryPolicy.RetryPolicyBuilder
java.lang.Object
io.opentelemetry.sdk.common.export.RetryPolicy.RetryPolicyBuilder
- Enclosing class:
- RetryPolicy
Builder for
RetryPolicy.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build and return aRetryPolicywith the values of this builder.abstract RetryPolicy.RetryPolicyBuildersetBackoffMultiplier(double backoffMultiplier) Set the backoff multiplier.abstract RetryPolicy.RetryPolicyBuildersetInitialBackoff(Duration initialBackoff) Set the initial backoff.abstract RetryPolicy.RetryPolicyBuildersetMaxAttempts(int maxAttempts) Set the maximum number of attempts, including the original request.abstract RetryPolicy.RetryPolicyBuildersetMaxBackoff(Duration maxBackoff) Set the maximum backoff.abstract RetryPolicy.RetryPolicyBuildersetRetryExceptionPredicate(Predicate<IOException> retryExceptionPredicate) Set the predicate used to determine if an attempt which failed exceptionally should be retried.
-
Method Details
-
setMaxAttempts
Set the maximum number of attempts, including the original request. Must be greater than 1 and less than 6. Defaults to 5. -
setInitialBackoff
Set the initial backoff. Must be greater than 0. Defaults to 1 seconds. -
setMaxBackoff
Set the maximum backoff. Must be greater than 0. Defaults to 5 seconds. -
setBackoffMultiplier
Set the backoff multiplier. Must be greater than 0.0. Defaults to 1.5. -
setRetryExceptionPredicate
public abstract RetryPolicy.RetryPolicyBuilder setRetryExceptionPredicate(Predicate<IOException> retryExceptionPredicate) Set the predicate used to determine if an attempt which failed exceptionally should be retried. By default, an exporter specific default predicate should be used.- Since:
- 1.47.0
-
build
Build and return aRetryPolicywith the values of this builder.
-