Connect Grafana Cloud
Paste a read-only Grafana Cloud access policy token and your organization slug, and Costfluent imports your Grafana Cloud bill per product for each closed month, as Grafana states the amount due.
Costfluent reads your Grafana Cloud spend from your organization's billed usage, through Grafana's Cloud API, with an access policy token you create for it. One connection is one Grafana Cloud organization, named by its slug, and the cost of every product that organization is billed for.
How Costfluent connects
Costfluent collects each closed calendar month's Grafana Cloud cost from that month's billed usage, one row per product and closed calendar month, such as Logs, Metrics, Traces or Grafana Users.
Costfluent stores the token encrypted and uses it on grafana.com for two reads only, and never for
a request that changes anything: the organization (/api/orgs/{slug}) and its billed usage for a
month (/api/orgs/{slug}/billed-usage). The organization slug is the connection's identity once the
token has read that organization, and the token is only ever used for that connection.
Grafana states money per product, not per stack: a stack carries usage only. Costfluent therefore shows no cost per stack, and does not split a product's amount across your stacks.
Grafana Cloud bought through AWS Marketplace is also billed on your AWS bill. If you connect both AWS and Grafana Cloud, that cost appears in both connections, and Costfluent does not deduplicate it.
Prerequisites
- The Owner or Integration owner organization role in Costfluent.
- A Grafana Cloud user who can create access policies in the organization you want to connect.
Connect
Create the access policy and token in Grafana Cloud
- Copy your organization slug from your Grafana Cloud address,
grafana.com/orgs/<slug>. It is written in lower-case letters, digits and hyphens. - In the Grafana Cloud portal of that organization, open “Security”, then “Access Policies”, select “Create access policy”, and choose the organization's realm, “(all stacks)”, not a single stack.
- Give the access policy the scopes
orgs:readandbilling-metrics:read, and no other. - Add a token to the access policy, expiring in a year at most, and copy it. Note the expiry date, so you can replace the token before it stops working.
All three scopes this page names are read-only (Access policies, read 2026-11-26).
Grafana documents no scope tied to the billed usage route. If Grafana Cloud still refuses the billed
usage with orgs:read and billing-metrics:read, also add org-billing-info:read to the access
policy, as the check's message says, and connect again with the same token.
Connect in Costfluent
- Open Settings, then Integrations, select Grafana Cloud, and open the Connect tab.
- Select Add access policy token, keep the suggested Display name or enter your own, and paste the token under Access policy token and your slug under Organization slug.
- Select "Test connection" to see each check, or "Connect" to save.
Before storing anything, Costfluent checks that the slug has Grafana's shape, reads the organization with the token, and then reads the previous month's billed usage, so a connection that saves can read it. A new organization that has no billed month yet passes. A second connection of the same organization is refused. If Grafana Cloud does not answer while Costfluent reads the organization, nothing is saved: the organization is only the connection's once the token has read it, so connect again later. If it answers for the organization but not for the billed usage, the connection is saved anyway and checked again automatically.
Data and freshness
Grafana bills each calendar month once it closes. Costfluent files each product's amount on the first day of its month. Month and longer views are exact; a daily chart shows each product on that one day, so daily cost for Grafana Cloud is not available.
A month is available from the 1st of the next month. The running month shows no Grafana Cloud cost until it closes. Each sync also reads the previous month again until the 15th of the month, so a month Grafana bills on the 1st arrives with the next sync.
Each row's cost is the month's amount due for that product as Grafana states it, with the included usage and the tier rates already applied, in US dollars. Its quantity is the product's total usage in its unit. A product with no amount due that month is not stored.
Grafana states no history depth. Connecting imports as far back as your plan's backfill reaches, and at most six months (Manage connections), for each month Grafana has billed; a month before your organization's first billed month has nothing to import.
Reporting dimensions
- Service is the Grafana Cloud product: Logs, Metrics, Traces, Grafana Users, and any other product under its own name.
- Service category is Management and Governance, and Service subcategory is Observability, for every Grafana Cloud product.
- SKU is Grafana's identifier of the product, and the charge description is Grafana's own, such as “Hosted Logs Usage - September 2024”.
- The quantity is the product's total usage that month, in Grafana's unit for it.
- Grafana Cloud rows carry no resource and no stack.
- The billing account and the sub-account are the organization slug, and the billing period is the calendar month.
Update or disconnect
After connecting
The Manage tab lists the connection by its display name. Open the gear icon beside it to see whether the billed usage is still readable, which workspaces the connection feeds, and which months have been imported. Run checks runs the checks again on request.
Rotating or removing access
To replace the token, add a new token to the same access policy in the Grafana Cloud portal, select Update credentials on the connection page, and paste it with the same organization slug. A token that cannot read that organization's billed usage is refused. Once the connection reads with the new token, delete the old token from the access policy.
To retire the connection, remove it in Costfluent, then delete its token, or the access policy if nothing else uses it. Removing it erases the cost it imported (Remove a connection).
Troubleshooting
The check's messages say what Grafana Cloud answered:
- A Grafana Cloud organization slug is written in lower-case letters, digits and hyphens; …
Copy the slug from your Grafana Cloud address,
grafana.com/orgs/<slug>, as it is written there. - Grafana Cloud refused this token. The token is wrong, expired or deleted. Add a new token to an access policy of the organization, as described above, and paste it.
- Grafana Cloud refused this token the organization. The token's access policy lacks
orgs:read. Add that scope to the access policy and try again. - Grafana Cloud has no organization … Check the slug in your Grafana Cloud address.
- Grafana Cloud refused this token the organization's billed usage. Give the access policy
billing-metrics:readandorgs:read; if it already holds both, addorg-billing-info:read, then try again. - Grafana Cloud could not be reached to verify these credentials. Grafana Cloud did not answer, or answered with an error of its own. If it happened while reading the organization, nothing was saved: connect again later. For a connection that already exists, select Run checks later.
- A sync that ends with "Reconnect it with an access policy token of the organization". Grafana Cloud refused the stored token while collecting: it expired, was deleted, or its access policy lost a scope. Add a new token to the access policy and select Update credentials.
From your assistant
With the Costfluent MCP server connected, your assistant answers these with query_costs.
Code
Code