Grafana Cloud

Manage labels and cost attribution

Labels let you categorize k6 projects by attaching metadata to all test runs in a project, such as team, environment, or department. When you assign labels to projects, cost attribution can use them to break down Virtual User Hour (VUH) consumption, so you can track testing costs across your organization.

Each label is defined at the stack level, and it includes a key and a description. When you assign a label to a project, you provide a value for that label. For example, a label with the key “environment” might have the value “production” in one project and “staging” in another, so you can track VUH consumption per environment, and optimize your tests and spending based on that data.

Before you begin

  • You need the Grafana Cloud Admin or the Performance Testing Admin role to create and manage labels.
  • There is a limit of 100 label keys per organization.
  • Label keys can’t exceed 64 characters.
  • You can assign up to 30 labels per project.

Label naming guidelines

When you create labels, follow these guidelines for consistency:

  • Use lowercase, descriptive keys, such as team, department, or environment.
  • Keep label values consistent across your organization. For example, use frontend everywhere instead of mixing frontend, Frontend, and FE.
  • Avoid changing label values frequently, because changes can affect historical usage tracking.

Create a label

To create a label:

  1. In Grafana Cloud, go to Testing & synthetics > Performance > Settings.
  2. Under Metadata, click Labels.
  3. Click New label.
  4. In the Name field, enter a key for the label.
  5. Enter a description for the label.
  6. Click Submit.

After you create the label, it appears in the Labels table, and you can assign it to projects.

Edit or delete a label

To edit or delete a label:

  1. Go to Testing & synthetics > Performance > Settings.
  2. Under Metadata, click Labels.
  3. Find the label you want to modify, then use the edit or delete icons next to it.

Caution

Deleting a label removes it from all projects that use it. This doesn’t affect historical usage data, but future test runs in those projects are no longer attributed to the deleted label.

Assign labels to a project

After you create labels, you can attach them to individual projects.

To assign labels to a project:

  1. Go to Testing & synthetics > Performance > Projects.
  2. Select the project you want to label.
  3. Click the menu icon in the upper-right corner of the project page.
  4. Select Manage labels. The Edit project labels dialog box opens.
  5. Click Add Label.
  6. From the Label Name drop-down, select a label.
  7. In the Label Value field, enter a value for the project.
  8. Click Save.

All future test runs in this project are attributed to the selected labels. Existing past test runs aren’t retroactively labeled.

Update labels on a project

To change the labels assigned to a project:

  1. From the project page, click the menu icon in the upper-right corner.
  2. Select Manage labels. The Edit project labels dialog box opens.
  3. Update the label values as needed.
  4. Click Save.

Updated labels apply to future test runs only. Past test runs retain the labels that were assigned at the time they ran.

Remove labels from a project

To remove labels from a project:

  1. From the project page, click the menu icon in the upper-right corner.
  2. Select Manage labels. The Edit project labels dialog box opens.
  3. Click the delete icon next to each label you want to remove.
  4. Click Save.

After you remove labels, future test runs in this project are no longer attributed to those labels.

Use labels for cost attribution

After you assign labels to projects, the Cost Management and Billing app can use them to attribute VUH consumption. This lets you track how much each team, environment, or department spends on performance testing.

To learn more about cost attribution reports, refer to Set up cost attribution.

Note

Cost attribution for Grafana Cloud k6 tracks VUH consumption only. It doesn’t track labels applied to individual k6 metrics.