Virtual tagging

Allocate spend by team, product or environment with rules, no cloud changes, with a rule builder and CostGlass AI.

Virtual tagging

Group and allocate your cloud and SaaS spend by team, product or anything else, using rules in CostGlass. No changes to your cloud and no waiting for new bills.

Where in CostGlassCosts → Virtual Tagging
PlanGrowth and above (the menu item is greyed out on lower plans)
Who can do thisOwners and admins create and edit. Other roles can view.
Time needed15 to 30 minutes for a first tag
In short
  • A virtual tag is a set of rules that put each billed charge into a named group, for example Team = Payments.
  • Rules are applied to billed cost when you look at it. Nothing is written to your cloud or stored on the cost records, so editing a rule re-allocates all history at once.
  • Rules are checked in order and the first match decides. Anything no rule matches gets the tag's default value.
  • You can build a tag from accounts, services, regions, resource ids, cloud tags and even other virtual tags.
  • Use the tag in Reports, in Cost Explorer (group by and filter) and to scope Budgets.
Before you begin
  • The Growth plan or above.
  • The Owner or Admin role to create or change tags.
  • Billed spend from at least one connected cloud or SaaS service.
  • Optional: cloud tags on AWS or Oracle Cloud resources, if you want rules based on them (see Tagging strategy).
Virtual Tagging: tabs for each virtual tag, the coverage meter, the allocation breakdown and the prioritised rule list.

The idea

Real cloud tags are great, but they have gaps: resources nobody tagged, bills that have no resource at all (support, tax, shared networking), clouds whose billing does not carry tags, and history you cannot change. A virtual tag is a tag that exists only in CostGlass. You give it a name such as Team and write rules such as "everything in AWS account A, plus anything whose service contains Kubernetes, is the Platform team".

Virtual tag (key)
The dimension you are creating, for example Team, Product or Environment.
Value
One of the groups inside a tag, for example Payments or Search.
Rule
A condition ("where") and a value to give matching charges ("then").
Default value
What a charge gets when no rule matches. It is called the untagged value in the app.
Coverage
The share of billed spend that was given a value by a rule rather than the default.
Note
Rules run on billed cost. They are evaluated when you view a report, so you can change a rule at any time and see the effect on every past month straight away.

Create a virtual tag

1
Open the page
Go to Costs → Virtual Tagging.
2
Start a tag
Click Add tag at the top. A dialog called Add a virtual tag shows ready-made templates and a Create a custom tag button. On a brand new organisation the page shows the same choices as a guided start.
3
Fill in the details (custom tag)
Enter a Display name (for example Team), an Identifier (no spaces) and an optional Description. Set the Untagged value (when no rule matches) and keep Active ticked.
4
Add rules
Click Add Matching Rule (or Add Rule in the rules card). See the next section.
5
Check coverage
Watch the coverage meter at the top rise as you add rules.

Each virtual tag is a tab under the page header, with a badge showing its number of rules. The buttons next to the tag's name are Untagged value, Duplicate, Edit and a delete button. A "dynamic" badge means the default value is taken from something rather than fixed text.

Templates

Templates create a working tag in one click. A template is greyed out, with a reason, when your data cannot support it.

TemplateWhat it gives youNeeds
ProviderSpend grouped by cloud or SaaS provider.Nothing special
Service CategorySpend grouped by the provider's own category (Compute, Storage, Databases ...).Nothing special
Cloud AccountSpend grouped by account, subscription or project.Nothing special
RegionSpend grouped by region.Nothing special
Taggable SpendSeparates usage charges (which can be tagged) from charges that cannot (tax, credits and so on).Billed usage charges
Environment from tagTakes the value from your own env or environment cloud tag.A resource with that tag
Team from tagTakes the value from your own team cloud tag.A resource with that tag

You can only create a template once. If you already have a tag with that identifier, the template shows as already existing.

The rule builder: Where and Then

A rule has two halves. Where says which charges it applies to. Then says what value those charges get. The dialog writes a plain-English summary of your rule as you build it, for example "When service contains "Kubernetes" then Team = Platform", so you can check it reads correctly.

Rule basics

SettingWhat it doesDefault / options
Rule nameA label for the rule list.Required
Position (1 = checked first)Where the rule sits in the order. See "Order and first match" below.New rules go last

Where: conditions

Each condition has a field, an operator and a value. The pickers offer the real values found in your own spend and inventory, and you can type your own where it makes sense.

FieldWhat it matches
ServiceThe service name on the bill, for example Amazon EC2.
AccountThe account, subscription, project or similar.
RegionThe region of the charge.
Resource IDThe id or name of the resource the charge was for.
Cloud providerAWS, Azure, Google Cloud and so on.
Service categoryThe provider's category for the service, where it supplies one.
Charge categoryThe kind of charge: usage, purchase, tax, credit or adjustment.
Cloud tagA tag on the resource (latest tags, not tags at bill time). You also name the tag key.
Another virtual tagThe value another virtual tag gives the charge. You also name that tag.
OperatorMeaningNotes
isEquals the value.
is notDoes not equal it.A charge with no value for the field counts as "is not" anything.
containsContains the text.
does not containDoes not contain it.
starts withBegins with the text.Not available for cloud tags or virtual tags.
matches regexMatches a regular expression.Not for cloud tags, virtual tags, provider, service category or charge category. An invalid expression is refused.
existsThe field has a value. For a cloud tag: the tag is present.Needs no value. Not available for virtual tags.
does not existThe field is empty. For a cloud tag: the tag is absent.Needs no value. Not available for virtual tags.
is one ofEquals any of a list of values.Up to 100 values.
is not one ofEquals none of them.Up to 100 values.

All comparisons ignore case. Values are limited to 100 characters.

Combining conditions: Add condition and Add group

Several conditions in a rule are joined with AND: all must be true. Click Add group to make a group, then choose any (OR) or all (AND) for it ("Match … of these"). Groups can contain groups, up to three levels, and a rule can have up to 25 conditions.

Example (illustrative)

"Platform team": Account is 1234… AND a group of any of: Service contains Kubernetes, Service contains CloudWatch. That means: the account, and either of those services.

Then: the value

Choose how the value is set:

  • A fixed value: type it, up to 100 characters, for example Payments.
  • Take the value from… (a dynamic value): copy it from the charge instead of typing it. Under Source choose A cloud tag on the resource (then give the tag key), A field of the charge (service, account, region, resource, cloud provider, service category or charge category), or Another virtual tag. This lets one rule cover many values: "team = whatever the team cloud tag says".
  • An optional Label names the rule in the list when the value is dynamic.

Only active between dates

Open Only active between dates (optional) and set Active from and Active until (inclusive). The rule then applies only to charges whose period start is inside that window. Use it for reorganisations: a rule for the old team structure ends on the last day of the quarter, and a new rule starts the day after.

Live impact

Before you save, the dialog asks the server what the conditions would catch and shows, for example, "Catches $1,200 (14% of spend) across 3,000 billed lines", with the biggest matches. It also shows how many of your resources have a cloud tag you are matching on. If the rule catches nothing, it says so, which usually means a typo or a tag that does not exist.

Order and first match

Rules are checked from top to bottom (position 1 first). The first rule that matches a charge decides its value, and later rules are not considered for that charge. Put specific rules above general ones.

  • Drag a rule by its handle to reorder, or use the move up and move down buttons.
  • You cannot reorder while a search filter is hiding some rules.
  • Each rule row has an on/off switch (pause or resume), Duplicate rule (the copy goes last), Edit rule and Delete rule.
  • A rule that cannot be applied to billed cost (for example an invalid pattern) is skipped and shown with the reason, and the page notes it. Paused rules and rules outside their date window do nothing.
Order matters (illustrative)

Rule 1: Service contains "Support" then Team = Shared. Rule 2: Account is production then Team = Payments. A production support charge goes to Shared, because rule 1 matched first. Swap them and it goes to Payments.

The default value

Click Untagged value to change what unmatched spend is called. It can be fixed text (such as "Unallocated") or dynamic, taken from a cloud tag, a field of the charge or another virtual tag, with a Fallback when empty value. In the breakdown, the default row carries an unallocated badge.

Tip
A dynamic default is a powerful tidy-up: set the default to take its value from your team cloud tag, and only write rules for the exceptions.

Tags built on tags

A rule can use another virtual tag as a condition (field Another virtual tag) or as the source of its value. For example a Department tag can group the values of a Team tag. Limits: a tag cannot depend on itself, directly or through others; the chain can be at most three levels deep. You cannot delete or rename a tag that other tags depend on, and the error names the dependants.

Coverage and the allocation view

Billing period

Use Billing period to choose Current month (to date), Last month, Last 3 complete months or Last 6 complete months.

Coverage meter

The large percentage is how much of the period's billed spend your rules allocate. Under it you see the amount allocated and unallocated. It may also show how many points coverage changed against the previous period, and how much of the spend carries a resource id or belongs to a tagged resource, which limits what cloud-tag rules can match.

Top unallocated spend lists the biggest services that fell to the default value, each with a button that opens the rule builder with that service filled in. Work down the list and the meter climbs fastest.

Virtual Cost Attribution

Cards show the billed spend and the number of values. Virtual Cost Attribution lists each value with its amount and share. Click a value to drill down to the services and items behind it (Item, Service, Billed cost).

Where to start (from your own data)

A panel suggests rules built only from your own data: cloud tags that exist on your resources (with their values), your biggest services and your accounts. Each has a button that opens a prefilled rule. Nothing is suggested that is not in your data.

Generate with CostGlass AI

Owners and admins see a collapsible Generate with CostGlass AI panel. It has two tabs.

TabWhat it does
Describe a ruleType what the rule should do in your own words (up to 500 characters) and click Generate rule. You get a proposed rule with the impact on your spend. Use this rule opens it in the rule builder; Try again asks again.
Suggest a tagChoose what you want to allocate spend by (environment, application, team or customer) and click Suggest a tag. You get a whole proposed tag with rules; untick any you do not want and accept.
  • Proposals use only values that exist in your own billed cost and inventory. If a request names things that are not in your data, you are asked to rephrase.
  • Nothing is saved until you accept: a single rule opens in the builder for you to review, and an accepted tag is re-checked before it is created.
  • Each request counts against your organisation's daily CostGlass AI allowance. When it is used up the panel says so, and it resets at 00:00 UTC.
Warning
Always read what the AI proposes. Check the summary sentence and the live impact figure before saving.

Where virtual tags are used

PlaceHow to use the tag
ReportsChoose the dimension Virtual Tag / Squad Allocation and pick the tag.
Cost ExplorerIn Group by, choose Virtual tag: [name]. You can also filter to, or exclude, values of a virtual tag.
BudgetsWhen creating a budget, choose a Virtual tag and a Tag value to budget a team or product.
Tag ComplianceSelect resources and click Quick Virtual Rule to start a rule from them.
Note
Anomaly detection and the dashboard widgets do not use virtual tags today.

Best practices

  • Start with the template that matches how finance reports (account, or team from tag), then refine.
  • Build a Team tag in layers. First, rules that take the value from your team cloud tag. Then rules by account for clouds or accounts with no tags. Then rules by service for shared platform costs. Finish with a clear default such as "Unallocated".
  • Handle shared costs deliberately. Give support, networking and shared platforms their own value (for example "Shared") rather than hiding them in one team. You can see their size and then decide how to share them in your own process.
  • Keep the rule count low. A tag can have at most 50 rules. A few well-chosen rules, with is one of lists and dynamic values, beat many one-off ones.
  • Put the most specific rules first. Use Duplicate to try a variation, and the pause switch to test without deleting.
  • Use the date windows for reorganisations instead of deleting old rules, so history stays correct.
  • Review "Top unallocated spend" monthly. New services appear all the time.
Worked example: a Team tag (illustrative)
  1. Create a tag called Team with the untagged value "Unallocated".
  2. Rule 1, "Team from cloud tag": where Cloud tag team exists, then take the value from the cloud tag team.
  3. Rule 2, "Data platform": where Account is one of your two data accounts, then Team = Data.
  4. Rule 3, "Shared services": where Service is one of support and networking services, then Team = Shared.
  5. Check coverage. Open Top unallocated spend, add rules for the biggest remaining services, and repeat.

Limits and things to know

LimitDetail
Rules per tagAt most 50.
Conditions per ruleAt most 25, in groups nested up to three levels.
Tags built on tagsNo cycles; chains up to three levels deep.
Cloud tag rules use latest tagsThe tags on a resource now, not the tags it had at bill time. A charge with no resource id cannot be matched on a cloud tag.
Cloud tag availabilityCloud tags reach CostGlass for AWS and Oracle Cloud. Rules on service, account and region work for every cloud.
Not used elsewhereAnomaly detection and dashboard widgets do not use virtual tags.
PlanGrowth and above. The menu entry is visible but locked on lower plans.
PermissionsOnly owners and admins create, edit or delete tags and rules.
Important
Virtual tags allocate billed cost. They do not change your cloud, and they do not change what your cloud provider invoices you.

Frequently asked questions

I edited a rule. Will last quarter change?
Yes. Rules are applied when you view the data, so any change re-allocates every period straight away. Use date windows to keep an old rule for old periods.
Why is a lot of spend "unallocated"?
No rule matched it. Open Top unallocated spend and add rules for the biggest services, or set a dynamic default.
My cloud-tag rule matches nothing.
The live impact panel will say so. The tag may not exist on your resources, the resources may not be in the inventory, or the spend may carry no resource id. Tag-based rules can match little when only a small share of spend belongs to tagged resources; the page notes this.
Can I use a virtual tag for Azure or SaaS spend?
Yes. Rules on account, service, region and provider work for every connected cloud and for AI and SaaS vendors.
Why is the menu item greyed out?
Virtual tagging needs the Growth plan or above. Clicking it explains the upgrade.
What is the difference between a virtual tag and a cloud tag?
A cloud tag is set in your cloud on a resource. A virtual tag is a set of rules in CostGlass applied to cost. See Tagging strategy.

Related guides