Beamlens.Skill.Anomaly (beamlens v0.3.1)

View Source

Self-learning statistical anomaly detection for BEAM metrics.

Monitors skill metrics and automatically detects anomalies using z-score analysis. Learns deployment-specific baselines during initial learning period, then continuously monitors for deviations.

Zero Production Impact

All metrics are collected from existing skill snapshots (read-only). Detection runs in a separate GenServer with configurable intervals.

Configuration

Pass configuration at runtime via the supervision tree:

{Beamlens.Skill.Anomaly.Supervisor,
 [
   collection_interval_ms: :timer.seconds(30),
   learning_duration_ms: :timer.hours(2),
   z_threshold: 3.0,
   consecutive_required: 3,
   cooldown_ms: :timer.minutes(15),
   history_minutes: 60,
   auto_trigger: true,        # triggers Coordinator on anomalies (default)
   max_triggers_per_hour: 3   # rate limit (default)
 ]}

State Machine

  • Learning: Collects baseline data from all enabled skills
  • Active: Detects anomalies using z-score analysis
  • Cooldown: Waits after escalation before resuming detection

Summary

Functions

Get the current detector state.

Get detailed detector status.

Functions

get_state()

Get the current detector state.

get_status()

Get detailed detector status.