---
title: "Usage groups for Grafana Cloud Metrics | Grafana Cloud documentation"
description: "Define usage groups to gain visibility into who or whose systems are sending metrics to Grafana Cloud Metrics."
---

# Usage groups for Grafana Cloud Metrics

Usage groups allow you to see what systems are sending what metrics to Grafana Cloud Metrics, and thereby incurring costs. You can gain visibility into who is responsible for running and maintaining those systems. You can shift the incentive to save costs from a single billing center to distributed billing centers. By doing so, individuals or teams can debit usage from their own monthly budget, and as a result take responsibility for the incurred costs.

## Who or what is in a usage group?

It depends on how your Grafana Cloud stack is set up and maintained and a single series can belong to more than one usage group:

For example, a series `up{job="integration/mysql", environment="production", team="penguins"}` might belong to the following groups:

- The total amount of active series of the stack. This lends itself to transparency and simplicity.
- A usage group `team_penguins` that matches on the `team="penguins"` label value: you can define a usage group for each team, division, or business unit. This makes it easy for an administrator to track usage and pass responsibility thereof back to each respective team.
- A usage group `production` that matches on the `environment="production"` label value: you can define a usage group for each environment, such as `development`, `staging`, or `production`. This helps the Finance team accurately depict direct and indirect usage costs.
- A usage group `integration/mysql` that matches on the `job="integration/mysql"` label value: Grafana Cloud has a list of pre-defined usage groups for well-known integrations. This helps system administrators to track the cost of each one of the integrations across the platform.

> Note
> 
> Usage groups in Grafana Cloud Metrics is a feature that is built on top of and behaves similarly to custom active series trackers in Mimir or GEM. For more information, refer to [Configure custom active series trackers](/docs/mimir/next/configure/configure-custom-trackers/#configure-custom-active-series-trackers).

### Usage group names

The names of a usage groups make it possible for you to track the number of active series by the labels that are already present in your metrics.

The name of each usage group must be of the following format:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
grafanacloud_usage_group/<customer_defined_group_name>’:  ‘<customer_defined_label_selector>’
```

### Usage group naming conventions

The name of a usage group:

- must be unique in the configuration file; two usage groups must not have the same name.
- may contain Unicode characters.
- doesn’t contain any sensitive data.

### Metrics grouped by label values

At the stack level, metrics are billed by the count of billable series, which is a function of data points per minute and active series. For more information, refer to [Understand your Grafana Cloud Metrics invoice](../../../understand-your-invoice/metrics-invoice/) and [Adjust your DPM](../../../reduce-costs/metrics-costs/adjust-data-points-per-minute/).

For implementation-level details about chargebacks, refer to [Chargeback for cloud services](https://www.sciencedirect.com/science/article/abs/pii/S0167739X14001502) on ScienceDirect.

### Define label selectors

Label selectors are parsed by Go’s label logic, and are built from one or more [matchers](https://pkg.go.dev/github.com/prometheus/alertmanager@v0.24.0/pkg/labels#ParseMatchers).

These selectors can do exact or regular-expression matching on label values. You can combine multiple matchers with a comma (`,`) for a logical `AND` operation. Each matcher must be accounted for. Currently, there is no way to match multiple labels with a logical `OR`. You can accomplish this via a regular expression that contains a logical `OR` (`|`):

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
label_key=~ (this_value|that_value)
```

### Match on multiple labels

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
// You can match on multiple labels, and via Regex too
'grafanacloud_usage_group/gov_customers': '{customer=~.*gov.*, label2=value2}' 28
```

You can reference and match existing label sets, and attribute groups of labels’ key-value pairs to distributed billing centers, such as service, financial, or departmental.

### Group by service

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
// Break down active series by service to understand and attribute usage
'grafanacloud_usage_group/service_a': '{service=a}',
'grafanacloud_usage_group/service_b': '{service=b}',
'grafanacloud_usage_group/service_zz': '{service=zz}',
```

### Group by region for financial analysis

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
// Financial analysis
// Costs (and Profit margin) per:
// location or region / product-line / price-plan / customer
'grafanacloud_usage_group/amer': '{region=amer}',
'grafanacloud_usage_group/emea': '{region=emea}',
'grafanacloud_usage_group/apac': '{region=apac}',
```

### Group by environment

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
// R&D spend: Fixed costs
'grafanacloud_usage_group/prod': '{env=prod}',
'grafanacloud_usage_group/staging': '{env=staging}',
'grafanacloud_usage_group/dev': '{env=dev}',
```

> Note
> 
> Ideally, keep the number of usage groups below 100, and associate usage groups only with actual billing centers.

## Set up usage groups

To set up usage groups, refer to the following section:

- [Configure usage groups for Grafana Cloud Metrics](/docs/grafana-cloud/cost-management-and-billing/analyze-costs/metrics-costs/usage-groups/configure-usage-groups/)
