Skip to content

Configuration Reference

Ketos Agent uses a clean four-section YAML configuration exposing only what operators actually tune:

  1. global (optional): Default intervals, capture windows, and ingestion budgets inherited by inputs and alerts.
  2. inputs: Enabled integrations (host, logs, APM, HTTP probe) and their schedules.
  3. alerts: Detection rules, evaluation cadence, and capture scope.
  4. storage (optional): Local storage directory and dual hard quotas.

[!TIP] All duration fields use standard Go duration syntax (e.g. 500ms, 5s, 1m, 30m). Only inputs and alerts are required; everything else has safe production defaults.


global:
interval: 5s
eval_interval: 1s
for: 0s
resolve_for: 15s
before: 60s
after: 15s
capture_on_resolve: true
inputs:
host:
- id: default
log_file:
- id: order_app
path: /var/log/order/app.log
apm:
- id: order_svc
http_listen: "127.0.0.1:4318"
http_probe:
- id: api_prod
url: https://api.example.com/health
interval: 10s
timeout: 5s
alerts:
- id: host_cpu_mem_high
severity: critical
for: 30s
expr: 'avg("cpu.usage_pct", 60) > 85 && last("mem.usage_pct") >= 85'
- id: api_prod_down_or_slow
severity: critical
for: 10s
before: 120s
after: 30s
expr: 'last("http_probe.api_prod.up") == 0 || avg("http_probe.api_prod.latency_ms", 60) > 1500'
attach: ["host/default"]
storage:
dir: ./data
max_disk_mb: 50
max_snapshots: 500

Field Type Default Description
interval duration 5s Default collection interval inherited by inputs
eval_interval duration 1s Default rule evaluation interval inherited by alerts
for duration 0s Default trigger debounce duration
resolve_for duration 15s Default recovery debounce duration to prevent flapping
before duration 60s Pre-trigger metric window frozen on incident capture
after duration 15s Post-trigger window awaited asynchronously after trigger
capture_on_resolve bool true Whether to write a closing ..._resolved.md snapshot on recovery
apm_max_inflight_requests int 2 Shared max in-flight OTLP HTTP/gRPC requests (restart required)

Four built-in integration types are supported, each allowing multiple named instances (omitting inputs entirely starts a default inputs.host instance with id: default):

See each integration page for full field tables and emitted metrics.


Field Type Default Description
id string required Unique rule ID; also used as snapshot folder data/snapshots/<id>/
severity string warning Severity level (e.g. info, warning, critical)
every duration global.eval_interval Rule evaluation cadence
for duration global.for Trigger debounce duration
resolve_for duration global.resolve_for Recovery debounce duration
repeat duration 0s (off) Optional repeat capture interval while continuously firing (e.g. 30m)
capture bool true Whether to capture an incident context when triggered
capture_on_resolve bool global.capture_on_resolve Whether to capture a recovery snapshot on Resolved
before duration global.before Per-rule pre-trigger window override
after duration global.after Per-rule post-trigger window override
attach []string [] Extra collector instances to include (e.g. ["host/default"] or ["*"])
type string expr expr (single expression) or sequence (ordered causal stages)
expr string - Alert expression (required when type: expr)
stages []string - Ordered stage expressions (required when type: sequence)
within duration - Maximum window to complete all stages (type: sequence)

Field Type Default Description
dir string ./data Root data directory; snapshots are stored under <dir>/snapshots/
max_disk_mb int 50 Hard disk ceiling in MB; oldest snapshots are evicted FIFO
max_snapshots int 500 Hard file-count ceiling; oldest snapshots are evicted FIFO with empty rule dirs pruned

When config.yml is saved (or SIGHUP is sent):

  • Applied live without data loss: Adding, removing, or modifying alerts rules, thresholds, and before/after windows.
  • Requires restart (logged as WARN): Changing inputs, ingestion budgets, storage settings, or local_only mode.

See Security & Resource Limits for all hard limits and degradation rules.