TraceStore

org.llm4s.trace.store.TraceStore
trait TraceStore[F[_]]

Pluggable backend for storing traces and their spans.

The effect type F[_] abstracts over the execution model:

  • InMemoryTraceStore uses cats.Id — synchronous, never fails.
  • Future backends (Postgres, Redis, …) can use IO, Future, or any effect that natively carries failure, without changing call sites.

Implementations must be thread-safe.

Type parameters

F

effect in which all operations are expressed; no typeclass bound is imposed — each implementation declares its own semantics (synchronous, async, etc.)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def clear(): F[Unit]

Remove all traces and spans.

Remove all traces and spans.

Attributes

def deleteTrace(traceId: TraceId): F[Boolean]

Remove the trace and all its spans atomically.

Remove the trace and all its spans atomically.

Attributes

Returns

true if the trace existed and was removed, false if not found

def getSpans(traceId: TraceId): F[List[Span]]

Return all spans recorded under the given trace, in insertion order.

Return all spans recorded under the given trace, in insertion order.

Attributes

def getTrace(traceId: TraceId): F[Option[Trace]]

Look up a trace by its ID, or None if not found.

Look up a trace by its ID, or None if not found.

Attributes

def queryTraces(query: TraceQuery): F[TracePage]

Return a page of traces matching query, sorted by start time ascending.

Return a page of traces matching query, sorted by start time ascending.

Value parameters

query

filters, cursor and page size

Attributes

def saveSpan(span: Span): F[Unit]

Append a span to the trace it belongs to.

Append a span to the trace it belongs to.

Attributes

def saveTrace(trace: Trace): F[Unit]

Persist or overwrite a trace record.

Persist or overwrite a trace record.

Attributes

def searchByMetadata(key: String, value: String): F[List[TraceId]]

Return all trace IDs whose metadata contains the given key/value pair.

Return all trace IDs whose metadata contains the given key/value pair.

Attributes