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] [flags] <objects>
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 | Applies 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 | Retrieves authentication identifiers for integration with AWS services. |
sloctl budgetadjustments events | Provides budget adjustment event handling options. |
sloctl completion | Generates autocompletion scripts for the specified shell. |
sloctl config | Provides context handling options. |
sloctl convert | Convert an OpenSLO specification to the Nobl9 definition. |
sloctl delete | Deletes resource definition. Supports glob patterns with the -f flag, including '**' for recursive file and directory reading. |
sloctl get | Displays information about objects managed by sloctl . |
sloctl help | Displays help information for commands. |
sloctl replay | Provides Replay options. |
sloctl version | Prints the current sloctl version. |
Configuration commandsβ
sloctl config
provides the context handling options.
Command | Description |
---|---|
add-context | Adds a new sloctl configuration context |
current-context | Displays current context. Use -v (--verbose ) for context details |
delete-context | Deletes chosen context |
get-contexts | Displays all available contexts. Use -v (--verbose ) for detailed information |
rename-context | Renames chosen context |
use-context | Sets the default context |
Flagsβ
Common flags pass data to a command or parameter:
Flag | Long form | Description |
---|---|---|
-h | --help | Get help. |
-o | --output string | Specify the output format: one of yaml|json|csv (default yaml). |
A broader set of flags is available for individual commands. For more details, refer to your required command.
Global flags define the scope of the current command, such as the project, context, or location of the configuration file:
Short | Long | Description |
---|---|---|
-A | --all-projects | Display the objects from all of the projects. |
--config string | 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). | |
-c | --context string | Override the default context for the duration of the command. |
--no-config-file | Don't create config.toml , operate only on env variables. | |
-p | --project string | Override the default project from the active context for the duration of the command. |
Common objectsβ
The following are the API objects that you can manipulate with sloctl
using the different commands.
Objects are passed as YAML definitions. For object YAML configuration, see the YAML guide.
sloctl object | Nobl9 Web term | Description |
---|---|---|
agents | Data sources added using the agent method | A YAML definition of a monitoring solution that your Nobl9 SLOs receive data from. kind: Agent |
alertmethods | Alert methods | A YAML definition of your tool for sending alert notifications. kind: AlertMethod |
alertpolicies | Alert policies | A set of conditions that trigger alerts and send notifications to your predefined alert methods. kind: AlertPolicy |
alertsilences | Rules to silence alerts | A scheduled period for muting alerts that would otherwise trigger when an alert policy's conditions are met. kind: AlertSilence |
alerts | Alert events | A YAML definition of an alert event triggered by an alert policy. Alerts are generated automatically based on the alert policy and its conditions and contain alert details. |
annotations 1 | System and user annotations | A note attached to SLO charts containing user-defined information or indicating an event that affected an SLO. kind: Annotation |
budgetadjustments | Budget adjustment definitions | A set of exceptions that prevent SLO error budget burn by planned or allowed activity. kind: BudgetAdjustment |
dataexports | Rules for data export | A YAML configuration for exporting data from Nobl9 to AWS S3 or GCP. kind: DataExport |
directs | Data sources added using the direct method | A YAML definition of a monitoring solution that your Nobl9 SLOs receive data from. kind: Direct |
projects | Projects | A project YAML definition. Projects are the primary logical grouping of resources in Nobl9. All Nobl9 resources, such as data sources, SLOs, and alerts, are created within a project. kind: Project |
rolebindings | Role bindings | A YAML definition for binding a user role in the project with users. kind: RoleBinding |
services | Services | A service YAML definition. A service can represent a logical service endpoint like an API, a database, an application, or anything else you need to monitor using SLOs. kind: Service |
slos | SLOs | A service level objective YAML definitionβa reflection of the desired performance of your system with the defined target, error budget calculation method, time window, and a query to retrieve data from your data source. kind: SLO |
1 sloctl
does not return system annotations. When applying the sloctl get annotation[s]
command, sloctl
will return only annotations created by the user.