InMemoryTraceStore

org.llm4s.trace.store.InMemoryTraceStore
See theInMemoryTraceStore companion object
class InMemoryTraceStore extends TraceStore[Id]

Thread-safe, in-process TraceStore[Id] backed by immutable maps.

All operations are synchronous and never fail (F = cats.Id). Intended for testing and single-process observability. All state is lost when the JVM exits. Use InMemoryTraceStore() to construct.

Attributes

Companion
object
Graph
Supertypes
trait TraceStore[Id]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def clear(): Unit

Remove all traces and spans.

Remove all traces and spans.

Attributes

Definition Classes
override def deleteTrace(traceId: TraceId): Boolean

Removes the trace and all associated spans from the store.

Removes the trace and all associated spans from the store.

Both the trace record and every span with the same traceId are deleted in a single synchronised operation. Returns false when no trace with the given traceId exists; span cleanup is still attempted in that case.

Attributes

Returns

true when the trace existed and was removed; false otherwise

Definition Classes
override def getSpans(traceId: TraceId): 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

Definition Classes
override def getTrace(traceId: TraceId): 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

Definition Classes
override def queryTraces(query: TraceQuery): TracePage

Returns a page of traces matching the query, ordered by start time ascending.

Returns a page of traces matching the query, ordered by start time ascending.

== Cursor semantics == The nextCursor in the returned TracePage is the traceId string of the last trace on the current page. Pass it back as query.cursor to fetch the next page. An unrecognised cursor (e.g. from a deleted trace or a stale reference) is treated as absent — the query starts from the beginning of the result set rather than returning an error.

== Filter combination == All non-empty filter fields in TraceQuery are combined with AND semantics.

Attributes

Definition Classes
override def saveSpan(span: Span): Unit

Append a span to the trace it belongs to.

Append a span to the trace it belongs to.

Attributes

Definition Classes
override def saveTrace(trace: Trace): Unit

Persist or overwrite a trace record.

Persist or overwrite a trace record.

Attributes

Definition Classes
override def searchByMetadata(key: String, value: String): 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

Definition Classes