Raxol.Core.Metrics.AlertManager (Raxol v0.5.0)

View Source

Alert management system for the Raxol metrics.

This module handles:

  • Alert rule definition and management
  • Metric threshold monitoring
  • Alert state tracking
  • Alert notifications
  • Alert history

Summary

Functions

Acknowledges an alert.

Adds a new alert rule.

Returns a specification to start this module under a supervisor.

Gets the alert history.

Gets the current alert state for a rule.

Gets all alert rules.

Starts the alert manager.

Types

alert_condition()

@type alert_condition() :: :above | :below | :equals | :not_equals

alert_rule()

@type alert_rule() :: %{
  name: String.t(),
  description: String.t(),
  metric_name: String.t(),
  condition: alert_condition(),
  threshold: number(),
  severity: alert_severity(),
  tags: map(),
  group_by: [String.t()],
  cooldown: pos_integer(),
  notification_channels: [String.t()]
}

alert_severity()

@type alert_severity() :: :info | :warning | :error | :critical

Functions

acknowledge_alert(rule_id)

Acknowledges an alert.

add_rule(rule)

Adds a new alert rule.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_alert_history(rule_id)

Gets the alert history.

get_alert_state(rule_id)

Gets the current alert state for a rule.

get_rules()

Gets all alert rules.

start_link(opts \\ [])

Starts the alert manager.