Documentation
¶
Index ¶
- type Store
- func (s *Store) Clear(ctx context.Context) error
- func (s *Store) Close() error
- func (s *Store) GetTrace(ctx context.Context, traceIDHex string) (store.TraceDetail, error)
- func (s *Store) ListFieldValues(ctx context.Context, f store.ValueFilter) ([]string, error)
- func (s *Store) ListFields(ctx context.Context, f store.FieldFilter) ([]store.FieldInfo, error)
- func (s *Store) ListQueryHistory(ctx context.Context, limit int) ([]store.QueryHistoryEntry, error)
- func (s *Store) ListServices(ctx context.Context) ([]store.ServiceSummary, error)
- func (s *Store) ListSpanNames(ctx context.Context, service, prefix string, limit int) ([]string, error)
- func (s *Store) ListTraces(ctx context.Context, f store.TraceFilter) ([]store.TraceSummary, string, error)
- func (s *Store) ReaderDB() *sql.DB
- func (s *Store) RecordQueryRun(ctx context.Context, dataset, queryJSON, displayText string, hash []byte) error
- func (s *Store) Retain(ctx context.Context, olderThanNS int64) error
- func (s *Store) RunQuery(ctx context.Context, sqlStr string, args []any, columns []store.QueryColumn, ...) (store.QueryResult, error)
- func (s *Store) SearchLogs(ctx context.Context, f store.LogFilter) ([]store.LogOut, string, error)
- func (s *Store) WriteBatch(ctx context.Context, b store.Batch) error
- func (s *Store) WriterDB() *sql.DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a SQLite-backed implementation of store.Store.
Two *sql.DB handles point at the same file:
- writer: MaxOpenConns=1. All mutations go through this pool; the single connection serializes writes, which is what SQLite's WAL wants anyway.
- reader: MaxOpenConns=N. Readers share the WAL with the writer and don't block each other.
func (*Store) ListFieldValues ¶
func (*Store) ListFields ¶
func (*Store) ListQueryHistory ¶ added in v0.11.0
ListQueryHistory returns rows ordered by last_run_ns DESC, capped at limit.
func (*Store) ListServices ¶
func (*Store) ListSpanNames ¶
func (*Store) ListTraces ¶
func (s *Store) ListTraces(ctx context.Context, f store.TraceFilter) ([]store.TraceSummary, string, error)
func (*Store) RecordQueryRun ¶ added in v0.11.0
func (s *Store) RecordQueryRun(ctx context.Context, dataset, queryJSON, displayText string, hash []byte) error
RecordQueryRun upserts a query_history row keyed by the content hash. First run inserts with run_count = 1; subsequent runs update last_run_ns and increment run_count. When the table crosses queryHistoryCap rows, the oldest entries by last_run_ns are trimmed.
func (*Store) RunQuery ¶
func (s *Store) RunQuery( ctx context.Context, sqlStr string, args []any, columns []store.QueryColumn, hasBucket bool, groupKeys []string, rates []store.QueryRateSpec, ) (store.QueryResult, error)
func (*Store) SearchLogs ¶
func (*Store) WriteBatch ¶
WriteBatch persists one ingest batch inside a single transaction.
Order: resources → scopes → events → span_events → span_links → metric_events → attribute_keys → attribute_values.
Click to show internal directories.
Click to hide internal directories.