Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/5438.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`opentelemetry-sdk`: unify logging force_flush timeout defaults to 10000ms
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def shutdown(self) -> None:
"""Called when a :class:`opentelemetry.sdk._logs.Logger` is shutdown"""

@abc.abstractmethod
def force_flush(self, timeout_millis: int = 30000) -> bool:
def force_flush(self, timeout_millis: int = 10_000) -> bool:
"""Export all the received logs to the configured Exporter that have not yet
been exported.

Expand Down Expand Up @@ -429,7 +429,7 @@ def shutdown(self) -> None:
for lp in self._log_record_processors:
lp.shutdown()

def force_flush(self, timeout_millis: int = 30000) -> bool:
def force_flush(self, timeout_millis: int = 10_000) -> bool:
"""Force flush the log processors one by one

Args:
Expand Down Expand Up @@ -501,7 +501,7 @@ def on_emit(self, log_record: ReadWriteLogRecord) -> None:
def shutdown(self) -> None:
self._submit_and_wait(lambda lp: lp.shutdown)

def force_flush(self, timeout_millis: int = 30000) -> bool:
def force_flush(self, timeout_millis: int = 10_000) -> bool:
"""Force flush the log processors in parallel.

Args:
Expand Down Expand Up @@ -977,7 +977,7 @@ def shutdown(self) -> None:
atexit.unregister(self._at_exit_handler)
self._at_exit_handler = None

def force_flush(self, timeout_millis: int = 30000) -> bool:
def force_flush(self, timeout_millis: int = 10_000) -> bool:
"""Force flush the log processors.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def shutdown(self):
self._shutdown = True
self._exporter.shutdown()

def force_flush(self, timeout_millis: int = 30000) -> bool: # pylint: disable=no-self-use
def force_flush(self, timeout_millis: int = 10_000) -> bool: # pylint: disable=no-self-use
return True


Expand Down Expand Up @@ -353,7 +353,7 @@ def on_emit(self, log_record: ReadWriteLogRecord) -> None:
def shutdown(self):
return self._batch_processor.shutdown()

def force_flush(self, timeout_millis: int | None = None) -> bool:
def force_flush(self, timeout_millis: int = 10_000) -> bool:
return self._batch_processor.force_flush(timeout_millis)

@staticmethod
Expand Down
Loading