Alarmist.Alarm (alarmist v0.4.0)
View SourceDSL for defining managed alarms
The general form is:
defmodule MyAlarmModule do
use Alarmist.Alarm, level: :warning
alarm_if do
AlarmId1 and AlarmId2
end
endSee __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
The following options can be passed to use Alarmist.Alarm:
:level- the alarm severity. SeeLogger.level/0. Defaults to:warningand can be overridden byAlarmist.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.:remedy- a function or a {function, options} tuple. The function is called when the alarm is set. The function can either be a reference or MFA taking 0 or 1 arguments. If 1-arity, it is passed thealarm_id.:style- the alarm style when parameters are used. Defaults to:tagged_tupleto indicate that alarms are tuples where the first element is the alarm type and the subsequent elements are the parameters.
Define an alarm condition
See Alarmist.Ops for what operations can be included in alarm_if block.