Documentation
¶
Index ¶
- func Export(src, dst string, format ExportFormat, filter *Filter, ...) error
- func FormatBytes(b int64) string
- func FormatCount(n int64) string
- func IsError(msg string) bool
- func Merge(sources []string, dst string, progress func(MergeProgress)) error
- func NewInjector(faults []FaultConfig) func(recv.LogEntry) []recv.LogEntry
- func NormalizeMessage(msg string) string
- func Pack(src, dst string) error
- func ParseTimeFlag(s string, refDate, refTime time.Time) (time.Time, error)
- func RewriteWithOffset(src, dst string, offset time.Duration) (int64, error)
- func Slice(opts SliceOptions) error
- func Unpack(src, dst string) error
- func WriteCatalogJSON(w io.Writer, entries []CatalogEntry) error
- func WriteCatalogText(w io.Writer, entries []CatalogEntry)
- func WriteIndex(dir string, index *Index) error
- func WriteMetadata(dir string, meta *Metadata) error
- type BaselineDiffResult
- type Bucket
- type CatalogEntry
- type ClockCorrection
- type Correlation
- type DiffCapture
- type DiffResult
- type ErrorDelta
- type ErrorSignature
- type ErrorSummary
- type ExportFormat
- type ExportProgress
- type ExportWriter
- type FaultConfig
- type FaultType
- type Feeder
- func (f *Feeder) Done() bool
- func (f *Feeder) Err() error
- func (f *Feeder) LinesEmitted() int64
- func (f *Feeder) Paused() bool
- func (f *Feeder) SetLabelFilter(fn func(recv.LogEntry) bool)
- func (f *Feeder) SetSpeed(s Speed)
- func (f *Feeder) SetTransform(fn func(recv.LogEntry) []recv.LogEntry)
- func (f *Feeder) Speed() Speed
- func (f *Feeder) Start()
- func (f *Feeder) Stop()
- func (f *Feeder) TogglePause() bool
- type FileDigest
- type FileInfo
- type FileMismatch
- type Filter
- type GCDeletion
- type GCOptions
- type GCResult
- type GrepConfig
- type GrepFileCount
- type GrepMatch
- type GrepProgress
- type Index
- type IndexEntry
- type InjectWriteResult
- type Interaction
- type LabelFilter
- type LabelMatcher
- type LabelVal
- type MergeProgress
- type Metadata
- type Participant
- type RateBucket
- type Reader
- type ReplayModel
- type ReportCapture
- type ReportConfig
- type ReportResult
- type ReportTriage
- type SequenceDiagram
- type ServiceEntry
- type SignResult
- type SliceOptions
- type Speed
- type Summary
- type TalkerEntry
- type TimeWindow
- type TriageBucket
- type TriageConfig
- type TriageProgress
- type TriageResult
- func (r *TriageResult) WriteHTML(w io.Writer) error
- func (r *TriageResult) WriteJSON(w io.Writer) error
- func (r *TriageResult) WriteSequence(w io.Writer)
- func (r *TriageResult) WriteSummary(w io.Writer)
- func (r *TriageResult) WriteTimeline(w io.Writer)
- func (r *TriageResult) WriteTopErrors(w io.Writer)
- func (r *TriageResult) WriteTopTalkers(w io.Writer)
- func (r *TriageResult) WriteWindows(w io.Writer) error
- type TriageWindows
- type VerifyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Export ¶
func Export(src, dst string, format ExportFormat, filter *Filter, progress func(ExportProgress)) error
Export reads filtered entries from src and writes to dst in the given format.
func FormatBytes ¶
FormatBytes formats byte counts in human-readable form.
func FormatCount ¶
FormatCount formats large numbers with comma separators.
func Merge ¶ added in v0.3.0
func Merge(sources []string, dst string, progress func(MergeProgress)) error
Merge combines multiple capture directories into one by copying compressed files without decompressing. The output index.jsonl is sorted by timestamp.
func NewInjector ¶ added in v1.4.0
func NewInjector(faults []FaultConfig) func(recv.LogEntry) []recv.LogEntry
NewInjector creates a transform function that applies fault injection. Entries outside the fault window pass through unchanged.
func NormalizeMessage ¶
NormalizeMessage replaces variable tokens (UUIDs, IPs, timestamps, etc.) with placeholders to produce a stable signature for grouping similar messages.
func ParseTimeFlag ¶
ParseTimeFlag parses a time string in one of three formats: - RFC3339: "2024-01-15T10:32:00Z" - HH:MM: "10:32" — resolved against refDate - Relative: "-30m" — resolved against refTime
func RewriteWithOffset ¶ added in v1.5.0
RewriteWithOffset reads entries from src, adjusts timestamps by offset, and writes to dst.
func Unpack ¶ added in v0.3.0
Unpack extracts a tar.zst archive to a directory and validates the capture.
func WriteCatalogJSON ¶ added in v1.1.0
func WriteCatalogJSON(w io.Writer, entries []CatalogEntry) error
WriteCatalogJSON writes catalog entries as JSON.
func WriteCatalogText ¶ added in v1.1.0
func WriteCatalogText(w io.Writer, entries []CatalogEntry)
WriteCatalogText writes catalog entries as a formatted table.
func WriteIndex ¶ added in v1.0.6
WriteIndex writes the Index struct to index.jsonl in the specified directory.
func WriteMetadata ¶ added in v1.0.6
WriteMetadata writes the Metadata struct to metadata.json in the specified directory.
Types ¶
type BaselineDiffResult ¶ added in v1.2.0
type BaselineDiffResult struct {
Baseline string `json:"baseline"`
Current string `json:"current"`
ErrorRateChange string `json:"error_rate_change"`
VolumeChange string `json:"volume_change"`
NewErrorPatterns []ErrorDelta `json:"new_error_patterns,omitempty"`
MissingLabels []string `json:"missing_labels,omitempty"`
NewLabels []string `json:"new_labels,omitempty"`
Verdict string `json:"verdict"`
Confidence float64 `json:"confidence"`
}
BaselineDiffResult holds a verdict-oriented comparison against a baseline capture.
func BaselineDiff ¶ added in v1.2.0
func BaselineDiff(baselineDir, currentDir string) (*BaselineDiffResult, error)
BaselineDiff compares a current capture against a baseline, producing a verdict. baselineDir is the known-good reference; currentDir is the capture under evaluation.
func (*BaselineDiffResult) WriteJSON ¶ added in v1.2.0
func (b *BaselineDiffResult) WriteJSON(w io.Writer) error
WriteJSON writes the baseline diff result as JSON.
func (*BaselineDiffResult) WriteText ¶ added in v1.2.0
func (b *BaselineDiffResult) WriteText(w io.Writer)
WriteText writes a human-readable baseline diff summary.
type CatalogEntry ¶ added in v1.1.0
type CatalogEntry struct {
Dir string `json:"dir"`
Started time.Time `json:"started"`
Stopped time.Time `json:"stopped,omitempty"`
Files int `json:"files"`
Entries int64 `json:"entries"`
Bytes int64 `json:"bytes"`
Active bool `json:"active"`
Labels []string `json:"labels,omitempty"`
}
CatalogEntry represents one discovered capture directory.
type ClockCorrection ¶ added in v1.5.0
type ClockCorrection struct {
Source string `json:"source"`
OffsetMs int64 `json:"offset_ms"`
Confidence float64 `json:"confidence"`
Method string `json:"method"`
}
ClockCorrection describes a detected clock offset for one source.
func DetectSkew ¶ added in v1.5.0
func DetectSkew(sources []string) ([]ClockCorrection, error)
DetectSkew compares error signature timestamps across sources to estimate clock offsets. Returns one ClockCorrection per non-reference source. Sources with no detectable skew or skew exceeding maxSkewCorrection are omitted.
func MergeWithCorrection ¶ added in v1.5.0
func MergeWithCorrection(sources []string, dst string, progress func(MergeProgress)) ([]ClockCorrection, error)
MergeWithCorrection detects clock skew between sources, rewrites skewed captures with adjusted timestamps, then merges everything into dst.
type Correlation ¶ added in v1.2.0
type Correlation struct {
Source string `json:"source"` // service that failed first
Target string `json:"target"` // service that failed after
LagSeconds float64 `json:"lag_seconds"` // time between source and target errors
Pattern string `json:"pattern"` // cascade_timeout, cascade_error, co_failure
Confidence float64 `json:"confidence"` // 0.0-1.0
SourceError string `json:"source_error"` // first error from source
TargetError string `json:"target_error"` // first error from target
}
Correlation represents a detected temporal error pattern between two services.
type DiffCapture ¶ added in v0.3.0
type DiffCapture struct {
Dir string `json:"dir"`
Started time.Time `json:"started"`
Stopped time.Time `json:"stopped"`
Duration time.Duration `json:"duration"`
Lines int64 `json:"lines"`
LinesPerS float64 `json:"lines_per_sec"`
Labels []string `json:"labels"`
}
DiffCapture summarizes one side of the comparison.
type DiffResult ¶ added in v0.3.0
type DiffResult struct {
A DiffCapture `json:"a"`
B DiffCapture `json:"b"`
LabelsOnlyA []string `json:"labels_only_a,omitempty"`
LabelsOnlyB []string `json:"labels_only_b,omitempty"`
ErrorsOnlyA []ErrorSummary `json:"errors_only_a,omitempty"`
ErrorsOnlyB []ErrorSummary `json:"errors_only_b,omitempty"`
RateCompare []RateBucket `json:"rate_compare,omitempty"`
}
DiffResult holds the comparison between two captures.
func Diff ¶ added in v0.3.0
func Diff(srcA, srcB string) (*DiffResult, error)
Diff compares two capture directories.
func (*DiffResult) WriteJSON ¶ added in v0.3.0
func (d *DiffResult) WriteJSON(w io.Writer) error
WriteJSON writes the diff result as JSON.
func (*DiffResult) WriteText ¶ added in v0.3.0
func (d *DiffResult) WriteText(w io.Writer)
WriteText writes a human-readable diff summary.
type ErrorDelta ¶ added in v1.2.0
type ErrorDelta struct {
Pattern string `json:"pattern"`
Count int64 `json:"count"`
BaselineCount int64 `json:"baseline_count"`
}
ErrorDelta describes an error pattern that is new or significantly worse in the current capture.
type ErrorSignature ¶
type ErrorSignature struct {
Signature string `json:"signature"`
Count int64 `json:"count"`
FirstSeen time.Time `json:"first_seen"`
Example string `json:"example"`
}
ErrorSignature represents a normalized error pattern.
type ErrorSummary ¶ added in v0.3.0
ErrorSummary is a simplified error pattern with count.
type ExportFormat ¶
type ExportFormat string
ExportFormat identifies the output format.
const ( FormatParquet ExportFormat = "parquet" FormatCSV ExportFormat = "csv" FormatJSONL ExportFormat = "jsonl" )
type ExportProgress ¶
ExportProgress reports progress during export.
type ExportWriter ¶
ExportWriter writes log entries to an output format.
type FaultConfig ¶ added in v1.4.0
type FaultConfig struct {
Type FaultType
Service string // target service (for service-down, latency-spike)
At time.Time // when to start injection
Duration time.Duration // how long the fault lasts
}
FaultConfig describes a fault injection.
func ParseFault ¶ added in v1.4.0
func ParseFault(spec string) (FaultConfig, error)
ParseFault parses a fault spec string. Formats: "error-spike", "service-down=payment", "latency-spike=api".
type FaultType ¶ added in v1.4.0
type FaultType string
FaultType identifies the kind of fault to inject.
type Feeder ¶
type Feeder struct {
// contains filtered or unexported fields
}
Feeder pushes entries from a Reader into a LogRing at controlled speed.
func (*Feeder) LinesEmitted ¶
LinesEmitted returns the count of entries pushed to the ring.
func (*Feeder) SetLabelFilter ¶ added in v1.9.2
SetLabelFilter sets a predicate that entries must pass before being pushed. Must be called before Start.
func (*Feeder) SetTransform ¶ added in v1.4.0
SetTransform sets a transform function that processes each entry before pushing. The transform may return zero, one, or many entries per input entry.
func (*Feeder) TogglePause ¶
TogglePause toggles pause state. Returns new paused state.
type FileDigest ¶ added in v1.4.0
type FileDigest struct {
File string `json:"file"`
SHA256 string `json:"sha256"`
Bytes int64 `json:"bytes"`
}
FileDigest is a single file's SHA256 hash and size.
type FileInfo ¶
type FileInfo struct {
Path string
Name string
Index *rotate.IndexEntry // nil for orphan files
Orphan bool
}
FileInfo describes a data file in a capture directory.
type FileMismatch ¶ added in v1.4.0
type FileMismatch struct {
File string `json:"file"`
Expected string `json:"expected"`
Actual string `json:"actual"`
}
FileMismatch records a hash mismatch between manifest and actual file.
type Filter ¶
Filter provides two-tier filtering: file-level skip and entry-level match.
func (*Filter) MatchEntry ¶
MatchEntry returns true if the entry passes all filter criteria.
type GCDeletion ¶ added in v1.0.0
type GCDeletion struct {
Dir string `json:"dir"`
Started time.Time `json:"started"`
SizeBytes int64 `json:"size_bytes"`
Reasons []string `json:"reasons,omitempty"`
}
GCDeletion records a capture directory selected for deletion.
type GCResult ¶ added in v1.0.0
type GCResult struct {
Root string `json:"root"`
CaptureCount int `json:"capture_count"`
TotalBytes int64 `json:"total_bytes"`
MaxAge time.Duration `json:"max_age,omitempty"`
MaxTotalBytes int64 `json:"max_total_bytes,omitempty"`
DryRun bool `json:"dry_run"`
Deletions []GCDeletion `json:"deletions"`
// contains filtered or unexported fields
}
GCResult summarizes a GC run.
type GrepConfig ¶ added in v0.3.0
type GrepConfig struct {
CountOnly bool // only report per-file counts, do not call onMatch
Context int // number of surrounding lines to include (0 = matches only)
}
GrepConfig controls grep behavior.
type GrepFileCount ¶ added in v0.3.0
GrepFileCount holds the match count for a single file.
func Grep ¶ added in v0.3.0
func Grep(src string, filter *Filter, cfg GrepConfig, onMatch func(GrepMatch), progress func(GrepProgress)) ([]GrepFileCount, error)
Grep searches a capture directory for entries matching the filter. In default mode, calls onMatch for each matching entry. Returns per-file counts (only files with matches) and any error.
type GrepMatch ¶ added in v0.3.0
type GrepMatch struct {
File string
Entry recv.LogEntry
Context string // "" for actual match, "before" or "after" for context lines
Group int // context group ID (0 when context is not used); entries in the same group are contiguous
}
GrepMatch represents a matching entry with file context.
type GrepProgress ¶ added in v0.3.0
GrepProgress reports progress during grep scanning.
type Index ¶ added in v1.0.6
type Index struct {
Entries []IndexEntry `json:"entries"`
}
Index represents the structure of index.jsonl
type IndexEntry ¶ added in v1.0.6
type IndexEntry struct {
File string `json:"file"`
From time.Time `json:"from"`
To time.Time `json:"to"`
Lines int64 `json:"lines"`
Bytes int64 `json:"bytes"`
Labels map[string]map[string]int `json:"labels"`
}
IndexEntry represents a single entry in index.jsonl
type InjectWriteResult ¶ added in v1.4.0
type InjectWriteResult struct {
Source string `json:"source"`
Output string `json:"output"`
OriginalLines int64 `json:"original_lines"`
InjectedLines int64 `json:"injected_lines"`
TotalLines int64 `json:"total_lines"`
Faults int `json:"faults_applied"`
}
InjectWriteResult describes the output of a fault-injection write.
func InjectWrite ¶ added in v1.4.0
func InjectWrite(src, dst string, filter *Filter, faults []FaultConfig) (*InjectWriteResult, error)
InjectWrite reads entries from a capture, applies fault injection, and writes the modified stream to a new capture directory.
func (*InjectWriteResult) WriteJSON ¶ added in v1.4.0
func (r *InjectWriteResult) WriteJSON(w io.Writer) error
WriteJSON writes the result as JSON to w.
func (*InjectWriteResult) WriteText ¶ added in v1.4.0
func (r *InjectWriteResult) WriteText(w io.Writer)
WriteText writes the result as human-readable text to w.
type Interaction ¶ added in v1.4.0
type Interaction struct {
From string `json:"from"`
To string `json:"to"`
LagSeconds float64 `json:"lag_seconds"`
Pattern string `json:"pattern"`
Confidence float64 `json:"confidence"`
Label string `json:"label"`
}
Interaction represents an arrow between two participants.
type LabelFilter ¶ added in v1.0.6
LabelFilter represents a key-value pair for label filtering.
type LabelMatcher ¶
LabelMatcher matches a specific label key=value pair.
func ParseLabelFlag ¶
func ParseLabelFlag(s string) (LabelMatcher, error)
ParseLabelFlag parses a "key=value" label matcher.
type LabelVal ¶
type LabelVal struct {
Value string `json:"value"`
Lines int64 `json:"lines"`
Bytes int64 `json:"bytes"`
}
LabelVal summarizes one label value's contribution.
type MergeProgress ¶ added in v0.3.0
MergeProgress reports progress during merge.
type Metadata ¶ added in v1.0.6
type Metadata struct {
Version int `json:"version"`
Format string `json:"format"`
Started time.Time `json:"started"`
Stopped time.Time `json:"stopped"`
TotalLines int64 `json:"total_lines"`
TotalBytes int64 `json:"total_bytes"`
LabelsSeen []string `json:"labels_seen"`
Redaction map[string]interface{} `json:"redaction"`
}
Metadata represents the structure of metadata.json
func NewMetadata ¶ added in v1.0.6
func NewMetadata() *Metadata
NewMetadata creates a new Metadata instance with default values.
func ReadMetadata ¶ added in v1.0.6
ReadMetadata reads the metadata.json file from the specified directory.
type Participant ¶ added in v1.4.0
Participant represents a service in the sequence diagram.
type RateBucket ¶ added in v0.3.0
type RateBucket struct {
Minute time.Time `json:"minute"`
RateA int64 `json:"rate_a"`
RateB int64 `json:"rate_b"`
}
RateBucket compares log rates at a given minute.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader provides streaming access to a capture directory.
func (*Reader) Scan ¶
Scan iterates all files in order, applying the filter and calling fn for each matching entry. If fn returns false, scanning stops early. Returns total lines scanned and any error.
func (*Reader) ServiceSummary ¶ added in v1.9.2
func (r *Reader) ServiceSummary() []ServiceEntry
ServiceSummary aggregates label values and line counts across all indexed files. It picks the label key with the most distinct values (usually "app" or "container"). Returns nil if no label data is available.
func (*Reader) TotalLines ¶
TotalLines returns the sum of lines from all files, including orphans.
type ReplayModel ¶
type ReplayModel struct {
// contains filtered or unexported fields
}
ReplayModel is the bubbletea model for the capture replay TUI.
func NewReplayModel ¶
func NewReplayModel(feeder *Feeder, ring *recv.LogRing, meta *recv.Metadata, dir string, totalLines int64, services []ServiceEntry) ReplayModel
NewReplayModel creates a replay TUI model. If services has >1 entry, a picker is shown before replay starts.
func (ReplayModel) Init ¶
func (m ReplayModel) Init() tea.Cmd
Init starts the tick timer and the feeder (unless picker is shown first).
type ReportCapture ¶ added in v1.1.0
type ReportCapture struct {
Dir string `json:"dir"`
Files int `json:"files"`
Entries int64 `json:"entries"`
Bytes int64 `json:"bytes"`
Started time.Time `json:"started"`
Stopped time.Time `json:"stopped,omitempty"`
DurationSeconds float64 `json:"duration_seconds"`
}
ReportCapture holds capture metadata for the report.
type ReportConfig ¶ added in v1.1.0
ReportConfig controls report generation behavior.
type ReportResult ¶ added in v1.1.0
type ReportResult struct {
Capture ReportCapture `json:"capture"`
Labels map[string]int `json:"labels"`
Triage ReportTriage `json:"triage"`
Severity string `json:"severity"`
Suggested []string `json:"suggested_commands,omitempty"`
}
ReportResult is the single-artifact incident deliverable.
func Report ¶ added in v1.1.0
func Report(dir string, cfg ReportConfig, progress func(TriageProgress)) (*ReportResult, error)
Report generates a combined inspect + triage result for a capture directory.
func (*ReportResult) WriteHTML ¶ added in v1.1.0
func (r *ReportResult) WriteHTML(w io.Writer, triageResult *TriageResult, meta *recv.Metadata) error
WriteHTML writes a self-contained HTML report. It delegates to the triage HTML writer with an extended header.
type ReportTriage ¶ added in v1.1.0
type ReportTriage struct {
TotalLines int64 `json:"total_lines"`
ErrorLines int64 `json:"error_lines"`
ErrorRatePct float64 `json:"error_rate_pct"`
TopErrors []ErrorSignature `json:"top_errors,omitempty"`
Windows TriageWindows `json:"windows"`
}
ReportTriage holds triage results for the report.
type SequenceDiagram ¶ added in v1.4.0
type SequenceDiagram struct {
Participants []Participant `json:"participants"`
Interactions []Interaction `json:"interactions"`
}
SequenceDiagram holds participants and interactions for ASCII rendering.
func BuildSequence ¶ added in v1.4.0
func BuildSequence(correlations []Correlation) *SequenceDiagram
BuildSequence converts correlations into a renderable sequence diagram.
func (*SequenceDiagram) WriteASCII ¶ added in v1.4.0
func (s *SequenceDiagram) WriteASCII(w io.Writer)
WriteASCII renders the sequence diagram as ASCII art.
type ServiceEntry ¶ added in v1.9.2
ServiceEntry describes one label value and its total line count.
type SignResult ¶ added in v1.4.0
type SignResult struct {
Dir string `json:"dir"`
RootHash string `json:"root_hash"`
Files []FileDigest `json:"files"`
SignedAt time.Time `json:"signed_at"`
}
SignResult holds the output of signing a capture directory.
func Sign ¶ added in v1.4.0
func Sign(dir string) (*SignResult, error)
Sign computes SHA256 hashes for all files in a capture directory and writes a manifest.sha256 file. Returns the signing result.
func (*SignResult) WriteJSON ¶ added in v1.4.0
func (r *SignResult) WriteJSON(w io.Writer) error
WriteJSON writes the sign result as indented JSON.
func (*SignResult) WriteText ¶ added in v1.4.0
func (r *SignResult) WriteText(w io.Writer)
WriteText writes a human-readable signing summary.
type SliceOptions ¶ added in v1.0.6
type SliceOptions struct {
From time.Time
To time.Time
Labels []LabelFilter
Grep *regexp.Regexp
OutputDir string
CaptureDir string
}
SliceOptions holds the parameters for the slicing operation.
type Speed ¶
type Speed float64
Speed controls replay rate. 0 = instant, 1 = realtime, N = fast-forward.
type Summary ¶
type Summary struct {
Dir string `json:"dir"`
Meta *recv.Metadata `json:"metadata"`
Files int `json:"files"`
TotalLines int64 `json:"total_lines"`
TotalBytes int64 `json:"total_bytes"`
DiskSize int64 `json:"disk_size"`
DataFrom time.Time `json:"data_from,omitempty"`
DataTo time.Time `json:"data_to,omitempty"`
LinesPerSec float64 `json:"lines_per_sec,omitempty"`
BucketWidth string `json:"bucket_width,omitempty"`
Labels map[string][]LabelVal `json:"labels,omitempty"`
Timeline []Bucket `json:"timeline,omitempty"`
}
Summary holds aggregated information about a capture directory.
func Inspect ¶
Inspect reads metadata.json and index.jsonl from a capture directory and returns an aggregated summary. No decompression is performed.
type TalkerEntry ¶
type TalkerEntry struct {
Value string `json:"value"`
TotalLines int64 `json:"total_lines"`
ErrorLines int64 `json:"error_lines"`
}
TalkerEntry represents volume per label value.
type TimeWindow ¶
type TimeWindow struct {
From string `json:"from"`
To string `json:"to"`
Desc string `json:"description"`
}
TimeWindow represents a recommended time range.
type TriageBucket ¶
type TriageBucket struct {
Time time.Time `json:"time"`
TotalLines int64 `json:"total_lines"`
ErrorLines int64 `json:"error_lines"`
}
TriageBucket represents one time window in the histogram.
type TriageConfig ¶
type TriageConfig struct {
Jobs int // parallel workers (default runtime.NumCPU())
Window time.Duration // histogram bucket width (default 1m)
Top int // top error signatures (default 50)
MaxSignatures int // cap on unique signatures kept in memory (default 10000)
}
TriageConfig controls triage behavior.
type TriageProgress ¶
TriageProgress reports progress during triage scanning.
type TriageResult ¶
type TriageResult struct {
Dir string `json:"dir"`
Meta *recv.Metadata `json:"metadata,omitempty"`
Timeline []TriageBucket `json:"timeline,omitempty"`
Errors []ErrorSignature `json:"errors,omitempty"`
Talkers map[string][]TalkerEntry `json:"talkers,omitempty"`
Windows TriageWindows `json:"windows"`
Correlations []Correlation `json:"correlations,omitempty"`
TotalLines int64 `json:"total_lines"`
ErrorLines int64 `json:"error_lines"`
}
TriageResult holds all triage output data.
func Triage ¶
func Triage(src string, cfg TriageConfig, progress func(TriageProgress)) (*TriageResult, error)
Triage scans a capture directory for anomalies and produces a summary report.
func (*TriageResult) WriteHTML ¶ added in v1.0.0
func (r *TriageResult) WriteHTML(w io.Writer) error
WriteHTML writes a self-contained HTML triage report.
func (*TriageResult) WriteJSON ¶ added in v0.3.0
func (r *TriageResult) WriteJSON(w io.Writer) error
WriteJSON writes the full triage result as JSON.
func (*TriageResult) WriteSequence ¶ added in v1.4.0
func (r *TriageResult) WriteSequence(w io.Writer)
WriteSequence writes an ASCII sequence diagram of cross-service correlations.
func (*TriageResult) WriteSummary ¶
func (r *TriageResult) WriteSummary(w io.Writer)
WriteSummary writes a human-readable triage report.
func (*TriageResult) WriteTimeline ¶
func (r *TriageResult) WriteTimeline(w io.Writer)
WriteTimeline writes a CSV histogram: minute,total_lines,error_lines.
func (*TriageResult) WriteTopErrors ¶
func (r *TriageResult) WriteTopErrors(w io.Writer)
WriteTopErrors writes ranked error signatures.
func (*TriageResult) WriteTopTalkers ¶
func (r *TriageResult) WriteTopTalkers(w io.Writer)
WriteTopTalkers writes volume per label value, sorted by line count.
func (*TriageResult) WriteWindows ¶
func (r *TriageResult) WriteWindows(w io.Writer) error
WriteWindows writes recommended time windows as JSON.
type TriageWindows ¶
type TriageWindows struct {
PeakError *TimeWindow `json:"peak_error,omitempty"`
IncidentStart *TimeWindow `json:"incident_start,omitempty"`
SteadyState *TimeWindow `json:"steady_state,omitempty"`
}
TriageWindows holds recommended time windows for slicing.
type VerifyResult ¶ added in v1.4.0
type VerifyResult struct {
Dir string `json:"dir"`
RootHash string `json:"root_hash"`
Valid bool `json:"valid"`
Mismatches []FileMismatch `json:"mismatches,omitempty"`
Missing []string `json:"missing,omitempty"`
Extra []string `json:"extra,omitempty"`
}
VerifyResult holds the output of verifying a signed capture.
func Verify ¶ added in v1.4.0
func Verify(dir string) (*VerifyResult, error)
Verify checks the integrity of a signed capture directory against its manifest.
func (*VerifyResult) WriteJSON ¶ added in v1.4.0
func (r *VerifyResult) WriteJSON(w io.Writer) error
WriteJSON writes the verify result as indented JSON.
func (*VerifyResult) WriteText ¶ added in v1.4.0
func (r *VerifyResult) WriteText(w io.Writer)
WriteText writes a human-readable verification summary.