Skip to content

Commit 75a043e

Browse files
committed
Record events regardless of span recording
1 parent 8f52750 commit 75a043e

File tree

1 file changed

+8
-10
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai

1 file changed

+8
-10
lines changed

instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/patch.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ def traced_method(
113113
name=span_name,
114114
kind=SpanKind.CLIENT,
115115
attributes=span_attributes,
116-
) as span:
117-
if span.is_recording():
118-
for event in request_to_events(
119-
params=params, capture_content=capture_content
120-
):
121-
event_logger.emit(event)
116+
) as _span:
117+
for event in request_to_events(
118+
params=params, capture_content=capture_content
119+
):
120+
event_logger.emit(event)
122121

123122
# TODO: set error.type attribute
124123
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md
@@ -130,10 +129,9 @@ def traced_method(
130129
# )
131130

132131
# TODO: add response attributes and events
133-
# if span.is_recording():
134-
# _set_response_attributes(
135-
# span, result, event_logger, capture_content
136-
# )
132+
# _set_response_attributes(
133+
# span, result, event_logger, capture_content
134+
# )
137135
return result
138136

139137
return traced_method

0 commit comments

Comments
 (0)