Observability
The typed sub-packages ship a Wrap(...) decorator that reports per-operation metrics to a Recorder you provide (bring your own metrics/tracing library). The Recorder interface differs per package because the recorded fields differ — vec records dimension and k; fts records the FTS5 MATCH expression; the VFS recorders record file kind, byte offset, and amount.
idx := fts.Wrap(rawIndex, fts.WithLogger(slog.Default()), fts.WithRecorder(myMetricsAdapter))- vec / fts —
vec.Wrap/fts.WrapwithWithLogger+WithRecorder. - VFS —
vfs.Wrap(base, recorder)for any VFS (per-op latency / bytes / errors);vfs.NewSlogRecorderis a ready-madelog/slogrecorder. See Custom VFS. - vfs/crypto —
Options.Recorder = crypto.NewSlogRecorder(slog.Default())for per-IO encryption observability (Encryption).
The core driver exposes lower-level hooks for the same purpose: (*Conn).SetTrace, RegisterUpdateHook, RegisterCommitHook, RegisterRollbackHook, RegisterPreUpdateHook, RegisterAuthorizer (Hooks). Prepared-statement and runtime telemetry: (*Conn).StmtCacheStats / Status and (*Stmt).Status.