Creating a composite
Reading time: 0 minute(s) (0 words)
This article provides prerequisites and steps to create a composite.
Currently, you can create a composite using sloctl
and Terraform.
sloctl
versionFor full functionality,
use sloctl
version v0.3.0
or later.
Access requirements
To create a composite, the following permissions are required (fields with asterisks are mandatory):
Resource | Permission |
---|---|
Project* | The Create projects permission |
SLO (component)* | The View permission to necessary components |
Composite* | The Create/Edit permission to SLOs in the required project |
Alert policy | The Edit and apply permission to the required alert policies |
Alert method | The Apply permission to the necessary alert methods |
sloctl
- Create a YAML file following the provided template:
- General YAML
- Working sample
- apiVersion: n9/v1alpha
kind: SLO
metadata:
name: string # Mandatory
displayName: string # Optional
project: string # Mandatory
spec:
description: string # Optional
alertPolicies: array of alert policy names # Optional
labels: # A map of labels you want to attach to the composite
"key_1": # Label's key
- "value_1" # Label's value
- "value_2" # Label's value
"key_2": # Label's key
- "value_1" # Label's value
- "value_2" # Label's value
attachments: # Optional, links you need to attach to your composite
- displayName: string # Optional
url: url # Mandatory when using attachments
budgetingMethod: Occurrences | Timeslices # Mandatory
objectives:
- displayName: string # Optional
name: string # Mandatory
target: number # Mandatory
composite:
maxDelay: 1m-1h # Mandatory
components:
objectives:
- project: string # Mandatory
slo: string # Mandatory
objective: string # Mandatory
weight: float64 # Mandatory
whenDelayed: CountAsGood | CountAsBad | Ignore # Mandatory
service: string # Mandatory
timeWindows:
- unit: enum # Mandatory, Day | Week | Month | Quarter | Year for calendar-aligned; Minute | Hour | Day for rolling
count: number # Mandatory
isRolling: boolean # Mandatory, true for the rolling time window, false for calendar-aligned
calendar:
startTime: a timestamp in the 24h format without the time zone # Mandatory for calendar-aligned time windows
timeZone: string # Mandatory for calendar-aligned time windows
- apiVersion: n9/v1alpha
kind: SLO
metadata:
name: my-composite
displayName: My composite
project: my-project
labels:
key:
- my-label
value:
- value-1
- value-2
spec:
description: My composite SLO
alertPolicies:
- my-alert-policy-1
- my-alert-policy-2
attachments:
- displayName: My attachment
url: https://my-url.com
budgetingMethod: Occurrences
objectives:
- displayName: My composite objective
name: my-composite-objective
target: 0.7
composite:
maxDelay: 15m
components:
objectives:
- project: project-1
slo: my-slo-1
objective: my-objective-1
displayName: My objective 1
weight: 1
whenDelayed: CountAsGood
- project: project-2
slo: my-slo-2
objective: my-objective-2
displayName: My objective 2
weight: 3
whenDelayed: CountAsBad
- project: my-project-3
slo: my-slo-3
objective: my-objective-3
displayName: My objective 3
weight: 2.5
whenDelayed: Ignore
service: my-service
timeWindows:
- unit: Day
count: 1
isRolling: false
calendar:
startTime: 2020-04-20 10:40:00
timeZone: Europe/Warsaw
Read the field reference for more information.
- Run
sloctl apply -f %path-to-your-YAML%
As a result, your composite appears in the grid under the Service Level Objectives Nobl9 Web section.
objective limit
You can add up to 20 objectives per single composite SLO