ErrorOccurred

org.llm4s.trace.TraceEvent.ErrorOccurred
See theErrorOccurred companion object
final case class ErrorOccurred extends TraceEvent

An error. When it is a failed model call - a TracingLLMClient's, or an org.llm4s.llmconnect.EmbeddingClient's - operation names the call (chat, embeddings) and the call's details are set, which a backend that follows the OpenTelemetry GenAI conventions reports as the call's own span with error.type (#2275).

Value parameters

duration

how long the failed call took; the event's timestamp is its end

errorType

a short, low-cardinality name of the failure (the LLMError's type, e.g. RateLimitError); None takes the exception's class name

model

the requested model of the failed call

operation

the GenAI operation that failed (chat, embeddings); None for any other error

provider

the canonical id of the provider called

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def eventType: String
def toJson: Value
def withContext(context: String): ErrorOccurred
def withDuration(duration: FiniteDuration): ErrorOccurred
def withDuration(duration: Option[FiniteDuration]): ErrorOccurred
def withError(error: Throwable): ErrorOccurred
def withErrorType(errorType: String): ErrorOccurred
def withErrorType(errorType: Option[String]): ErrorOccurred
def withModel(model: String): ErrorOccurred
def withModel(model: Option[String]): ErrorOccurred
def withOperation(operation: String): ErrorOccurred
def withOperation(operation: Option[String]): ErrorOccurred
def withProvider(provider: Option[ProviderId]): ErrorOccurred
def withSpan(span: Option[TraceSpan]): ErrorOccurred
def withTimestamp(timestamp: Instant): ErrorOccurred

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product