Skip to content

Commit

Permalink
Configurable max export delay value for OTLPExporterMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
avpps committed Nov 27, 2023
1 parent 1625b35 commit 0cd8bf0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0cd8bf0

Please sign in to comment.