Documentation
¶
Overview ¶
Package archive implements hot/cold storage tiering for OtelContext. Data older than HOT_RETENTION_DAYS is moved from the relational DB (hot) to zstd-compressed JSONL files on local disk (cold). Cold files are organized as: {cold_path}/{year}/{month}/{day}/{type}.jsonl.zst Each day directory also contains a manifest.json with record counts and checksums.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Archiver ¶
type Archiver struct {
// contains filtered or unexported fields
}
Archiver moves data older than the hot retention window to compressed cold files.
func New ¶
func New(repo *storage.Repository, cfg *config.Config) *Archiver
New creates a new Archiver.
func (*Archiver) RecordsMoved ¶
RecordsMoved returns the total number of records moved to cold storage.
func (*Archiver) RunOnce ¶
RunOnce performs a single archival pass — useful for testing or manual triggers.
func (*Archiver) SetMetrics ¶
SetMetrics wires Prometheus metrics into the archiver.
type Manifest ¶
type Manifest struct {
Date string `json:"date"`
ArchivedAt time.Time `json:"archived_at"`
TraceCount int `json:"trace_count"`
LogCount int `json:"log_count"`
MetricCount int `json:"metric_count"`
TraceBytes int64 `json:"trace_bytes"`
LogBytes int64 `json:"log_bytes"`
MetricBytes int64 `json:"metric_bytes"`
TraceHash string `json:"trace_sha256"`
LogHash string `json:"log_sha256"`
MetricHash string `json:"metric_sha256"`
}
Manifest describes what was archived in a single day directory.