Alarmist.Alarm (alarmist v0.3.1)
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
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
The following options can be passed to use Alarmist.Alarm
:
:level
- the alarm severity. SeeLogger.level/0
. Defaults to:warning
and 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.: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.
Define an alarm condition
See Alarmist.Ops
for what operations can be included in alarm_if
block.