Skip to content

Commit 9846ea3

Browse files
Update OpenAi instrumentor for Logs/Events API args change
1 parent 71bfc95 commit 9846ea3

File tree

1 file changed

+2
-3
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2

1 file changed

+2
-3
lines changed

instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
server_attributes as ServerAttributes,
2727
)
2828
from opentelemetry.trace import Span, SpanKind, Tracer
29+
from opentelemetry.trace.span import SpanContext
2930

3031
from .instruments import Instruments
3132
from .utils import (
@@ -404,9 +405,7 @@ def cleanup(self):
404405
name="gen_ai.choice",
405406
attributes=event_attributes,
406407
body=body,
407-
trace_id=span_ctx.trace_id,
408-
span_id=span_ctx.span_id,
409-
trace_flags=span_ctx.trace_flags,
408+
span_context=span_ctx,
410409
)
411410
)
412411

0 commit comments

Comments
 (0)