Labels in Nobl9
Labels are key-value pairs that can be attached to SLOs, services, projects, and alert policies in the Nobl9 platform. Labels allow you to define attributes of resources and use them to filter and group SLOs across services and projects in the SLO Grid view, Service Health dashboard, 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 or a project in the SLO wizard and to alerts in the alert policy wizard. You can select existing pre-defined labels or add new ones that are specific to your organization.
Requirements for labels
Labels have a specific format and must conform to the following rules:
Labels must be in the
key: valueformat (
keycan contain only lowercase letters, digits
_, and hyphens
-. Start with a letter. End with a letter or digit. The maximum length is 63 characters
valuecan contain Unicode characters. The maximum length is 200 characters
Labels can contain international (diacritic) characters.
Labels can contain digits (
0-9), underscores (
_) and hyphens (
-) between the letters.
There can be a maximum of 20 Labels assigned to a resource.
Most common label examples
The following are the examples for the most common labels in the Nobl9 platform:
Alert policy labels:
unit: error per s.
Environment (organization) labels:
Labels for displaying units on SLI graphs
Labels for units have the same specific format.
To display a unit on the SLI graph in the SLO details tab:
Create or edit an SLO > SLO wizard Step 5: select or add unit labels:
- Enter the unit
valuepair. For example,
- Enter the unit
Save the changes. To view the unit you've added, go to SLO Details > SLI graph. Find the unit above the Y-axis:
You can create labels while adding them to Nobl9 resources: SLOs, services, projects, and alert policies within their wizards. To open the wizard, do the following:
In the Nobl9 UI, go to the required resource list.
- Create a new resource: click at the top of the list
- Edit an existing resource: click in the required resource
Create a label:
- Enter the required (new)
- Click .
- Enter the required
- Enter the required (new)
Add an existing label:
- Select the required label in the list.
Remove a label from a resource:
Click in the required label: .note
You detach the entire
Label detachment doesn't delete the label but unlinks it from the resource only. The label remains available for reuse with any other resource.
Labels detached from all resources appear in the Catalog > Labels list as Unassigned to any resource.
|Resource||Create or add a label|
|SLO||SLO wizard > Step 5: Add Name, Alert Policy and Labels > the Labels field|
|Project||Project wizard > the Labels field|
|Service||Service wizard > the Labels field|
|Alert policy||Alert policy wizard > Step 2: Add Alert Policy Name, Severity and Labels the Labels field|
You can access all labels available for your organization under Catalog > Labels:
The list of labels features the following options:
key-valuepairs along with the resources labeled with them
- Search labels by
- Sort labels by
- Edit labels
Labels with duplicate
key-valuepairs upon editing are merged
- Delete individual labels
Only Organization Admins can edit and delete labels.
Once you delete a label in the Catalog > Labels list, this key-value pair is no more available.
Filtering by labels - overview
Nobl9 allows you to filter by multiple labels:
Enter/select multiple labels with the same key to filter resources containing one of the labels with the matching key.
Enter/select multiple labels with different keys to filter resources containing all the labels with different keys.
|SLO||Label 1||Label 2|
|SLO A has the labels|
|SLO B has the labels|
|SLO C has the labels|
|SLO D has the labels|
User filters by:
Applying filters displays:
For more information, refer to the SLO search and filter logic document.
Retrieving labeled resources in
Retrieving SLO, Service, or a Project 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
-lwith spaces in between, for example:
sloctl get slo -A -l team=green -l team=orange -l key=value
Assumptions for Label Commands in
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
sloctlretrieves all resources that have
team=redattached 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
sloctlretrieves all resources that have both
geo=eulabels attached to them.