Skip to content

AlertPolicy (v1)

AlertPolicy defines which alert-condition states trigger an SLO alert. It also defines where the consuming system delivers the resulting notifications. It is distinct from an organization's policy for responding to error-budget consumption.

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: AlertPolicy

Validation rules

Rule
property is required
must be equal to AlertPolicy

metadata

struct required reference

See the metadata definition in the overview.

Validation rules

Rule
property is required

spec

struct

AlertPolicySpec defines which condition states trigger an SLO alert and where the consuming system delivers the resulting notifications. The trigger fields have a false zero value. JSON encoding omits false values.

spec.description

string

Description summarizes the alert policy.

Validation rules

Rule
property is optional
length must be less than or equal to 1050

spec.alertWhenNoData

bool

AlertWhenNoData reports whether to trigger an alert when the associated SLO has no burn-rate value.

spec.alertWhenBreaching

bool

AlertWhenBreaching reports whether to trigger an alert when the condition is breaching.

spec.alertWhenResolved

bool

AlertWhenResolved reports whether to trigger an alert when the condition resolves.

spec.conditions

[]struct

Conditions contains alert conditions specified inline or by reference.

Validation rules

Rule
length must be between 1 and 1

spec.conditions[*]

struct

AlertPolicyCondition supplies an inline or referenced alert condition to an AlertPolicySpec.

Validation rules

Rule
exactly one of conditionRef and spec must be set
property is optional

spec.conditions[*].conditionRef

string required

ConditionRef matches the Metadata.Name of an existing AlertCondition.

Validation rules

Rule Details Examples
property is required
length must be between 1 and 63
string must match regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ an RFC-1123 compliant label name must consist of lower case alphanumeric characters or -, and must start and end with an alphanumeric character my-name
123-abc

spec.conditions[*].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

spec.conditions[*].metadata

struct required reference

See the metadata definition in the overview.

Validation rules

Rule
property is required

spec.conditions[*].spec

struct required reference

See the AlertCondition specification.

Validation rules

Rule
property is required

spec.notificationTargets

[]struct

NotificationTargets contains notification destinations. Specify each destination inline or by reference.

Validation rules

Rule
length must be greater than or equal to 1

spec.notificationTargets[*]

struct

AlertPolicyNotificationTarget supplies an inline or referenced notification target to an AlertPolicySpec.

Validation rules

Rule
exactly one of targetRef and spec must be set
property is optional

spec.notificationTargets[*].targetRef

string required

TargetRef matches the Metadata.Name of an existing AlertNotificationTarget.

Validation rules

Rule Details Examples
property is required
length must be between 1 and 63
string must match regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ an RFC-1123 compliant label name must consist of lower case alphanumeric characters or -, and must start and end with an alphanumeric character my-name
123-abc

spec.notificationTargets[*].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: AlertNotificationTarget

Validation rules

Rule
property is required
must be equal to AlertNotificationTarget

spec.notificationTargets[*].metadata

struct required reference

See the metadata definition in the overview.

Validation rules

Rule
property is required

spec.notificationTargets[*].spec

struct required reference

See the AlertNotificationTarget specification.

Validation rules

Rule
property is required