TraceModelJson

org.llm4s.trace.model.TraceModelJson

Provides JSON serialisation and deserialisation helpers for trace model types.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final implicit class SpanEventJson(val event: SpanEvent) extends AnyVal

Extension methods that add JSON serialisation to SpanEvent values.

Extension methods that add JSON serialisation to SpanEvent values.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
implicit class SpanIdJson(val spanId: SpanId)

Extension methods that add JSON serialisation to SpanId values.

Extension methods that add JSON serialisation to SpanId values.

Attributes

Supertypes
class Object
trait Matchable
class Any
final implicit class SpanJson(val span: Span) extends AnyVal

Extension methods that add JSON serialisation to Span values.

Extension methods that add JSON serialisation to Span values.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final implicit class SpanKindJson(val kind: SpanKind) extends AnyVal

Extension methods that add JSON serialisation to SpanKind values.

Extension methods that add JSON serialisation to SpanKind values.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final implicit class SpanStatusJson(val status: SpanStatus) extends AnyVal

Extension methods that add JSON serialisation to SpanStatus values.

Extension methods that add JSON serialisation to SpanStatus values.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final implicit class SpanValueJson(val sv: SpanValue) extends AnyVal

Extension methods that add JSON serialisation to SpanValue variants.

Extension methods that add JSON serialisation to SpanValue variants.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
implicit class TraceIdJson(val traceId: TraceId)

Extension methods that add JSON serialisation to TraceId values.

Extension methods that add JSON serialisation to TraceId values.

Attributes

Supertypes
class Object
trait Matchable
class Any
final implicit class TraceJson(val trace: Trace) extends AnyVal

Extension methods that add JSON serialisation to Trace values.

Extension methods that add JSON serialisation to Trace values.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def parseSpan(json: Value): Result[Span]

Parses a Span from a JSON object containing all required span fields.

Parses a Span from a JSON object containing all required span fields.

Value parameters

json

The JSON value representing a span.

Attributes

Returns

Right(Span) on success, or Left(ValidationError) on missing or malformed fields.

def parseSpanEvent(json: Value): Result[SpanEvent]

Parses a SpanEvent from a JSON object with name, timestamp, and attributes fields.

Parses a SpanEvent from a JSON object with name, timestamp, and attributes fields.

Value parameters

json

The JSON value representing a span event.

Attributes

Returns

Right(SpanEvent) on success, or Left(ValidationError) on malformed input.

def parseSpanId(json: Value): Result[SpanId]

Parses a SpanId from a JSON value.

Parses a SpanId from a JSON value.

Value parameters

json

The JSON value expected to be a string.

Attributes

Returns

Right(SpanId) on success, or Left(ValidationError) if the value is not a string.

def parseSpanKind(json: Value): Result[SpanKind]

Parses a SpanKind from a JSON string value.

Parses a SpanKind from a JSON string value.

Value parameters

json

The JSON value expected to be a string matching a known span kind name.

Attributes

Returns

Right(SpanKind) on success, or Left(ValidationError) for unknown or non-string input.

def parseSpanStatus(json: Value): Result[SpanStatus]

Parses a SpanStatus from a JSON object with a type field.

Parses a SpanStatus from a JSON object with a type field.

Value parameters

json

The JSON value representing a span status.

Attributes

Returns

Right(SpanStatus) on success, or Left(ValidationError) on unknown or malformed input.

def parseSpanValue(json: Value): Result[SpanValue]

Parses a SpanValue from a JSON value, supporting typed and legacy untyped formats.

Parses a SpanValue from a JSON value, supporting typed and legacy untyped formats.

Value parameters

json

The JSON value representing a span attribute value.

Attributes

Returns

Right(SpanValue) on success, or Left(ValidationError) if the format is unrecognised.

def parseTrace(json: Value): Result[Trace]

Parses a Trace from a JSON object containing all required trace fields.

Parses a Trace from a JSON object containing all required trace fields.

Value parameters

json

The JSON value representing a trace.

Attributes

Returns

Right(Trace) on success, or Left(ValidationError) on missing or malformed fields.

def parseTraceId(json: Value): Result[TraceId]

Parses a TraceId from a JSON value.

Parses a TraceId from a JSON value.

Value parameters

json

The JSON value expected to be a string.

Attributes

Returns

Right(TraceId) on success, or Left(ValidationError) if the value is not a string.

Implicits

Implicits

final implicit def SpanEventJson(event: SpanEvent): SpanEventJson

Extension methods that add JSON serialisation to SpanEvent values.

Extension methods that add JSON serialisation to SpanEvent values.

Attributes

final implicit def SpanIdJson(spanId: SpanId): SpanIdJson

Extension methods that add JSON serialisation to SpanId values.

Extension methods that add JSON serialisation to SpanId values.

Attributes

final implicit def SpanJson(span: Span): SpanJson

Extension methods that add JSON serialisation to Span values.

Extension methods that add JSON serialisation to Span values.

Attributes

final implicit def SpanKindJson(kind: SpanKind): SpanKindJson

Extension methods that add JSON serialisation to SpanKind values.

Extension methods that add JSON serialisation to SpanKind values.

Attributes

final implicit def SpanStatusJson(status: SpanStatus): SpanStatusJson

Extension methods that add JSON serialisation to SpanStatus values.

Extension methods that add JSON serialisation to SpanStatus values.

Attributes

final implicit def SpanValueJson(sv: SpanValue): SpanValueJson

Extension methods that add JSON serialisation to SpanValue variants.

Extension methods that add JSON serialisation to SpanValue variants.

Attributes

final implicit def TraceIdJson(traceId: TraceId): TraceIdJson

Extension methods that add JSON serialisation to TraceId values.

Extension methods that add JSON serialisation to TraceId values.

Attributes

final implicit def TraceJson(trace: Trace): TraceJson

Extension methods that add JSON serialisation to Trace values.

Extension methods that add JSON serialisation to Trace values.

Attributes