Using with sloctl
This article describes managing SLO annotations using sloctl
.
You can also manage SLO annotations using Nobl9 API.
The following sloctl
commands are available for handling SLO annotations:
Command | Description |
---|---|
sloctl apply -f | Apply an annotation in the YAML or JSON format |
sloctl get annotations | Display 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
responsesloctl
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.
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
:
Field | Type | Description |
---|---|---|
metadata.name mandatory | string | A unique annotation name, required for distinguishing annotations within a project. |
spec.slo mandatory | string | The name of the SLO the annotation applies to. |
spec.description mandatory | string | A string (plain text) describing the annotation. The maximum number of characters is 1000. |
spec.startTime mandatory | string | Defines 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 | string | Defines 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 | string | Optional field allowing you to add an annotation to a particular, already existing SLO objective. If not specified, the annotation is attached to the SLO. |
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
.