Skip to content

Commit 36d368c

Browse files
committed
openai: pass the context when contructing the event from stream choices
Pass the full context instead of the deprecated trace_id, span_id and trace_flags.
1 parent 70d798a commit 36d368c

File tree

1 file changed

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

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,7 @@ def _send_logs_from_stream_choices(
386386
event_name=EVENT_GEN_AI_CHOICE,
387387
body=body,
388388
attributes={**attributes, "event.name": EVENT_GEN_AI_CHOICE},
389-
trace_id=ctx.trace_id,
390-
span_id=ctx.span_id,
391-
trace_flags=ctx.trace_flags,
389+
context=ctx,
392390
)
393391
logger.emit(log)
394392

0 commit comments

Comments
 (0)