Alarmist.Alarm (alarmist v0.3.1)

View Source

DSL for defining managed alarms

The general form is:

defmodule MyAlarmModule do
  use Alarmist.Alarm, level: :warning

  alarm_if do
    AlarmId1 and AlarmId2
  end
end

See __using__/1 for options to pass to use Alarmist.Alarm. See Alarmist.Ops for what operations can be included in alarm_if block.

Summary

Functions

Define a managed alarm

Define an alarm condition

Functions

__using__(options)

(macro)

Define a managed alarm

The following options can be passed to use Alarmist.Alarm:

  • :level - the alarm severity. See Logger.level/0. Defaults to :warning and can be overridden by Alarmist.set_alarm_level/2.
  • :parameters a list of atom keys that refine the scope of the alarm. For example, a networking alarm might specify [:ifname] to indicate that the alarm pertains to a specific network interface.
  • :style the alarm style when parameters are used. Defaults to :tagged_tuple to indicate that alarms are tuples where the first element is the alarm type and the subsequent elements are the parameters.

alarm_if(list)

(macro)

Define an alarm condition

See Alarmist.Ops for what operations can be included in alarm_if block.