sloctl user guide
Site reliability teams often deal with complex SLO tracking and management.
Nobl9's command-line interface, sloctl
, emerges as a streamlined solution,
offering a robust CLI tool
that transforms how you monitor and analyze service performance by complementing Nobl9's reliability monitoring toolset.
Use sloctl
to connect data sources, set up alerting on SLI data, create, update, and manage multiple SLOs and objectives at once as part of CI/CD.
While the Nobl9 web interface provides an easy way to create and update SLOs, sloctl
offers DevOps and SRE teams a systematic, code-driven approach to maintaining service reliability objectives with greater automation and precision.
Learn more ways of leveraging the SLOs as code approach.
SLO automation with sloctl
- CI/CD integration:
sloctl
integrates seamlessly with CI/CD pipelines. - Version control: you can keep definitions of SLOs and other resources in the version control system.
- Bulk operations:
sloctl
allows you to create or update multiple SLOs and other Nobl9 resources simultaneously. - Advanced configuration:
sloctl
provides access to advanced functionalities through YAML-based resource definitions, including (but not limited to):- Complex alert policies: with
sloctl
, you can define alert policies with any number and combination of alert conditions, exceeding the limitations of the Nobl9 Web (one condition of a type). - Credential retrieval: you can run the
sloctl get agents
command to retrieve credentials for agents within your organization at any time.
- Complex alert policies: with
Overview of commands, flags, and objects
This section summarizes common sloctl
root and config commands, objects, and flags.
Using them, you can automate SLO creation in CI/CD pipelines,
retrieve agent credentials, configure complex alert policies, and perform other reliability monitoring operations.
Basic syntax
sloctl [command]
Check your current context credentials if sloctl
returns the access token error:
Error: error getting new access token from the customer identity provider: cannot access the token, customer identity provider replied with 401 {"errorCode":"invalid_client","errorSummary":"Invalid value for 'client_id' parameter.","errorLink":"invalid_client","errorId":"oaejFe6MwoIRo200IuIj7Hp1g","errorCauses":[]}
Root commands
With sloctl
root commands, you can manage your Nobl9 resources, handle contexts, and retrieve reference details.
Command | Description |
---|---|
sloctl apply | Apply resource definitions in YAML or JSON format. Supports glob patterns with the -f flag, including '**' for recursive file and directory reading. |
sloctl aws-iam-ids | Retrieve authentication identifiers for integration with AWS services. |
sloctl budgetadjustments events | Handle budget adjustment events. |
sloctl completion | Generate autocompletion scripts for the specified shell. |
sloctl config | Handle contexts. |
sloctl convert | Convert an OpenSLO specification to the Nobl9 definition. |
sloctl delete | Delete resource definition. Supports glob patterns with the -f flag, including '**' for recursive file and directory reading. |
sloctl get | Display information about objects managed by sloctl . |
sloctl help | Display help information for commands. |
sloctl replay | Replay objects and manage Replays. |
sloctl version | Print the current sloctl version. |
Configuration subcommands
sloctl config
provides the context handling options.
Subcommand | Description |
---|---|
add-context | Add a new sloctl configuration context |
current-context | Display current context. Use -v (--verbose ) for context details |
delete-context | Delete chosen context |
get-contexts | Display all available contexts. Use -v (--verbose ) for detailed information |
rename-context | Rename the chosen context |
use-context | Set the default context |
Global flags
Global flags define the scope of the current command, such as the project, context, or location of the configuration file:
Flag | Shorthand | Description |
---|---|---|
--all-projects | -A | Display the objects from all of the projects. |
--config string | N/A | Specify the path to the config file (without this flag, sloctl checks in %UserProfile%\.config\nobl9\config.toml on Windows and ~/.config/nobl9/config.toml on other operating systems). |
--context string | -c | Override the default context for the duration of the command. |
--help | -h | Get help for a command. |
--no-config-file | N/A | Don't create config.toml , operate only on env variables. |
A broader set of flags is available for individual commands. For more details, refer to your required command.
Objects
The following API objects can be used as subcommands with the sloctl delete
and sloctl get
root commands.
Objects refer to Nobl9 resources and are specified by YAML definitions.
sloctl object | Nobl9 Web resource | YAML definition | Available for |
---|---|---|---|
agents | Data sources added using the agent method | kind: Agent | sloctl delete , sloctl get |
alertmethods | Alert methods | kind: AlertMethod | sloctl delete , sloctl get |
alertpolicies | Alert policies | kind: AlertPolicy | sloctl delete , sloctl get |
alertsilences | Rules to silence alerts | kind: AlertSilence | sloctl delete , sloctl get |
alerts | Alert events | kind: Alert | sloctl get |
annotations 1 | Annotations | kind: Annotation | sloctl delete , sloctl get |
budgetadjustments | Budget adjustment definitions | kind: BudgetAdjustment | sloctl delete , sloctl get |
dataexports | Data export configuration objects | kind: DataExport | sloctl delete , sloctl get |
directs | Data sources added using the direct method | kind: Direct | sloctl delete , sloctl get |
projects | Projects | kind: Project | sloctl delete , sloctl get |
reports | Reports | kind: Report | sloctl delete , sloctl get |
rolebindings | Role bindings | kind: RoleBinding | sloctl delete , sloctl get |
services | Services | kind: Service | sloctl delete , sloctl get |
slos | SLOs | kind: SLO | sloctl delete , sloctl get |
usergroups | User groups | kind: UserGroup | sloctl get |
1 sloctl
does not return system annotations. When applying the sloctl get annotation[s]
command, sloctl
will return only annotations created by the user.