Skip to content

Commit

Permalink
Add todos for error.type
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Jan 22, 2025
1 parent 043b47f commit 28d6ffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def traced_method(
# message_to_event(message, capture_content)
# )

# TODO: set error.type attribute
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md
result = wrapped(*args, **kwargs)
# TODO: handle streaming
# if is_streaming(kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def test_generate_content_extra_params(span_exporter, instrument_no_content):
def assert_span_error(span: ReadableSpan) -> None:
# Sets error status
assert span.status.status_code == StatusCode.ERROR

# TODO: check thate error.type is set
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md

# Records exception event
error_events = [e for e in span.events if e.name == "exception"]
assert error_events != []

0 comments on commit 28d6ffd

Please sign in to comment.