Skip to content

Commit c853160

Browse files
committed
feat(telemetry): capture tool execution errors in OpenTelemetry spans
Introduces ToolExecutionError and ToolErrorType (HTTP status codes) to standardize error reporting for tool failures. Updates trace_tool_call and function execution handlers to extract and record error.type semantics.
1 parent d35e7f1 commit c853160

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

tests/unittests/telemetry/test_spans.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,6 @@ async def test_generate_content_span_with_experimental_semconv(
11761176
assert GEN_AI_CONVERSATION_ID in attributes
11771177
assert attributes[GEN_AI_CONVERSATION_ID] == invocation_context.session.id
11781178

1179-
11801179
def test_trace_tool_call_with_tool_execution_error(
11811180
monkeypatch, mock_span_fixture, mock_tool_fixture
11821181
):
@@ -1255,5 +1254,4 @@ def test_trace_tool_call_with_standard_error(
12551254
error=test_error,
12561255
)
12571256

1258-
assert mock.call('error.type', 'ValueError') in mock_span_fixture.set_attribute.call_args_list
1259-
1257+
assert mock.call('error.type', 'ValueError') in mock_span_fixture.set_attribute.call_args_list

0 commit comments

Comments
 (0)