Monitorex.Notifier behaviour (monitorex v0.6.0)

Copy Markdown

Behaviour for alert notification channels.

Implementations receive a structured alert map and dispatch it to external services (Slack, Discord, email, PagerDuty, etc.).

Summary

Types

alert()

@type alert() :: %{
  alert_name: String.t(),
  host: String.t(),
  value: number(),
  threshold: number(),
  operator: atom(),
  reason: String.t(),
  timestamp: integer(),
  metric: atom()
}

Callbacks

notify(alert, config)

@callback notify(alert(), config :: term()) :: :ok | {:error, term()}