Generate usage attribution reports
By attributing usage to teams, services, departments, or systems, you can gain insight into how resources are being used and create usage budgets to manage costs more efficiently. Importantly, the accountability of cost reduction becomes shared, rather than solely the responsibility of a centralized business unit. With this usage and cost visibility, for example, the Finance team can generate reports for monthly financial analysis.
In managing usage costs, you can implement chargebacks, where it is feasible for teams or departments to pay for their own usage. In cases where there is no dedicated budget for usage at a team level, you can create showbacks to provide usage visibility, which helps to raise awareness of how much money is being spent, even if a particular team or department does not directly pay for their costs.
Note: Usage attribution reports are currently available for metrics only. Metrics usage-attributions are based on your monthly billable usage, and are not generated for shorter intervals.
To understand Metrics attribution, there are key underlying concepts:
- Active series ; for detailed information, refer to Active series.
- Data points per minute (DPM) ; for more information, refer to Data points per minute (DPM) and Reduce metrics costs by adjusting your data points per minute (DPM).
- Billable series, which are derived from both active series and DPM. For more information, refer to Billing calculations.
You can also break down previously billed months by metric labels, for historical usage attributions.
Identify label keys to appear on the report
The label keys by which you choose to attribute usage depend on your use-case.
Manage costs via chargebacks or showbacks
In this case, pick a label key where each label value represents ownership by a single billing center, whether that’s a division, team, squad, or similar. For example:
namespace
app
,application
, orservice
<CLOUD-PROVIDER-ACCOUNT-ID>_account_id
or_account
Perform financial analysis or create a report
To understand your cost of goods sold (COGS), and the breakdown between fixed and variable costs, you need to attribute costs to production versus non-production environments.
For example:
environment
orenv
cluster
Examples of other analyses, such as customer, product lines, region, or cloud provider, are as follows:
region
orlocation
cloud
Identify the best label keys to use from your metrics
Go to Home > Dashboards > GrafanaCloud.
Search for the Cardinality management - 3 - labels dashboard.
At the top of the dashboard in the Label field, search the available labels.
Select a label to see data about that label.
For example:
- The count of total values.
- The percentage of total series with that label.
- The values that occur most often and their distribution.
- A list of the highest-cardinality metrics for each value.
In some cases you won’t know which label key to use, or will have multiple candidates with similar names. For example you might have all of
app
,appid
,app_id
, orapplication
present on your metrics.Pick the best option based on the following criteria:
- A high percentage of total series
- A distribution which is:
- More than one label value. Value-count could be anything between two to tens, or a few hundred.
- A somewhat flat distribution.
Configure a usage report
When you first configure a report, contact Customer Support who sets up generation of it for the past three billing months. It is possible for them to run reports that are older than the past three months.
Provide the following information in your support ticket:
- Label keys to include in the usage attribution report; see Identify the best label keys to use from your metrics.
TENANT
instance ID- If required, length of time older than the past three months
View the usage attribution report
You can view all available monthly usage attribution reports via the attributions
HTTP API endpoint.
Note: Currently, this API only has one endpoint.
Before you begin:
To interact with the API, gather the following information:
URL
: In the formhttps://insights-<STACK ZONE>.grafana.net/
. To find your Grafana Cloud Stack’s zone, go to your Grafana Cloud account. Check the Details of your stack, then the Details page of your hosted Grafana. Take the hyphenated slug only. For example, if the Grafana instance shows “Zone: US Central - gcp us-central1 - us - prod-us-central-0” then useprod-us-central-0
for theSTACK ZONE
.cluster-slug can be found at the end of the ‘Zone’ field on the Grafana Instance details page TENANT
: The numeric instance ID where you want to fetch usage attribution reports. To find yourTENANT
value, go to your Grafana Cloud account and check the Details page of your hosted Prometheus endpoint for Username / Instance ID.TOKEN
: A token from a Grafana Cloud Access Policy, make sure the access policy hasmetrics:read
scope for the stack ID where you want to fetch usage attribution reports.
Example request:
curl -u "$TENANT:$TOKEN" "$URL/usage/v0/attributions/$TENANT"
Example response:
{
"HasDpmPerSeriesLargerThanIncluded": true,
"P95Time": "2023-10-28T22:41:04.246Z",
"Attributions": [
{
"LabelSet": {
"probe": "Atlanta"
},
"Count": 170
},
{
"LabelSet": {
"probe": "NewYork"
},
"Count": 163
},
{
"LabelSet": {
"probe": "Paris"
},
"Count": 51
},
{
"LabelSet": {
"probe": "Tokyo"
},
"Count": 25
}
],
"SumOfAttributions": 409,
"BillableSeriesAtP95Time": 409,
"BillableSeriesBilled": 409,
"attributionLabels": ["probe"],
"year": 2023,
"month": 10,
"instanceId": 478823,
"orgID": 123
}
Edit an existing report
You can specify a new set of labels for the report by contacting Customer Support. See Configure a usage report.
Was this page helpful?
Related resources from Grafana Labs


