Skip to content

AlertPolicy (v2alpha)

AlertPolicy defines which alert-condition states trigger an SLO alert. It also defines the notification destinations for triggered alerts.

Properties

apiVersion

string required

Version represents a version of the OpenSLO specification.

Allowed values: openslo.com/v2alpha

Validation rules

Rule
property is required
must be equal to openslo.com/v2alpha

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 the trigger states, condition, and notification destinations for an AlertPolicy. The trigger flags are independent and have a false zero value. JSON encoding omits false values. This SDK applies no omission default.

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 controls whether a missing burn-rate value triggers an alert.

spec.alertWhenBreaching

bool

AlertWhenBreaching controls whether a breaching condition triggers an alert.

spec.alertWhenResolved

bool

AlertWhenResolved controls whether a resolved condition triggers an alert.

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

Validation rules

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

spec.conditions[*].conditionRef

string required

ConditionRef is the metadata name of the alert condition to use.

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 delivery 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 AlertPolicy.

Validation rules

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

spec.notificationTargets[*].targetRef

string required

TargetRef is the metadata name of the notification target to use.

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