Skip to content

Commit 8e667de

Browse files
committed
cleanup
1 parent 9e273f6 commit 8e667de

File tree

1 file changed

+7
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2

1 file changed

+7
-0
lines changed

Diff for: instrumentation/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py

+7
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def traced_method(wrapped, instance, args, kwargs):
5454
name=span_name, kind=SpanKind.CLIENT, attributes=span_attributes
5555
)
5656
if span.is_recording():
57+
_set_input_attributes(span, span_attributes)
5758
set_event_prompt(span, json.dumps(llm_prompts))
5859

5960
try:
@@ -83,6 +84,12 @@ def traced_method(wrapped, instance, args, kwargs):
8384
return traced_method
8485

8586

87+
@silently_fail
88+
def _set_input_attributes(span, attributes):
89+
for field, value in attributes.items():
90+
set_span_attribute(span, field, value)
91+
92+
8693
@silently_fail
8794
def _set_response_attributes(span, result):
8895
set_span_attribute(

0 commit comments

Comments
 (0)