PREMIUM ADD-ON ✨Governance is available upon request only. Please contact us to get access to this premium feature.
Governance entities
A governance entity is one dimension you attribute usage to. You define entities once for your organization, and they apply to every customer. An entity has one of two roles:- Hierarchical: nests under a parent and rolls up into it. Use it for reporting lines, such as
department→team→user. - Flat: has no parent and cuts across the tree. Use it for API keys, models or endpoints.
usage_attribution_type.
Values
Values are the members of an entity:rnd for department, alice for user, key_1 for api_key.
You don’t create values. Lago reads them from your events, and a new value appears the first time an event carries it.
Attribution keys
Attribution keys are the event properties that carry an entity’s value. An entity can have up to 4 keys, so services that send different property names still land on the same value:
Lago uses the first key it finds in the event, in the order you listed them.
Hierarchy and roll-ups
Hierarchical entities form a tree. Usage rolls up from the bottom to the top:eng is the sum of its users, department rnd is the sum of its teams, and every level adds up to the subscription total.
Flat entities sit outside the tree. You can read them across the whole subscription, or under any node, for example the API keys used by team eng.
Unattributed usage
Usage with no value for an entity is unattributed at that level. It shows as a No department, No team or No user row, and asunattributed in the API.
Unattributed usage is never dropped. It’s what keeps every level adding up to the total, and it shows you which events are missing a tag.
Units and amounts
You read attributed usage in one of two ways:- Units: consumption per charge, such as tokens or API calls.
- Amounts: the same usage priced with the plan, in the plan currency.
Set up governance
Define your entities.
Send attributed events
Tag events with entity values.