Define 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 theteam="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 theenvironment="production"
label value: you can define a usage group for each environment, such asdevelopment
,staging
, orproduction
. This helps the Finance team accurately depict direct and indirect usage costs. - A usage group
integration/mysql
that matches on thejob="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.
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:
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, see Understand your Grafana Cloud Metrics invoice and Adjust your DPM.
For implementation-level details about chargebacks, see Chargeback for cloud services on ScienceDirect.
Define label selectors
Label selectors are parsed by Go’s label logic, and are built from one or more matchers.
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
(|
):
label_key=~ (this_value|that_value)
Match on multiple labels
// 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
// 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
// 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
// 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, contact Customer Support.