Skip to main content
Virtual tags let you group costs by team, environment, or customer using rules you define. Use them when your cloud tags do not include that information. CostGraph applies the rules to your cost data without changing tags on your cloud resources.
Hands-on: Follow Create virtual tags to build a rule and check the spend it matches.

Keys and rules

A tag key names the category you group by, such as Team. Each rule matches cost data and assigns a value to that key. For example, a rule can match the service Amazon EC2 and assign the value Platform. Group your cost view by Team to compare the Platform team’s spend with other teams. The following diagram shows how CostGraph assigns Team = Platform to matching Amazon EC2 charges and groups their cost by team.
Amazon EC2 charges match a Team rule, receive the Platform value, and appear in a cost view grouped by Team.
You can match fields such as service, region, and account, or reuse an existing cloud tag’s value. Preview the charges a rule matches before saving it. Provider labels count as cloud tags too. They include sandbox labels from providers such as Daytona, E2B, Modal, Runloop, and Microsandbox. They also include resource tags from Vercel, Hetzner, Alibaba Cloud, Redis Cloud, and UpCloud. A rule can match these tags or reuse their values. The tag list shows the keys available in the selected tenant. Expand a key to review its rules.
Virtual tag keys with their rule counts. Team has three rules, Environment has one, and Product has none.

Sample Team, Environment, and Product keys in CostGraph.

Rule order and date ranges

CostGraph evaluates rules in order. The first matching rule assigns the value for that key. A charge that matches no rule keeps its own tag with the same key. That tag can be a cloud tag, a Kubernetes label, or a PostgreSQL database label. If the charge has none, it stays untagged for that key. A key bound to a billing export uses only its rules, so CostGraph shows the same spend you invoice. Rules apply to past and future cost data within their date range. Set dates when ownership changes to keep each period assigned to the appropriate team. Billing exports restrict rule changes for dates already reported to your billing platform. Before changing rules used for customer invoices, refer to Protected days.

Common uses

Use the same rule across resources that share an owner or purpose.

Next steps

Use these guides to create rules, export customer spend, or price your own hardware.

Create virtual tags

Create a key, check which charges its rules match, and group costs by the tag.

Generate rules with Graph AI

Describe how you want to attribute spend.

Billing exports

Send the spend assigned to each customer to your billing platform.

Pricing IDs

Assign rates to hardware you own.