Skip to content

Commit 886142a

Browse files
committed
Comment
1 parent 91accd2 commit 886142a

File tree

1 file changed

+3
-0
lines changed
  • instrumentation/elastic-opentelemetry-instrumentation-openai/src/opentelemetry/instrumentation/openai

1 file changed

+3
-0
lines changed

instrumentation/elastic-opentelemetry-instrumentation-openai/src/opentelemetry/instrumentation/openai/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ def _send_logs_from_choices(logger: Logger, choices, attributes: Attributes, cap
349349
logger.emit(log)
350350

351351

352+
# Workaround https://github.com/open-telemetry/opentelemetry-python/issues/4319 by
353+
# inspecting the logger to find the correct LogRecord class to create. Currently,
354+
# the SDK will crash on export if passing an API LogRecord to the SDK Logger.
352355
def _new_log_record(logger: Logger, **kwargs):
353356
mod = inspect.getmodule(logger.__class__)
354357
LoggerLogRecord = getattr(mod, "LogRecord", None)

0 commit comments

Comments
 (0)