Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 3.74 KB

File metadata and controls

64 lines (49 loc) · 3.74 KB
title pg hardstorage anomaly
description CLI reference for the pg hardstorage anomaly command.
tags
cli
reference

pg_hardstorage anomaly

Inspect backup metric baselines for outliers

Synopsis

anomaly compares each backup's logical bytes, duration, file count, and unique-chunk count against the rolling baseline of same-type prior backups for the same deployment. A z-score above the threshold (default 3.0) flags a metric as unusual.

Subcommands: check Score the latest (or all, with --all) backup(s).

The math is intentionally simple: rolling mean + sample stddev over the most-recent N priors of the same backup type, no seasonal adjustment. Backup metrics aren't seasonal in any meaningful way (a 04:00 backup and a 16:00 backup should look the same), and clever forecasting here is just an opportunity to be wrong.

Findings flip the exit code to 9 (ExitVerifyFailed) so cron-driven checks alarm. An audit-chain entry is written on every flag — bit-rot-style: rare enough to be signal, not noise.

Options

  -h, --help   help for anomaly

Options inherited from parent commands

      --airgapped airgapped: strict                                                       refuse outbound endpoints (LLM providers, sinks, OTLP collectors) outside loopback / RFC1918 / explicit airgap.allowlist. Also enabled by PG_HARDSTORAGE_AIRGAPPED=1 or airgapped: strict in the config file.
  -c, --config string                                                                     path to config file (default: XDG/FHS lookup)
      --cpu-profile go tool pprof <path>                                                  write a pprof CPU profile to this path for the duration of the command (go tool pprof <path> to analyse). Off when empty.
      --mem-profile string                                                                write a pprof heap profile to this path at command exit. Off when empty.
      --no-color                                                                          disable ANSI color in text output
      --on-error-llm                                                                      on a structured-error failure, drop into the matching LLM helper skill (auto_on_error trigger). Also enabled by PG_HARDSTORAGE_ON_ERROR_LLM=1.
      --otel-endpoint string                                                              OpenTelemetry OTLP/HTTP endpoint (e.g. http://otel-collector:4318); empty disables tracing
      --otel-stdout                                                                       also export OpenTelemetry traces to stderr (useful for dev)
  -o, --output string                                                                     output format: text|json|ndjson|yaml|template|csv|markdown|html|tap|junit|pdf (default: text on TTY, json off-TTY)
      --profile-port go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30   if non-zero, expose net/http/pprof on 127.0.0.1:<port> for live profiling of long-running commands (e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30). Off when zero.
  -q, --quiet                                                                             suppress non-essential output
      --template string                                                                   Go text/template applied when --output template (or implied if --template is set without --output)

SEE ALSO