Skip to content

SLO (v1alpha)

SLO is the legacy v1alpha SLO representation supported by this SDK. It defines reliability targets for a service level measured by an indicator.

Properties

apiVersion

string required

Version represents a version of the OpenSLO specification.

Allowed values: openslo/v1alpha

Validation rules

Rule
property is required
must be equal to openslo/v1alpha

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

Validation rules

Rule
property is required
must be equal to SLO

metadata

struct required reference

See the metadata definition in the overview.

Validation rules

Rule
property is required

spec

struct required

SLOSpec defines the service, indicator, objectives, time window, and error-budget calculation for an SLO.

Validation rules

Rule
property is required
exactly one of indicator and objectives[*].ratioMetrics must be set

spec.timeWindows

[]struct

TimeWindows defines the period over which the SLO is evaluated.

Validation rules

Rule
length must be between 1 and 1

spec.timeWindows[*]

struct

SLOTimeWindow defines the period over which an SLO is evaluated. For example, a Unit of Week and a Count of 4 define a four-week window.

Validation rules

Rule
calendar must be set when isRolling is false and cannot be set when isRolling is true

spec.timeWindows[*].unit

string required

Unit combines with Count to set the window length.

SLOTimeWindowUnit identifies the unit used to express an SLOTimeWindow.

Allowed values: Second, Day, Week, Month, Quarter

Validation rules

Rule
property is required
must be one of: Second, Day, Week, Month, Quarter

spec.timeWindows[*].count

int

Count sets how many Units form the window.

Validation rules

Rule
must be greater than 0

spec.timeWindows[*].isRolling

bool

IsRolling selects a continuously advancing window when true and a calendar-aligned window when false.

spec.timeWindows[*].calendar

struct

Calendar defines the alignment of a calendar window.

SLOCalendar anchors a calendar-aligned SLOTimeWindow.

Validation rules

Rule
property is optional

spec.timeWindows[*].calendar.startTime

string

StartTime anchors the first calendar window.

Validation rules

Rule Details
string must be a valid date and time in 2006-01-02 15:04:05 format date and time format follows Go's time layout, see https://pkg.go.dev/time#Layout for more details

spec.timeWindows[*].calendar.timeZone

string

TimeZone controls the interpretation of StartTime and later boundaries.

Validation rules

Rule Examples
string must be a valid IANA Time Zone Database code UTC
America/New_York
Europe/Warsaw

spec.budgetingMethod

string required

BudgetingMethod applies the selected error-budget calculation to every objective.

SLOBudgetingMethod identifies how an SLO calculates its error budget. Occurrences weights each event equally. Timeslices weights each time slice equally.

Allowed values: Occurrences, Timeslices

Validation rules

Rule
property is required
must be one of: Occurrences, Timeslices

spec.description

string

Description summarizes the SLO.

Validation rules

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

spec.indicator

struct

Indicator defines the threshold-metric form of the SLO.

SLOIndicator defines the threshold-metric form of a v1alpha service level indicator.

Validation rules

Rule
property is optional

spec.indicator.thresholdMetric

struct required

ThresholdMetric retrieves raw metric values. Each objective compares them with its Operator and Value.

SLOMetricSourceSpec describes a provider-specific metric query.

Validation rules

Rule
property is required

spec.indicator.thresholdMetric.source

string required

Source identifies the metric data source.

Validation rules

Rule
property is required
string must match regular expression: ^[a-zA-Z]*$

spec.indicator.thresholdMetric.queryType

string required

QueryType identifies the query language or query form.

Validation rules

Rule
property is required
string must match regular expression: ^[a-zA-Z]*$

spec.indicator.thresholdMetric.query

string required

Query is the provider-specific expression that retrieves the metric.

Validation rules

Rule
property is required
string must not be empty

spec.service

string required

Service is the metadata name of the Service whose reliability the SLO measures.

Validation rules

Rule
property is required

spec.objectives

[]struct

Objectives contains reliability targets. For the ratio form, each objective's SLOObjective.RatioMetrics defines the SLI metric queries.

spec.objectives[*]

struct

SLOObjective defines a reliability target and, for the ratio form, its metric queries.

spec.objectives[*].displayName

string

DisplayName is a human-readable objective name.

Validation rules

Rule
length must be less than or equal to 1050

spec.objectives[*].value

float64 conditionally required

Value is the metric threshold used by Operator.

Validation rules

Rule Applies when
property is required ratioMetrics is not set

spec.objectives[*].ratioMetrics

struct

RatioMetrics supplies a good-events-to-total-events indicator.

SLORatioMetrics defines an indicator as the ratio of good events to total events. For example, 99 successful requests out of 100 total requests produce a ratio of 0.99.

Validation rules

Rule
property is optional

spec.objectives[*].ratioMetrics.good

struct required

Good retrieves the numerator: events considered successful.

SLOMetricSourceSpec describes a provider-specific metric query.

Validation rules

Rule
property is required

spec.objectives[*].ratioMetrics.good.source

string required

Source identifies the metric data source.

Validation rules

Rule
property is required
string must match regular expression: ^[a-zA-Z]*$

spec.objectives[*].ratioMetrics.good.queryType

string required

QueryType identifies the query language or query form.

Validation rules

Rule
property is required
string must match regular expression: ^[a-zA-Z]*$

spec.objectives[*].ratioMetrics.good.query

string required

Query is the provider-specific expression that retrieves the metric.

Validation rules

Rule
property is required
string must not be empty

spec.objectives[*].ratioMetrics.total

struct required

Total retrieves the denominator: all considered events.

SLOMetricSourceSpec describes a provider-specific metric query.

Validation rules

Rule
property is required

spec.objectives[*].ratioMetrics.total.source

string required

Source identifies the metric data source.

Validation rules

Rule
property is required
string must match regular expression: ^[a-zA-Z]*$

spec.objectives[*].ratioMetrics.total.queryType

string required

QueryType identifies the query language or query form.

Validation rules

Rule
property is required
string must match regular expression: ^[a-zA-Z]*$

spec.objectives[*].ratioMetrics.total.query

string required

Query is the provider-specific expression that retrieves the metric.

Validation rules

Rule
property is required
string must not be empty

spec.objectives[*].ratioMetrics.incremental

bool

Incremental reports whether the queried metrics are monotonically increasing counters rather than values that can rise or fall.

spec.objectives[*].target

float64 required

BudgetTarget is the desired fraction of good events or time slices.

Validation rules

Rule
property is required
must be greater than or equal to 0
must be less than 1

spec.objectives[*].timeSliceTarget

float64 conditionally required

TimeSliceTarget is the minimum success ratio that makes a time slice good. It is used by the Timeslices budgeting method.

Validation rules

Rule Applies when
property is required budgetingMethod is Timeslices
must be greater than or equal to 0 budgetingMethod is Timeslices
must be less than or equal to 1 budgetingMethod is Timeslices

spec.objectives[*].op

string conditionally required

Operator compares values returned by the threshold metric with Value.

Operator selects the comparison between a threshold metric and an objective 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 ratioMetrics is not set
must be one of: gt, lt, gte, lte ratioMetrics is not set
property is forbidden ratioMetrics is set