TimelessTraces.LibsqlEngine (timeless_traces v1.10.0)

Copy Markdown View Source

In-process storage engine over the timeless-libsql timeless_traces virtual table — the traces instance of the port pattern proven in timeless_logs (timeless_logs/notes/libsql_engine_port_plan_2026-08-09.md).

Opt-in via config :timeless_traces, engine: :libsql. The writer owns <data_dir>/traces.db: ingest encodes the migration candidate's validated rich-span-v1 batches and control commands ride the vtab's command channel — the same public surface the external Rust owner uses, so embedded and external share one on-disk format.

Summary

Functions

Single-snapshot backup: flush, then VACUUM INTO <target>/traces.db.

Returns a specification to start this module under a supervisor.

Persist buffered spans into blocks now.

Ingest spans (maps or %TimelessTraces.Span{}).

Distinct operation names for a service.

Run a bounded background optimize pass.

Query spans with the facade's filter vocabulary.

Distinct service names.

Aggregate statistics from timeless_stats('traces').

All spans of one trace, ascending by start time.

Functions

backup(target_dir)

Single-snapshot backup: flush, then VACUUM INTO <target>/traces.db.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

flush()

Persist buffered spans into blocks now.

ingest(spans)

Ingest spans (maps or %TimelessTraces.Span{}).

operations(service)

Distinct operation names for a service.

optimize()

Run a bounded background optimize pass.

query(filters)

Query spans with the facade's filter vocabulary.

services()

Distinct service names.

start_link(opts)

stats()

Aggregate statistics from timeless_stats('traces').

trace(trace_id)

All spans of one trace, ascending by start time.