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 b4226828280..00f1def0973 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 @@ -151,6 +151,7 @@ class OTLPExporterMixin( timeout: Backend request timeout in seconds compression: gRPC compression method to use """ + _MAX_EXPORT_DELAY_VALUE = 64 def __init__( self, @@ -249,12 +250,12 @@ 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_EXPORT_DELAY_VALUE): + if delay == self._MAX_EXPORT_DELAY_VALUE or self._shutdown: return self._result.FAILURE with self._export_lock: