Skip to content

Commit 96fb447

Browse files
committed
Update options with retry policy settings
1 parent 227a577 commit 96fb447

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_options.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ struct OtlpGrpcClientOptions
6262
// Concurrent requests
6363
std::size_t max_concurrent_requests;
6464
#endif
65+
66+
/** The maximum number of call attempts, including the original attempt. */
67+
std::uint32_t retry_policy_max_attempts{};
68+
69+
/** The initial backoff delay between retry attempts, random between (0, initial_backoff). */
70+
SecondsDecimal retry_policy_initial_backoff{};
71+
72+
/** The maximum backoff places an upper limit on exponential backoff growth. */
73+
SecondsDecimal retry_policy_max_backoff{};
74+
75+
/** The backoff will be multiplied by this value after each retry attempt. */
76+
float retry_policy_backoff_multiplier{};
6577
};
6678

6779
} // namespace otlp

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions
104104

105105
/** Compression type. */
106106
std::string compression;
107+
108+
/** The maximum number of call attempts, including the original attempt. */
109+
std::uint32_t retry_policy_max_attempts{};
110+
111+
/** The initial backoff delay between retry attempts, random between (0, initial_backoff). */
112+
SecondsDecimal retry_policy_initial_backoff{};
113+
114+
/** The maximum backoff places an upper limit on exponential backoff growth. */
115+
SecondsDecimal retry_policy_max_backoff{};
116+
117+
/** The backoff will be multiplied by this value after each retry attempt. */
118+
float retry_policy_backoff_multiplier{};
107119
};
108120

109121
} // namespace otlp

exporters/otlp/src/otlp_grpc_exporter_options.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ OtlpGrpcExporterOptions::OtlpGrpcExporterOptions()
3636
#ifdef ENABLE_ASYNC_EXPORT
3737
max_concurrent_requests = 64;
3838
#endif
39+
40+
retry_policy_max_attempts = GetOtlpDefaultTracesRetryMaxAttempts();
41+
retry_policy_initial_backoff = GetOtlpDefaultTracesRetryInitialBackoff();
42+
retry_policy_max_backoff = GetOtlpDefaultTracesRetryMaxBackoff();
43+
retry_policy_backoff_multiplier = GetOtlpDefaultTracesRetryBackoffMultiplier();
3944
}
4045

4146
OtlpGrpcExporterOptions::~OtlpGrpcExporterOptions() {}

exporters/otlp/src/otlp_grpc_log_record_exporter_options.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ OtlpGrpcLogRecordExporterOptions::OtlpGrpcLogRecordExporterOptions()
3434
#ifdef ENABLE_ASYNC_EXPORT
3535
max_concurrent_requests = 64;
3636
#endif
37+
38+
retry_policy_max_attempts = GetOtlpDefaultLogsRetryMaxAttempts();
39+
retry_policy_initial_backoff = GetOtlpDefaultLogsRetryInitialBackoff();
40+
retry_policy_max_backoff = GetOtlpDefaultLogsRetryMaxBackoff();
41+
retry_policy_backoff_multiplier = GetOtlpDefaultLogsRetryBackoffMultiplier();
3742
}
3843

3944
OtlpGrpcLogRecordExporterOptions::~OtlpGrpcLogRecordExporterOptions() {}

exporters/otlp/src/otlp_grpc_metric_exporter_options.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ OtlpGrpcMetricExporterOptions::OtlpGrpcMetricExporterOptions()
3535
#ifdef ENABLE_ASYNC_EXPORT
3636
max_concurrent_requests = 64;
3737
#endif
38+
39+
retry_policy_max_attempts = GetOtlpDefaultMetricsRetryMaxAttempts();
40+
retry_policy_initial_backoff = GetOtlpDefaultMetricsRetryInitialBackoff();
41+
retry_policy_max_backoff = GetOtlpDefaultMetricsRetryMaxBackoff();
42+
retry_policy_backoff_multiplier = GetOtlpDefaultMetricsRetryBackoffMultiplier();
3843
}
3944

4045
OtlpGrpcMetricExporterOptions::~OtlpGrpcMetricExporterOptions() {}

0 commit comments

Comments
 (0)