Skip to main content

Using with sloctl

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

This article describes managing SLO annotations using sloctl.

Annotations API

You can also manage SLO annotations using Nobl9 API.

The following sloctl commands are available for handling SLO annotations:

CommandDescription
sloctl apply -fApply an annotation in the YAML or JSON format
sloctl get annotationsDisplay the list of all project annotations. You can change the project by using the -p {projectName} parameter
sloctl get annotations {annotationName}Display a single annotation
sloctl delete annotation {annotationName}
sloctl delete -f {yamlFile}
Delete a single annotation
sloctl response

sloctl does not return system annotations. When applying the sloctl get annotation[s] command, sloctl will return only annotations created by the user.

Applying annotations

You can add or update annotations using the sloctl apply -f {yamlFile} command.

Sample annotation YAML
apiVersion: n9/v1alpha
kind: Annotation
metadata:
name: scheduled-maintenance
project: customer-facing-applications
spec:
slo: user-request-error-rate
description: Scheduled service upgrade Feb 21, 10:00-12:00 UTC. Reduced performance is expected.
objectiveName: acceptable
startTime: 2025-02-21T10:00:05Z
endTime: 2025-02-21T12:00:05Z

Notes on fields specific to Annotations:

FieldTypeDescription
metadata.name
mandatory
stringA unique annotation name, required for distinguishing annotations within a project.
spec.slo
mandatory
stringThe name of the SLO the annotation applies to.
spec.description
mandatory
stringA string (plain text) describing the annotation. The maximum number of characters is 1000.
spec.startTime
mandatory
stringDefines the date-time point where the annotation will be placed in the graph. The value must be in the YYYY-MM-DDTh:mm:ssZ format that complies with ISO8601. If startTime == endTime, the annotation will be placed at a single time point.
spec.endTime
mandatory
stringDefines the date-time point where the annotation will be placed in the graph. The value must be in the YYYY-MM-DDTh:mm:ssZ format that complies with ISO8601. If startTime == endTime, the annotation will be placed at a single time point.
spec.objectiveName
optional
stringOptional field allowing you to add an annotation to a particular, already existing SLO objective. If not specified, the annotation is attached to the SLO.
Time format

By default, sloctl always returns time in UTC. You can adjust this for your time zone by replacing the Z (for Zulu; a shorthand for UTC) with the offset from UTC, prefaced with either + or -. For instance, to have sloctl return times adjusted for Eastern Standard Time, use startTime: 2021-11-02T17:10:05-05:00.