sloctl replay
You can replay SLOs using sloctl
commands.
With sloctl
, you can replay SLOs in bulk and remove queued Replays from the queue.
We recommend updating sloctl
to these versions or higher for the following functionality:
- Version
0.6.0
: replaying SLOs from other SLOs (experimental) - Version
0.8.0
: Replay queue management
sloctl replay
commandsโ
The available sloctl replay
commands are as follows:
Object name | Description |
---|---|
list | Returns the list of ongoing and queued Replays in an organization |
delete | Terminates an ongoing Replay |
sloctl replay
flagsโ
The following flags are available for the sloctl replay
command:
Short | Long | Description |
---|---|---|
-f | --file string | Provide 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 date | Define 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 string | Define a name identifier of your required project |
-h | --help | Get help |
sloctl replay
usageโ
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:
Parameter | Description |
---|---|
[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:
Command | Description |
---|---|
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:
Reason | Troubleshooting |
---|---|
A given SLO is currently being replayed or queued | Wait until Replay is complete, or remove Replay from the queue |
Not enough permissions to replay SLOs | To replay SLOs, you role must be Project owner, Project editor, or Organization admin |
No access to parent projects of the involved SLOs | Ask the required project owner for access |
Replay period for an SLO exceeds the maxDuration period set for the connected data source | Narrow 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.
Field | Description | Requires access to SLO's parent project? |
---|---|---|
slo | The name identifier of an SLO being replayed | Yes |
project | The name identifier of the replayed SLO's parent project | No |
elapsedTime | How long Replay is running | Yes |
retrievedScope | The replayed timeframe | Yes |
retrievedFrom | The timeframe start time | Yes |
status | Replay status: in progress , queued | No |
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:
Command | Description |
---|---|
sloctl replay delete [slo-name] -p [project_name] | Removes an individual Replay from the queue |
sloctl replay delete -all | Removes 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]
Parameter | Description |
---|---|
[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 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