Skip to content

Commit 28d6ffd

Browse files
committed
Add todos for error.type
1 parent 043b47f commit 28d6ffd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def traced_method(
115115
# message_to_event(message, capture_content)
116116
# )
117117

118+
# TODO: set error.type attribute
119+
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md
118120
result = wrapped(*args, **kwargs)
119121
# TODO: handle streaming
120122
# if is_streaming(kwargs):

instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_chat_completions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ def test_generate_content_extra_params(span_exporter, instrument_no_content):
164164
def assert_span_error(span: ReadableSpan) -> None:
165165
# Sets error status
166166
assert span.status.status_code == StatusCode.ERROR
167+
168+
# TODO: check thate error.type is set
169+
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md
170+
167171
# Records exception event
168172
error_events = [e for e in span.events if e.name == "exception"]
169173
assert error_events != []

0 commit comments

Comments
 (0)