Using Tags

Updated 1 week ago by Michael Katz

This topic covers using Tags to organize and view your Harness Applications' components. It includes the following sections:

Intended Audience

  • DevOps
  • Account Administrators

Before You Begin

Tags 101

Harness Tags function like the tags on common cloud providers' platforms. Our Tags are arbitrary key-value pairs that you can apply to Harness Applications' components. They provide metadata to facilitate organizing, searching, and filtering on these components.

Using Tags, you can overlay your organization’s structure onto Harness resources. Some sample use cases are:

  • Categorizing Application components by team.
  • Marking components for reuse, preservation, or deletion.
  • Allocating costs.

Some examples of Tag keys, with representative values, are:

  • org: engineering
  • owner: jenny
  • validUntil: 1557444441
  • do-not-delete

The final Tag example above is a key with no value. Therefore, if present a component, it simply acts like a flag.

Tags' Scope

Tags can be added to the following Harness Application components:

  • Service
  • Environment
  • Workflow
  • Pipeline
  • Infrastructure Provisioner

Harness plans to add broader tagging options in the near future.

Tags and Permissions

Your options for interacting with Tags depend on your Harness User Group permissions, as follows:

  • All users can view Tags (and values) that have been applied to Application components.
  • Users' Application Permissions determine their ability to apply, update, and remove Tags on specific Application components. See Applying Tags, below.
  • Users who have the Account Permission: Manage Tags can create Tag keys, impose Allowed Values on keys, and edit and delete keys. See Managing Tags, later in this topic.

Applying Tags

Users who have appropriate Application-level permissions can add and modify Tags on the Harness Application components listed above under Tags' Scope.

Adding Tags

To add a Tag to a supported Application component:

  1. Click into the component to display its Overview card: Service Overview, Environment Overview, Workflow Overview, etc. Here, you can locate and click the Add Tag link:

  1. In the resulting pop-up, select a key from the Tag Name drop-down:
  2. The Tag Value field can normally be left empty, or can accept a single free-form value (subject to Harness' restrictions on Tag values):
    However, if the tag has Allowed Values—indicated by a R(estricted) symbol—you must select a value from the drop-down list, as shown below:
  3. Click Submit to add your Tag:
    Each applied Tag's key and value will now appear on the component's Overview card:

Replacing Tag Values

If you click Add Tag, and then select a Tag Name that has already been applied to this component, you will see the error message below:

As advised, just click on the existing Tag to type—or select—a replacement Tag Value:

Click Submit to update the tag's value.

Removing Tags

You can remove Tags from the same Application components where you have Application Permissions to add Tags. Simply click the tag's X box, then respond to the confirmation message box shown below.

There is no automatic undo. To restore a removed Tag, you will need to manually re-enter its key and value.

Tag Restrictions

Tags in Harness have these general restrictions:

  • A Harness account can maintain a maximum of 500 Tag names.
  • Each Application component can have a maximum of 50 Tags applied to it.
  • When applied to an Application component, each instance of a Tag key can have only one value.
  • The Tag-name prefix is reserved for future use by Harness.

Tag names (keys) have the following restrictions:

  • Length: 1 to 128 characters.
  • Allowed characters: letters, numbers, spaces, _,-,/
  • Names must be unique across your Harness account.
  • Names are case-sensitive.
  • Names must not begin with the characters _, - or spaces.
  • System tags will have the Tag-name prefix system/.

Tag values, when applied to Application components, have the following restrictions:

  • Length: 0 to 256 characters. (Entering a value is optional—unless the Tag key imposes Allowed Values, in which case one of those values is required.)
  • Allowed characters: letters, numbers, spaces, _,-,/
  • Values are case-sensitive.
  • Must not begin with the characters _, - or spaces.

Managing Tags

To access all Tags for your Harness account, select Setup > Tags Management.

This displays the Tags Management page.

Here, all Harness users can:

  • View Tags. (Note the Search by Tag Name field at top right, which filters the display.)
  • View Tags' usage in the Used Values column.
  • Click on individual Tag Name column entries to display expanded usage details. (The Tag Usage Details modal below expands the previous display's owner row. Within this Tag Usage Details modal, you can click the linked components to view their configuration.)

Creating Tag Keys

Users whose User Group includes the Manage Tag Account permission can create a new Tag, as follows:

  1. Select Setup > Tags Management page > Create Tag (upper-right corner).
  2. In the resulting Create Tag dialog, assign a unique Tag Name as the key (see Tag Restrictions).
    Optionally, you can restrict the new Tag to a set of Allowed Values before you click SUBMIT.

Restricting Allowed Values

To restrict the values that users can apply to a Tag, simply type your approved values into the Allowed Values field. Press Tab or Enter after each entry.

After you click SUBMIT to create the Tag, it will appear on the Tags Management page with an R(estricted) icon. Hover over the icon to display the restrictions.

Updating Tag Keys

Users who have the Manage Tag Account permission can update an existing Tag on the Tags Management page, by clicking on that Tag row's More Options ⋮ menu.

This menu provides the following options:

  • Click Usage Details to open the same Tag Usage Details modal available by clicking in the Tag Name column.
  • Click Edit to open the Edit Tag dialog, where you can add or remove Allowed Values. (You cannot change the Tag Name here.)

  • Click Delete to delete the Tag key from Harness. (This also frees up its name for reuse.) You will see the confirmation message box below.

There is no automatic undo. To restore a removed Tag key, you will need to manually re-enter it, along with any Allowed Values.

How did we do?