diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b62a4ef39..e13b18deec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#4324](https://github.com/open-telemetry/opentelemetry-python/pull/4324)) - Remove `TestBase.assertEqualSpanInstrumentationInfo` method, use `assertEqualSpanInstrumentationScope` instead ([#4310](https://github.com/open-telemetry/opentelemetry-python/pull/4310)) +- Configurable max retry timeout for grpc exporter + ([#4333](https://github.com/open-telemetry/opentelemetry-python/pull/4333)) ## Version 1.28.0/0.49b0 (2024-11-05) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py index 582d083e86..9be4e505ac 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py @@ -186,6 +186,8 @@ class OTLPExporterMixin( compression: gRPC compression method to use """ + _MAX_RETRY_TIMEOUT = 64 + def __init__( self, endpoint: Optional[str] = None, @@ -286,12 +288,13 @@ def _export( # data.__class__.__name__, # delay, # ) - max_value = 64 # expo returns a generator that yields delay values which grow # exponentially. Once delay is greater than max_value, the yielded # value will remain constant. - for delay in _create_exp_backoff_generator(max_value=max_value): - if delay == max_value or self._shutdown: + for delay in _create_exp_backoff_generator( + max_value=self._MAX_RETRY_TIMEOUT + ): + if delay == self._MAX_RETRY_TIMEOUT or self._shutdown: return self._result.FAILURE with self._export_lock: