Skip to content

Commit 7367ed5

Browse files
committed
fix _record_exception_on_span
1 parent 26f6932 commit 7367ed5

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

litellm/integrations/_types/open_inference.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,42 @@ class OpenInferenceLLMProviderValues(Enum):
387387
GOOGLE = "google"
388388
AZURE = "azure"
389389
AWS = "aws"
390+
391+
392+
class ErrorAttributes:
393+
"""
394+
Attributes for error information in spans.
395+
396+
These attributes follow OpenTelemetry semantic conventions for exceptions
397+
and are used to record error information from StandardLoggingPayloadErrorInformation.
398+
"""
399+
400+
ERROR_TYPE = "error.type"
401+
"""
402+
The type/class of the error (e.g., 'ValueError', 'OpenAIError', 'RateLimitError').
403+
Corresponds to StandardLoggingPayloadErrorInformation.error_class
404+
"""
405+
406+
ERROR_MESSAGE = "error.message"
407+
"""
408+
The error message describing what went wrong.
409+
Corresponds to StandardLoggingPayloadErrorInformation.error_message
410+
"""
411+
412+
ERROR_CODE = "error.code"
413+
"""
414+
The error code (e.g., HTTP status code like '500', '429', or provider-specific codes).
415+
Corresponds to StandardLoggingPayloadErrorInformation.error_code
416+
"""
417+
418+
ERROR_STACK_TRACE = "error.stack_trace"
419+
"""
420+
The full stack trace of the error.
421+
Corresponds to StandardLoggingPayloadErrorInformation.traceback
422+
"""
423+
424+
ERROR_LLM_PROVIDER = "error.llm_provider"
425+
"""
426+
The LLM provider where the error occurred (e.g., 'openai', 'anthropic', 'azure').
427+
Corresponds to StandardLoggingPayloadErrorInformation.llm_provider
428+
"""

0 commit comments

Comments
 (0)