org.llm4s.trace.model

Members list

Type members

Classlikes

final case class Span(spanId: SpanId, traceId: TraceId, parentSpanId: Option[SpanId], name: String, kind: SpanKind, startTime: Instant, endTime: Option[Instant], status: SpanStatus, attributes: Map[String, SpanValue], events: List[SpanEvent])

A single unit of work within a trace.

A single unit of work within a trace.

Value parameters

attributes

typed key/value metadata attached to the span

endTime

when the span ended; None while still running

events

ordered list of point-in-time annotations within the span

kind

semantic category of the operation

name

human-readable operation name

parentSpanId

parent span, or None for the root span

spanId

unique identifier for this span

startTime

when the span started

status

outcome of the operation

traceId

identifier of the containing trace

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Span.type
final case class SpanEvent(name: String, timestamp: Instant, attributes: Map[String, SpanValue])

A point-in-time annotation attached to a span.

A point-in-time annotation attached to a span.

Value parameters

attributes

additional typed key/value data

name

short label for the event (e.g. "cache-lookup-started")

timestamp

when the event occurred

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
SpanEvent.type
final case class SpanId(value: String) extends AnyVal

Unique identifier for a single span within a trace.

Unique identifier for a single span within a trace.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object SpanId

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
SpanId.type
sealed trait SpanKind extends Product, Serializable

Semantic category of a span, used for filtering and cost attribution.

Semantic category of a span, used for filtering and cost attribution.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
object AgentCall
object Cache
object Embedding
object Internal
object LlmCall
object NodeExecution
object Rag
object ToolCall
Show all
object SpanKind

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
SpanKind.type
sealed trait SpanStatus extends Product, Serializable

Lifecycle status of a span or trace.

Lifecycle status of a span or trace.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Error
object Ok
object Running
object SpanStatus

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
SpanStatus.type
sealed trait SpanValue extends Product, Serializable

Typed value stored in a span's attribute map.

Typed value stored in a span's attribute map.

Use the as* accessors (via SpanValueOps) to safely extract a specific type.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
object SpanValue

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
SpanValue.type
final case class Trace(traceId: TraceId, rootSpanId: Option[SpanId], metadata: Map[String, String], startTime: Instant, endTime: Option[Instant], status: SpanStatus)

Top-level container for a logical operation, grouping one or more spans.

Top-level container for a logical operation, grouping one or more spans.

Value parameters

endTime

when the trace ended; None while still running

metadata

arbitrary string key/value tags (e.g. experiment name, user ID)

rootSpanId

the entry-point span, or None before the first span is recorded

startTime

when the trace started

status

overall outcome of the trace

traceId

unique identifier for this trace

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Trace.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type