Skip to main content

Labels in Nobl9

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

Labels are key-value pairs that you can add to SLOs, services, projects, alert policies, and annotations in the Nobl9 platform. With labels, you can define attributes for these resources and use labels for resource filtering and grouping. For example, labels allow you to:

Labels are attached to resources during resource creation or editing. You can select existing pre-defined labels or add new ones that are specific to your organization.

The Catalog section lists all labels existing in an organization.

metadata annotations

You can also use Nobl9 metadata annotations to add custom non-identifying metadata to SLOs, services, projects, and alert policies using sloctl and Nobl9 SDK for Go!.

Read about differences between labels and metadata annotations.

Requirements for labels

Labels have a specific format and must conform to the following rules:

  • Must follow 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
  • Can contain international (diacritic) characters
  • Can contain digits (0-9), underscores (_) and hyphens (-) between the letters
  • Maximum 20 labels per resource

Setting units for SLI charts

Labels for chart units must meet the common requirements.

You can add a unit label to be displayed on the SLI graph under SLO details at Step 5 of the SLO wizard as follows:

  1. Enter the unit key-value pair. For example, unit: ms.
Labels in step 5 of the SLO wizard
  1. Save your changes. To view the unit you've added, go to your SLO details. Find the unit above the Y-axis of the SLI chart:
Example of unit label in the SLO Details tab

Label management

You can create labels by adding them to SLOs, services, projects, alert policies, and annotations.

To create a label in the Nobl9 Web application, go to the required resource wizard:

  1. Go to the required section of the Nobl9 web application.
  2. Add a new resource or annotation or edit start editing an existing one.
  3. In the Labels field, enter a new key and value.
  4. Click plus button in the field to save your new label.

Alternatively, select the available key and value to label this resource or annotation.

To unlink unnecessary labels from resources or annotations in the Nobl9 web app, do one of the following:

  • Start editing your required resource or annotation.
  • Go to Catalog > Labels. Unlink the label from any resource under your required label details.

Label list

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

Catalog > Labels

The following options are available:

  • View key-value pairs and resources per every label
  • Search labels by key and value
  • Sort labels by key and usage
  • Edit individual labels
  • Delete individual labels
  • Open the selected label details

Label details

Under the label details, you can view resources that are labeled with it and remove this label from the associated resources.

Label details
Resource visibility

The resource tabs display only resources you can access.

This means you can see fewer resources per label than it's specified in this label summary (the right-side block under the label details) or in the Catalog > Labels.

Retrieving labeled resources with sloctl

Retrieving a labeled resource also returns associated labels. Use the -l flag to filter the retrieved resources by label as follows:

  • Separate labels by comma without spaces. For example,

    sloctl get slos -A -l key1=value1,key2=value2,key3=value3

  • Separate labels by the -l flag separating the required labels with spaces. For example,

    sloctl get slos -A -l team=green -l region=eu -l customer-type=enterprise

Filtering labeled resources with sloctl follows the same logic as in the Nobl9 Web application.

RBAC

ActionAccess level requiredResult
Unlink labelProject owner or editorThe key: value pair remains in the organization, but it's unlinked from a resource
Delete labelOrganization adminThe key: value pair no longer exists in the organization

Labels vs. metadata annotations

The difference between labels and metadata annotations is as follows:

  • Labels identify objects and locate groups of objects that meet specific criteria.
  • Metadata annotations don't serve the purpose of object identification or selection.
    • You can add or retrieve metadata annotations only using sloctl or Nobl9 SDK for Go!
  • You can apply both labels and metadata annotations to the same Nobl9 resource.

The following table summarizes differences between labels and metadata annotations:

CapabilityLabelsMetadata annotations
Resource identificationIdentify Nobl9 resources based on specific criteria.
Use for grouping and filtering
Do not identify Nobl9 objects.
Use to add context
Handling labels
  • Nobl9 Web application
  • sloctl
  • Nobl9 Terraform provider
  • Nobl9 SDK for Go!
  • sloctl
  • Nobl9 SDK for Go!
  • Label syntaxkey:
    - list-of-values
    key: value
    Character limit for valueUp to 200 unicode charactersUp to 1050 unicode characters
    metadata.annotations and kind: Annotation

    metadata.annotations differ from SLO annotations.

    SLO annotations are defined as a standalone 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: