Skip to main content

Replaying SLOs from other SLOs

πŸ§ͺExperimental feature

This is an experimental feature that's currently under development.

This feature allows you to replay an SLO by utilizing another SLO as the source of historical SLI data. The feature is only accessible through the sloctl using the replay command with a configuration file.

Prerequisites​

To use this feature, you must upgrade your sloctl to version 0.6.0 or higher.

Configuration​

The configuration file defines how replaying historical data from another SLO works. A new optional field, sourceSLO, allows Replay to use the selected SLO as the data source. If sourceSLO is omitted, Replay re-imports historical data from the original source.

Example YAML configuration for replaying historical data from another SLO:

Filename: replay-slo-from-slo.yaml
# Specifies the SLO to replay
- slo: target-slo-1
# The project where the target SLO is located
project: target-project-1
# The timestamp indicating when to begin the replay
from: 2023-02-02T15:02:05Z
# Defines the SLO to be used as the data source for the replay
sourceSLO:
slo: source-slo-1
project: source-project-1
# The objectivesMap field defines how objectives from the source SLO map to those of the target SLO
objectivesMap:
# A list of mappings, where each mapping defines a source objective from sourceSLO to a target objective in the target SLO
# All objectives in the target SLO must be mapped to a source objective
# The same source objective can be mapped to multiple target objectives
# Not all source objectives must be used
- source: objective-1
target: objective-1
- source: objective-2
target: objective-2
- source: objective-3
target: objective-3
# DISCLAIMER: The sourceSLO configurations do not affect the target SLO
# Only the SLI is copied, and no changes are made to the configuration of the target SLO

# Specifies the second SLO to replay
- slo: target-slo-2
project: target-project-2
from: 2023-02-02T15:02:05+02:00
sourceSLO:
slo: source-slo-2
project: source-project-2
objectivesMap:
- source: objective-1
target: objective-1

To execute the above file, use the following command in sloctl:

sloctl replay -f ./replay-slo-from-slo.yaml
mixed replay configuration

A single configuration file can contain settings for replaying from bothβ€”the original data source and another SLO.

Functional requirements​

  • If sourceSLO field is present, Replay will use the specified SLO's SLI data as the source. If sourceSLO is omitted, Replay uses the original data source of the target SLO.
  • sourceSLO and its objectives must exist before replaying.
  • Both slo and sourceSLO must use the same SLI type (either threshold or ratio). If ratio SLIs are used, both SLOs must have the same numerator type (either good or bad events).
  • Both the slo and sourceSLO must use the same subtype of ratio metric (either incremental or non-incremental) to avoid incorrect results or overwriting replayed SLOs with invalid data.
  • The slo and sourceSLO can belong to different projects and use different data sources, time windows, queries, budgeting methods, targets, and values.
  • It is allowed to replay an SLO using its own SLI data by setting the sourceSLO to the same SLO. In this case, Replay will not re-import data from the original data source.

Constraints​

  • When an SLO is being used as a sourceSLO, Replay can't be executed on that same SLO at the same time.
  • It's possible to modify or delete a sourceSLO even while it's in use. However, any changes made after Replay has started won't affect the ongoing Replay process.
  • RBAC: To initiate the Replay process, the user must have at least view permissions for the project that contains the sourceSLO.
  • Both the target SLO's data source and the sourceSLO's data source must support Replay. This feature can't be used to Replay SLOs whose data sources don't support Replay.
For a more in-depth look, consult additional resources: