Configuring the Alert Rules
To configure the alert rules, use the following configuration:
config
alerts rules group alert_group_name
interval-seconds seconds
rule rule_name
expression promql_expression
duration duration
severity severity_level
type alert-type
annotation annotation_name
value annotation_value
end
NOTES:
-
alerts rules —Specify the Prometheus alerting rules.
-
group alert_group_name —Specify the Prometheus alerting rule group. One alert group can have multiple lists of rules. alert-group-name is the name of the alert group. The alert-group-name must be a string in the range of 0–64 characters.
-
interval-seconds seconds —Specify the evaluation interval of the rule group in seconds.
-
rule rule_name —Specify the alerting rule definition. rule_name is the name of the rule.
-
expression promql_expression —Specify the PromQL alerting rule expression. promql_expression is the alert rule query expressed in PromQL syntax.
-
duration duration —Specify the duration of a true condition before it’s considered true. duration is the time interval before the alert is triggered.
-
severity severity_level —Specify the severity of the alert. severity-level is the severity level of the alert. The severity levels are critical, major, minor, and warning.
-
type alert_type —Specify the type of the alert. alert_type is the user-defined alert type. For example, Communications Alarm, Environmental Alarm, Equipment Alarm, Indeterminate Integrity Violation Alarm, Operational Violation Alarm, Physical Violation Alarm, Processing Error Alarm, Quality of Service Alarm, Security Service Alarm, Mechanism Violation Alarm, or Time Domain Violation Alarm.
-
annotation annotation_name —Specify the annotation to attach to the alerts. annotation_name is the name of the annotation.
-
value annotation_value —Specify the annotation value. annotation_value is the value of the annotation.