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.

metadata annotations

You can also use Nobl9 metadata annotations to attach custom non-identifying metadata to SLOs, Services, Projects, and Alert Policies through sloctl and Nobl9 SDK for Go!

Check the section below to learn more.

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 letters, digits 0-9, underscores _, and hyphens -. Start with a letter. End with a letter or digit. The maximum length is 63 characters

    • value can 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:

  • 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 (organization) labels: env: test, env: prod, env: staging.

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 key-value pair. For example, unit: ms.
    Image 1: Labels in step 5 of the SLO wizard

Save the changes. To view the unit you've added, go to SLO Details > SLI graph. Find the unit above the Y-axis:

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

Label management

You can create labels while adding them to Nobl9 resources: SLOs, services, projects, and alert policies within their wizards. To create a label, go to the required resource wizard:

  1. In the Nobl9 UI, go to the required resource list.
    • Create a new resource: click plus button at the top of the list
    • Edit an existing resource: click pencil icon in the required resource
  2. Create a label:
    1. Enter the required (new) key.
    2. Click plus button.
    3. Enter the required value.

Here, you can also add existing labels to the resource, edit labels, and remove them.

Label removal

When removing a label in the resource wizard, you only detach the entire key-value pair.
Label detachment doesn't delete the label but unlinks it from the resource. 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.

ResourceCreate or add a label
SLOSLO wizard > Step 5: Add Name, Alert Policy and Labels > the Labels field
ProjectProject wizard > the Labels field
ServiceService wizard > the Labels field
Alert policyAlert policy wizard > Step 2: Add Alert Policy Name, Severity and Labels the Labels field

Label list

You can access all labels available for your organization under Catalog > Labels:

Image 3: Catalog > Labels

The list of labels features the following options:

  • View key-value pairs and resources per every label
  • Search labels by key and value
  • Sort labels by key and usage
  • Edit individual labels
    When, upon editing, two or more labels have identical key-value pairs, such labels are merged into one
  • Delete individual labels
  • Open the selected label details
Label modification

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.

Label details

Under the label details, you can view resources that are labeled with it and manage the relation between labels and associated resources.

Resource visibility

The resource tabs display only those resources you have access to.
So, when you see fewer resources under label details, than are displayed for this label in the list or summary panel, this means you have no access to the missing resources.

Image 4: Label details

To remove the label from a resource under the label details, click remove label in the required resource's row.

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.

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 labeled 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.

Metadata annotations

There are two ways of attaching metadata to your SLOs, services, projects, and alert policies in Nobl9:

  • Using labels, or
  • Using metadata annotations

Differences between labels and metadata annotations

Labels vs metadata annotations:

  • Labels identify objects and locate groups of objects that meet specific criteria.
  • You can add labels using Nobl9 web, sloctl, Terraform onr Nobl9 SDK for Go!.
  • Metadata annotations don't serve the purpose of object identification or selection.
  • You can add or retrieve metadata annotations only via sloctl or Nobl9 SDK for Go!
tip

You can apply both labels and annotations in the metadata of a single Nobl9 object.

The following table summarizes differences between labels and metadata annotations:

CapabilityLabelsMetadata annotations
Object identificationIdentify Nobl9 objects based on specific criteria. Use for grouping and filtering.Do not identify Nobl9 objects. Use for descriptive purposes.
Adding | retrievingVia:
• Nobl9 web
sloctl
• Nobl9 Terraform provider
• Nobl9 SDK for Go!
Only via:
sloctl
• Nobl9 SDK for Go!
Field structure"key": - "list of values"key: value
Character limit for valueUp to 200 unicode characters.Up to 1050 unicode characters.
metadata.annotations and kind: Annotation

metadata.annotations differ from SLO annotations.

SLO annotations are defined as a separate YAML kind, associated with SLOs as event notes. They include defined start and end times and are visible on the Nobl9 Web.

For a more in-depth look, consult additional resources: