Enum Class AlertSeverity
- All Implemented Interfaces:
Serializable,Comparable<AlertSeverity>,Constable
How urgent an alert is. Ordered from least to most severe, so
isAtLeast / compareTo can be used for "minimum severity" checks.
An alert means "a person should do something". INFO is for worth-a-glance
items that never page anyone; external channels ignore it by default.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic AlertSeverityfromLabel(String label, AlertSeverity fallback) Leniently map a severity label from another system (Prometheus, a producer's own enum, etc) to an AlertSeverity.booleanisAtLeast(AlertSeverity other) True when this severity is the same as, or more severe than, the other.static AlertSeverityReturns the enum constant of this class with the specified name.static AlertSeverity[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INFO
-
WARNING
-
ERROR
-
CRITICAL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isAtLeast
True when this severity is the same as, or more severe than, the other. A null other is treated as INFO (so everything is at least it). -
fromLabel
Leniently map a severity label from another system (Prometheus, a producer's own enum, etc) to an AlertSeverity. Case-insensitive; accepts common synonyms ("warn", "err", "fatal", "page", "info"/"informational"). Returns the fallback for null, blank or unknown values.
-