GovernanceTagsAllocationChargeback

Tags & Allocation

7 min read

Allocation is what turns a cloud bill into something a business can actually act on. QueryWise treats tags as the foundation, then layers cost centers, policies, and unit economics on top.

This page is the reference for each of those primitives. For the rollout playbook, see Cost Attribution Foundations.

Tag extraction

QueryWise extracts tags from billing data on every sync:

  • AWS — resource tags via tag:GetResources and Cost Allocation Tags
  • GCP — labels on resources, billing exports
  • Azure — Resource Manager tags
  • SnowflakeTAG_REFERENCES view
  • Databricks — query tags + workspace object tags
  • BigQuery — labels on jobs/datasets/tables
  • MongoDB Atlas — cluster + project tags

Query-level tags are also extracted from query comments (e.g. /* dbt_run_id=123 */), which means dbt and similar tools that propagate metadata via SQL comments get full attribution without needing additional tagging at the resource level.

Tag discovery

The Allocation → Tag Discovery view gives you a per-tag snapshot:

  • Coverage — what percent of last-30-day spend has this tag applied
  • Cardinality — how many distinct values
  • Vendors — where the tag appears
  • Top values — most common values + their spend share

Use coverage to find tags worth investing in. Use cardinality to find tags that have drifted (a team tag with 800 distinct values is not a team tag — it's free text).

Allocation rules

For untagged spend, you can write allocation rules that map account / service / region patterns to virtual tags. These rules run at query time and don't modify upstream data.

A rule example:

rule: legacy-payments
  match:
    vendor: aws
    account_id: "111122223333"
  apply:
    team: payments
    cost_center: payments-platform

Allocation rules are useful for closing the gap on legacy accounts where the political cost of backfilling tags is higher than the value. The rule lives in QueryWise; the cloud account stays untagged.

Tag policies

Tag policies enforce required tags at account creation time. Defined per vendor, they specify:

  • Required tag keys
  • Allowed values per key (optional)
  • Default values (optional)

Configure at Settings → Tag Policies. A cloud account that doesn't satisfy the policy can't be added — the API returns a 422 with the policy-violation details.

The policy compliance dashboard shows current state across all connected accounts, which is what you want to keep open during a tagging rollout.

Cost centers

A cost center is a tag-based filter that represents a business unit, product, or any other rollup. Defined at Settings → Cost Centers:

  • Filter — boolean expression over tags (team=payments AND env=prod)
  • Owner — user or email; receives alerts and reports
  • Budget — monthly $ budget (optional)
  • Description — for finance reports

Cost centers feed two views:

  • Allocation → Chargeback — full chargeback report with CSV export
  • Budgets — budget tracking with threshold alerts

Cost centers are inclusive — a single resource can be in multiple cost centers if you want overlapping rollups. The chargeback report deduplicates by primary cost center to prevent double-counting.

Chargeback report

The chargeback report breaks spend into:

  • Direct — spend with tags that map cleanly to a cost center
  • Allocated — spend distributed proportionally (e.g. shared warehouse credits)
  • Unallocated — spend that doesn't match any cost center

CSV export columns: period, cost_center, vendor, service, amount, allocation_method.

The CSV is structured to import into common finance systems (NetSuite, QuickBooks, Sage, custom spreadsheets) without transformation.

Unit economics

Unit economics is the cost-per-unit view, where the unit is whatever business dimension you tagged. Common units:

  • Cost per customer (customer_id tag)
  • Cost per pipeline run (pipeline_id + run_id)
  • Cost per request / order / event
  • Cost per query

The Allocation → Unit Economics tab shows trends over time — the number that drives "are we getting more or less efficient?"

Unit economics requires no separate setup beyond having the tag flow through to billing data.

Query tag analytics

For the query-level workflow, Allocation → Query Costs breaks down query spend by tag (typically dbt_model or pipeline_id extracted from query comments). This is where you find the dbt models that drive 60% of warehouse cost, or the pipeline runs that have 10× cost variance.

Where to next

Need help with onboarding?

Design partners get full docs plus hands-on support from our engineering team.