Skip to main content

Labels in Nobl9

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

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: value format (key=value in sloctl).

    • key can contain only lowercase alphanumeric characters, underscores, and dashes; must start with a letter and end with an alphanumeric character; maximum length 63 characters

    • value can contain Unicode characters; maximum length 200 characters

  • Labels can contain international (diacritic) characters.

  • Labels can contain underscores (_) and dashes (-) between the alphanumeric characters.

  • There can be max. 20 Labels assigned to a resource.

note

You cannot edit the label that was already created. To change the label, remove the existing one and create a new label by following the steps described in the Adding Labels section.

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.

Labels for Displaying Units on SLI graphs

Labels for units have the same specific format and must conform to the rules specified in the Requirements for Labels section.

To display a unit on the SLI graph in the SLO Details tab:

  • During SLO creation or editing process, in step 5 of the SLO Wizard, select or add unit labels:

    • enter the unit key and a value for it, for example, unit: ms.
    Image 1: Labels in step 5 of the SLO Wizard

After saving the changes, the unit is successfully displayed above the Y-axis, on the SLI graph, in the SLO Details tab:

Image 2: Example of unit label in the SLO Details tab

Adding Labels

Adding Label(s) to SLO

To add Labels to new SLO, follow these steps:

  1. Go to Service Level Objectives in the main navigation panel.

  2. Click the plus button button.

  3. In the SLO wizard > Add Name, Alert Policy and Labels, in the Labels field:

    • Select a Label from the dropdown menu, or

    • Create a new Label by entering its name and clicking on the plus button button.

  4. Click the Create SLO button.

Adding Label(s) to Service

To add Labels while creating a Service, follow these steps:

  1. Go to Catalog > Services.

  2. Click the plus button button.

  3. In the Labels field:

    • Select a Label from the dropdown menu, or

    • Create a new Label by entering its name and clicking on the plus button button.

  4. Click the Add Service button.

Adding Label(s) to Project

To add Labels while creating a Project, follow these steps:

  1. Go to Catalog > Services.

  2. Click the plus button button.

  3. In the Labels field:

    • Select a Label from the dropdown menu, or

    • Create a new Label by entering its name and clicking on the plus button button.

  4. Click the Create Project button.

Adding Label(s) to Alert Policy

To add Labels while creating an Alert Policy, follow these steps:

  1. Go to Alerts tab.

  2. In the Alert Policy Wizard > Add Alert Policy Name, Severity, and Labels, in the Labels field:

    • Select a Label from the dropdown menu, or

    • Create a new Label by entering its name and clicking on the plus button button.

  3. Click the Create Alert Policy button.

Removing Label(s)

To remove Labels, follow these steps:

  1. Go to the SLO, Services, Projects, or Alert Policies list in the Nobl9 UI.

  2. Choose a relevant resource from the list.

  3. In the Labels field, click the close button icon next to the Label that you wish to remove:

label icon

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:

SLOLabel 1Label 2
SLO A has the labelsgeo: euteam: green
SLO B has the labelsgeo: apacteam: green
SLO C has the labelsgeo: euteam: red
SLO D has the labelsgeo: apacteam: red
  • User filters by:

    geo: eu geo: apac team: green

  • Applying filters displays:

    SLO A SLO B

For more information, refer to the SLO Search and Filter Logic document.

Retrieving Labelled Resources in sloctl

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 -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 have team=green or team=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 both team=green and geo=eu labels attached to them.

SLO Search and Filter Logic | Nobl9 Documentation