Set up cost attribution
Configure cost attribution to allocate your Grafana Cloud usage costs across teams, services, departments, or systems. This setup process involves selecting appropriate labels from your telemetry data and configuring them for cost allocation.
Before you begin
You must have the permissions granted by the Cost attribution admin role.
Configure attribution labels
Cost attribution relies on existing labels on your telemetry. Unlabeled or improperly labeled data can’t be correctly attributed. The labels you select for attributing costs depend on your specific use case and the labeling conventions.
To configure the labels you’d like to use for cost attribution, you must first create an attribution label in your Grafana Cloud stack. This is a self-service process that you can perform directly in the UI.
Note
The Cost Management and Billing App will be available either in the top level navigation of your Grafana instance, or under More apps.
To configure cost attribution labels, complete the following steps:
Sign in to your Grafana Cloud instance.
Navigate to Cost Management and Billing.
Click the Settings tab in the top navigation menu.
In the Set up your Attribution labels section, click the drop-down menu for 1. Select Metrics Key.
Choose your primary attribution label key from the list of suggested labels, such as
team
,service
, orenvironment
.The Logs Key (suggested) and Traces Key (suggested) fields are automatically populated with matching keys based on your metrics key selection. You can choose to override these if needed.
In the Label Name field, customize the auto-filled name based on your metrics key if desired.
Click Save Primary Label.
Optional: To add a secondary attribution label for more granular tracking, expand the Add additional attribution label section and repeat the process.
You should try to pick a label key that’s applied to the majority of your telemetry data. For example, if the label you choose is only applied to 2% of your telemetry, 98% of your usage and spend is classified as unattributed, which means the system doesn’t know the source of that telemetry because it was missing the specified labels.
Label requirements
When selecting labels for cost attribution, consider the following requirements:
- Maximum labels: You can configure up to 2 labels for cost attribution
- Cardinality limit: The combined cardinality of both labels cannot exceed 1,000 unique combinations
- Coverage: Choose labels that are applied to the majority of your telemetry data to minimize unattributed costs
Prohibited labels
Certain label keys can’t be used for cost attribution because they conflict with internal Grafana Cloud labels:
Label Key |
---|
id |
monetary |
org_id |
stack_id |
instance |
job |
tenant |
mimir_namespace |
loki_namespace |
loki_cluster |
reason |
tracker |
retention_hours |
__metrics_gen_instance |
__tenant_id__ |
Important considerations
Data availability timing
- Cost attribution begins collecting data only from the moment it’s enabled
- Historical data cannot be regenerated
- If you enable cost attribution partway through a month, the reported costs only reflect data from that point forward
Attribution accuracy
- Telemetry data without the configured attribution labels is classified as unattributed
- If your chosen labels are only applied to a small percentage of your telemetry, most usage appears as unattributed
- Review your labeling strategy to ensure consistent application of attribution labels across your telemetry
Stack-level configuration
- Cost attribution is configured and computed on a per-stack basis, not per-organization
- Each stack requires separate configuration if you have multiple stacks
- Attribution data is specific to the stack where you view it
Next steps
After configuring cost attribution:
- View attribution reports to analyze your cost allocation
- Understand attribution labels to optimize your labeling strategy
- Monitor unattributed costs to identify gaps in your labeling coverage