Skip to main content

sloctl replay

Reading time: 0 minute(s) (0 words)

You can replay SLOs using sloctl commands. With sloctl, you can replay SLOs in bulk and remove queued Replays from the queue.

๐Ÿงชsloctl version requirements

We recommend updating sloctl to these versions or higher for the following functionality:

sloctl replay commandsโ€‹

The available sloctl replay commands are as follows:

Object nameDescription
listReturns the list of ongoing and queued Replays in an organization
deleteTerminates an ongoing Replay

sloctl replay flagsโ€‹

The following flags are available for the sloctl replay command:

ShortLongDescription
-f--file stringProvide a file path, glob pattern, or a URL to the configuration in the YAML or JSON format. This option can be used multiple times
N/A--from dateDefine a time point from which your historical data will be fetched until now. The value must be in the YYYY-MM-DDTh:mm:ssZ format compliant with the RFC339 date and time format
-p--project stringDefine a name identifier of your required project
-h--helpGet help

sloctl replay usageโ€‹

path to your target directory

sloctl executes commands in the %UserProfile%\.config\nobl9\ directory on Windows and ~/.config/nobl9/ on other operating systems.

Provide the path to your SLO definition when it's located in a different directory.

To replay an SLO, run:

sloctl replay -p [project-name] --from=[YYYY-MM-DDTh:mm:ssZ] [slo-name]

Provide the following:

ParameterDescription
[project-name]The name identifier of your required SLO's parent project
[YYYY-MM-DDTh:mm:ssZ]The start time of the required period for historical data retrieval in the RFC 3339 format
[slo-name]The name identifier of your required SLO

You can replay SLOs providing YAML definitions. For this, run one of the following commands:

CommandDescription
sloctl replay -f [my-slo.yaml]Replay an SLO providing its YAML definition
sloctl replay <./[my-slo.yaml]Replay an SLO using its definition YAML from stdin

To replay several SLOs in bulk, add as many SLOs to the YAML definition as you need.

For bulk operations, the first two Replays start immediately (if all Replay slots are free). For further Replays, sloctl reports if they are queued successfully. Failures can occur because of the following:

ReasonTroubleshooting
A given SLO is currently being replayed or queuedWait until Replay is complete, or
remove Replay from the queue
Not enough permissions to replay SLOsTo replay SLOs, you role must be Project owner, Project editor, or Organization admin
No access to parent projects of the involved SLOsAsk the required project owner for access
Replay period for an SLO exceeds the maxDuration period set for the connected data sourceNarrow down Replay period.
Find maximum period for historical data retrieval allowed by your data source

sloctl replay listโ€‹

To list Replays, run:

sloctl replay list

sloctl returns the list of all ongoing and queued Replays in your organization.

FieldDescriptionRequires access to SLO's parent project?
sloThe name identifier of an SLO being replayedYes
projectThe name identifier of the replayed SLO's parent projectNo
elapsedTimeHow long Replay is runningYes
retrievedScopeThe replayed timeframeYes
retrievedFromThe timeframe start timeYes
statusReplay status: in progress, queuedNo

When no Replays are queued or in progress at the moment when you run sloctl replay list, the command returns Replay not found.

sloctl replay deleteโ€‹

You can also clear the queue in your organization. For this, remove Replays one by one.

When you remove a Replay from the queue, Replay proceeds with the next SLO in the queue.

To remove a Replay from the queue, run one of the following commands:

CommandDescription
sloctl replay delete [slo-name] -p [project_name]Removes an individual Replay from the queue
sloctl replay delete -allRemoves all Replays from the queue

sloctl apply with --replayโ€‹

You can apply SLOs and replay them immediately. For this, apply the required SLO YAML definitions followed by --replay:

sloctl apply -f [my-slo.yaml] --replay --from=[time]
ParameterDescription
[project-name]The name identifier of your required SLO's parent project
[YYYY-MM-DDTh:mm:ssZ]The start time of the required period for historical data retrieval in the RFC 3339 format
[slo-name]The name identifier of your required SLO

This way, you apply the YAML and replay your SLO manually.

Key takeawaysโ€‹

Replaying SLOs is a permanent action

Replaying SLOs is a permanent action and cannot be rolled back.

Learn more about Replay impact on connected resources.

  • Replay can fail in the following cases:
    • Your data source is unsupported
    • The maximum period for historical data retrieval for your data source is set to 0
    • A given SLO is currently being replayed
    • Replay for a given SLO is queued
  • When your SLO has alert policies attached, alerting is suspended for the entire Replay duration. It resumes once the Replay process is complete.
  • If the project is not set, it is inferred from Nobl9 config.toml for the current context.
  • If from is not provided in the config file, you must specify it with --from=[time] flag.
  • Setting the --project or --from=[] flags don't override the configuration values.

Minimum configuration with parameters can be set globally with flags:

cat <<EOF | sloctl replay -p my-project --from 2024-10-20T15:00:00Z
- slo: my-slo
- slo: my-another-slo
EOF
For a more in-depth look, consult additional resources: