Auto-Rotation Watchdog#
Added in v0.5. Continuously monitors three signals and either alerts or
fires infraguard rotate automatically when any of them crosses its
threshold:
- Burn score rising above
burn_thresholdand staying there forburn_windowseconds. - TLS certificate within
cert_days_beforedays of expiry. - Cloud spend above
cost_cap_usd(opt-in provider integration).
Configure#
Add a watchdog: block to config.yaml:
watchdog:
enabled: true
poll_interval: 300 # seconds between checks
burn_threshold: 0.8
burn_window: 900 # score must stay high this long
cert_days_before: 14 # rotate 14 days before LE expiry
cost_cap_usd: null # disable cost check
auto_rotate: true # false = alert only, no rotationAlert-only mode#
Set auto_rotate: false if you want the watchdog to page you but never
touch cloud APIs. The watchdog emits a RequestEvent with
filter_reason="burn_threshold_crossed" (or cert_expiring, etc.), so
the alerting plugins fire in the normal way:
plugins:
- infraguard.plugins.builtin.pagerduty
- infraguard.plugins.builtin.slack
plugin_settings:
pagerduty:
options:
integration_key: "${PAGERDUTY_KEY}"
event_types: [burn_threshold_crossed, cert_expiring, all_upstreams_failed]What triggers a rotation#
The watchdog logs each check at DEBUG. A rotation fires when either:
- Burn score has been continuously above
burn_thresholdfor at leastburn_windowseconds. Transient spikes do NOT rotate. - Any listener’s TLS cert is under
cert_days_beforedays from expiry.
What does NOT happen#
- Cloud billing checks require provider-specific API modules that are
not shipped.
cost_cap_usdaccepts the value but the check is a documented follow-up. - Rotation itself delegates to the existing
RotationManager(blue-green flow, provider-specific Terraform / Pulumi). The watchdog never speaks to cloud APIs directly.
See infrastructure-rotation for the underlying rotation flow.