Before you begin
- Create a billable metric that aggregates
valuewith a sum. CostGraph offers only metrics it can see in the connected account. - Attach a charge to the metric. Price per cent, or divide by 100 in the metric.
- Copy an API key from Developers > API keys.
Connect
1
Connect the account
In Integrations, click Lago and enter the API key. If you
self-host Lago or use a region other than the default, set API URL to
your instance, for example
https://lago.internal. Leave it empty for Lago
Cloud. CostGraph verifies the key against Lago before it saves anything,
and stores it encrypted.2
Bind a billable metric
Bind a
lago_ tag key to one of your billable metrics.Tag spend by customer
The tag value must be a Lago external subscription id, not a customer id. Lago attributes usage to a subscription, so a customer with two subscriptions needs the tag to name the one that carries the cloud spend. Lago rejects an event for a subscription that doesn’t exist, and CostGraph records the day with the rejection instead of billing it.Event payload
Each customer-day is one event on the metric. Itstransaction_id is derived
from the day and the totals, so a retried run counts once. The properties
carry value, the amount in cents, and the shared reconciliation fields.
Corrections are sent as the difference and can be negative. The metric must
sum value for the total to settle.