AlertCondition (v1)¶
AlertCondition defines a burn-rate condition for an SLO. An AlertPolicy controls whether a breaching condition triggers an alert.
Properties¶
apiVersion¶
string required
Version represents a version of the OpenSLO specification.
Allowed values: openslo/v1
Validation rules
| Rule |
|---|
| property is required |
must be equal to openslo/v1 |
kind¶
string required
Kind represents all the object kinds defined by OpenSLO specification. Keep in mind not all specification versions support every Kind.
Allowed values: AlertCondition
Validation rules
| Rule |
|---|
| property is required |
must be equal to AlertCondition |
metadata¶
struct required reference
See the metadata definition in the overview.
Validation rules
| Rule |
|---|
| property is required |
spec¶
struct required
AlertConditionSpec defines an alert's severity and burn-rate condition.
Validation rules
| Rule |
|---|
| property is required |
spec.severity ¶
string required
Severity is an implementation-defined classification such as "sev1" or "page".
Validation rules
| Rule |
|---|
| property is required |
spec.condition ¶
struct required
Condition defines the burn-rate comparison used to determine whether this alert condition is breaching.
AlertConditionType defines a comparison against an SLO's burn rate. Burn rate is error-budget consumption relative to the rate allowed by the SLO.
Validation rules
| Rule |
|---|
| property is required |
spec.condition.kind ¶
string required
Kind selects the condition calculation. OpenSLO defaults Kind to AlertConditionKindBurnRate. This SDK does not apply that default.
AlertConditionKind identifies the calculation used by an AlertConditionType.
Allowed values: burnrate
Validation rules
| Rule |
|---|
| property is required |
| must be one of: burnrate |
spec.condition.op ¶
string conditionally required
Operator compares the calculated burn rate with Threshold.
Operator identifies a comparison applied to a metric value.
Possible values: gt, lt, gte, lte
The applicable values depend on the conditions in the validation rules below.
Validation rules
| Rule | Applies when |
|---|---|
| property is required | kind is burnrate |
| must be one of: gt, lt, gte, lte | kind is burnrate |
spec.condition.threshold ¶
float64 conditionally required
Threshold sets the numeric burn-rate boundary.
Validation rules
| Rule | Applies when |
|---|---|
| property is required | kind is burnrate |
spec.condition.lookbackWindow ¶
string conditionally required
LookbackWindow sets the period for burn-rate calculation.
DurationShorthand represents a duration as an integer and a case-sensitive DurationShorthandUnit, such as "1m" or "10d". A zero value encodes as empty text.
Validation rules
| Rule | Applies when |
|---|---|
| property is required | kind is burnrate |
Validation of value components
These rules apply to parts of this value.
Component: unit
Possible values: m, h, d, w, M, Q, Y
| Rule | Applies when |
|---|---|
| property is required | kind is burnrate |
| must be one of: m, h, d, w, M, Q, Y | kind is burnrate |
Component: value
| Rule | Applies when |
|---|---|
must be greater than or equal to 0 |
kind is burnrate |
spec.condition.alertAfter ¶
string
AlertAfter sets how long the burn-rate comparison must remain true before the condition becomes breaching. An AlertPolicy controls whether that state triggers an alert. OpenSLO treats an omitted value as "0m". This SDK leaves it unset.
DurationShorthand represents a duration as an integer and a case-sensitive DurationShorthandUnit, such as "1m" or "10d". A zero value encodes as empty text.
Validation rules
| Rule | Applies when |
|---|---|
| property is optional | kind is burnrate |
Validation of value components
These rules apply to parts of this value.
Component: unit
Possible values: m, h, d, w, M, Q, Y
| Rule | Applies when |
|---|---|
| property is required | kind is burnrate |
| must be one of: m, h, d, w, M, Q, Y | kind is burnrate |
Component: value
| Rule | Applies when |
|---|---|
must be greater than or equal to 0 |
kind is burnrate |
spec.description ¶
string
Description summarizes the alert condition.
Validation rules
| Rule |
|---|
| property is optional |
| length must be less than or equal to 1050 |