Labels in Nobl9
This document presents an overview of labels in the Nobl9 platform and explains how to create and manage labels through the Nobl9 UI and sloctl
.
Labels are key-value pairs that can be attached to SLOs, Services, and Alert Policies in the Nobl9 platform. Labels allow users to define attributes of resources and use them to filter and group SLOs across Services in the SLO Grid view and Reports. Each label must be unique for a given SLO, but many SLOs can carry the same label.
Labels can be attached to SLOs when creating or editing a Service in the SLO Wizard and to Alerts in the Alert Policy wizard. Users can select existing pre-defined labels or add new ones that are specific to their organization.
Requirements for Labels​
Labels are plain text, but there are several requirements:
Labels must be in the
key: value
format (key=value
insloctl
).Each label can contain max. 63 characters.
Labels are strings:
Only lowercase characters are allowed.
All characters must use UTF-8 encoding.
International (diacritic) characters are allowed.
Each label must start with a letter.
Each label must end with an alphanumeric character.
Labels can contain underscores (
_
) and dashes (-
) between the alphanumeric characters.There can be max. 20 Labels assigned to a resource.
Most Common Use Cases of Labels​
The following are the most common use cases for labels in the Nobl9 platform:
Area labels:
area: latency
,area: slowcheck
.Geo labels:
geo: apac
,geo: amer
,geo: eu
.Team labels:
team: green
,team: sales
.Alert Policy Labels:
alert: low
,alert: medium
,alert: high
.SLO labels:
slo: ratio
,slo: calendar
.Unit labels:
unit: seconds
,unit: ms
,unit: error per s
.Environment labels:
env: test
,env: prod
,env: staging
.
Adding Labels​
Adding Labels to a New SLO​
Go to Service Level Objectives in the main navigation pane.
Click the
button.
In the SLO wizard > Add name, Alert policy and Labels click on Labels:
Select a label from the dropdown menu, or
Click the Save SLO button.
Adding Label(s) to an Existing SLO​
Go to Service Level Objectives in the main navigation pane.
On the relevant SLO, click the
icon to edit.
In the SLO wizard > Add name, Alert policy, and Labels click the ‘Labels’:
Select a Label from the dropdown menu, or
Create a new Label by entering its name and clicking on the
button.
Click the Create SLO button.
Adding Label(s) to an Existing Service​
Go to Catalog > Services.
Choose a relevant service from the Services list.
Click the
icon.
Click the ‘Labels’ field and:
Choose a label that will be attached to your Service or
Create a new Label by entering its name and clicking on the
button.
Click the Save Service button.
note
You can choose up to 20 labels that will be attached to your Service.
Adding Labels to an Alert Policy​
You can add labels to your Alert Policies:
Go to Alerts.
Click the
button.
In the Alert Policy wizard > Add Alert Policy name, Severity, and Labels click the ‘Labels’:
Select a Label from the dropdown menu, or
Create a new Label by entering its name and clicking on the
button.
Click the Create Alert Policy button.
tip
When you add a label to an Alert Policy, it will be sent along with the Alert notification.
Adding Label(s) to an Existing Alert Policy​
Navigate to Alerts in the main navigation pane.
Choose a relevant Alert Policy from the list.
Click the
icon.
In the Add Alert Policy name, Severity, and LabelsClick the ‘Labels’ field and:
Select a Label from the dropdown menu, or
Create a new Label by entering its name and clicking on the
button.
Click the Save Alert Policy button.
Removing Label(s) from a Service​
Go to Catalog > Services.
Choose a relevant service from the Services list.
In the ‘Labels’ column, click the
icon next to the Label that you wish to remove:
Filtering by Labels - Overview​
Nobl9 allows you to filter by multiple labels:
If you enter/select multiple labels with the same key - you will be able to see resources that contain one of the labels with the same key.
If you enter/select multiple labels with different keys - you will be able to see resources that contain all the labels with different keys.
For example:
SLO | Label 1 | Label 2 |
---|---|---|
SLO A has the labels | geo: eu | team: green |
SLO B has the labels | geo: apac | team: green |
SLO C has the labels | geo: eu | team: red |
SLO D has the labels | geo: apac | team: red |
User filters by:
geo: eu
geo: apac
team: green
Applying filters displays:
SLO A
SLO B
Filtering SLOs by Labels in the UI​
Labels allow you to easily filter through the SLOs. To filter your SLOs:
Go to Service Level Objectives in the main navigation pane.
Click the arrow button in the SLO search box on the left-hand side of the screen. Enter the relevant Project.
In the Labels field select the relevant labels that you want to filter through.
The results will be displayed on the grid view.
note
You can share the results of your filtering directly with anyone from your team by copying a deep link from your browser address bar.
tip
You can easily review the applied filters by hovering over the FILTER icon. To remove any of the filters, click the ‘x’ icon next to the relevant filter. Once you remove a filter, the change is applied in the link as well.
Filtering Reports by Labels in the UI​
Nobl9 allows you to filter your reports by labels. To do that:
Go to Reports in the main navigation pane.
Select the relevant report from the left menu.
Enter Project, Service, and Service Level Objective in the relevant fields.
Click the Labels field and choose a label that will be attached to your Service. You can search through your labels by typing their names.
Click the Apply button.
You will be able to see your filtered report result on the grid view.
tip
You can share the results of your report filtering directly with anyone from your team by copying the deep link from your browser address bar.
Retrieving Labelled Resources in sloctl
​
Retrieving SLO or Service config also returns all the labels that are set on the objects and allows filtering them.
There are two versions of syntax accepted by sloctl
while filtering by labels:
Labels can be separated by a comma without spaces, for example:
sloctl get slo -A -l key1=value1,key2=value2,key3=value3
Labels can be separated by a
-l
with spaces in between, for example:sloctl get slo -A -l team=green -l team=orange -l key=value
Assumptions for Label Commands in sloctl
:
If you retrieve resources for two or more labels that have the same
key
, they are connected by an OR logical operator, for example:sloctl get slo -A -l team=green -l team=red
sloctl
retrieves all resources that haveteam=green
orteam=red
attached to them.If you retrieve resources for two or more labels that have different
keys
, they are connected by an AND logical operator, for example:sloctl get slo -A -l team=green -l geo=eu
sloctl
retrieves all resources that have bothteam=green
andgeo=eu
labels attached to them.