fix _record_exception_on_span

This commit is contained in:
Ishaan Jaffer 2025-10-27 10:59:56 -07:00
parent 26f6932767
commit 7367ed5147

View file

@ -387,3 +387,42 @@ class OpenInferenceLLMProviderValues(Enum):
GOOGLE = "google"
AZURE = "azure"
AWS = "aws"
class ErrorAttributes:
"""
Attributes for error information in spans.
These attributes follow OpenTelemetry semantic conventions for exceptions
and are used to record error information from StandardLoggingPayloadErrorInformation.
"""
ERROR_TYPE = "error.type"
"""
The type/class of the error (e.g., 'ValueError', 'OpenAIError', 'RateLimitError').
Corresponds to StandardLoggingPayloadErrorInformation.error_class
"""
ERROR_MESSAGE = "error.message"
"""
The error message describing what went wrong.
Corresponds to StandardLoggingPayloadErrorInformation.error_message
"""
ERROR_CODE = "error.code"
"""
The error code (e.g., HTTP status code like '500', '429', or provider-specific codes).
Corresponds to StandardLoggingPayloadErrorInformation.error_code
"""
ERROR_STACK_TRACE = "error.stack_trace"
"""
The full stack trace of the error.
Corresponds to StandardLoggingPayloadErrorInformation.traceback
"""
ERROR_LLM_PROVIDER = "error.llm_provider"
"""
The LLM provider where the error occurred (e.g., 'openai', 'anthropic', 'azure').
Corresponds to StandardLoggingPayloadErrorInformation.llm_provider
"""