# snowflake_wh_missing_cost_allocation_tags

> Warehouses missing all 3 canonical tag keys (team, cost_center, and environment) cannot be attributed in showback reporting. Snowflake meters credits per warehouse, which makes the warehouse the natural chargeback unit, so an untagged one is a blind line item. A single present key keeps this rule quiet.

Source: https://zop.dev/integrations/snowflake/recommendations/snowflake-wh-missing-cost-allocation-tags
Updated: 2026-08-19

---

## Per-warehouse metering deserves per-warehouse owners

Snowflake hands you unusually clean cost data: WAREHOUSE_METERING_HISTORY attributes
every credit to a named warehouse, hour by hour. That makes the warehouse the natural
unit of chargeback, but only if something maps warehouse names to organizational
owners. Tags are that mapping. A warehouse with no ownership tags produces credits
finance can total but nobody can bill back, and in practice unowned spend is the spend
nobody ever optimizes.

## Only the fully blank fail

ZopNight's discoverer populates each warehouse's tags from the TAG_REFERENCES view, and
the rule fires only when all three canonical keys (`team`, `cost_center`, and
`environment`) are absent together. One present key is treated as evidence somebody
made an attribution decision, and the warehouse passes. That makes this a hygiene floor
rather than a completeness audit: the target is the warehouse nobody has ever labeled,
not the one with two of three keys. Note this is stricter in the passing direction than
ZopNight's Databricks tag rules, which flag any single missing key.

## Pull the tag map yourself

```sql
SELECT object_name, tag_name, tag_value
FROM SNOWFLAKE.ACCOUNT_USAGE.TAG_REFERENCES
WHERE domain = 'WAREHOUSE'
  AND LOWER(tag_name) IN ('team', 'cost_center', 'environment')
ORDER BY object_name;
```

Compare the result against `SHOW WAREHOUSES`. Any warehouse absent from the tag rows
is exactly what this rule reports. TAG_REFERENCES lags by up to 2 hours, so tags applied
moments ago will not show yet, in the view or in ZopNight's next discovery pass.

## Attaching the keys

Object tagging needs the tag objects to exist once, then one statement per warehouse:

```sql
CREATE TAG IF NOT EXISTS governance.tags.team;
ALTER WAREHOUSE analytics_wh SET TAG governance.tags.team = 'data-platform';
```

Repeat for `cost_center` and `environment`. Object tagging is an Enterprise-edition
feature. On Standard edition this rule's remediation path does not exist, and naming
conventions become the fallback attribution scheme.

## What tagging unlocks downstream

Once the three keys exist, per-team credit reports become a join between
WAREHOUSE_METERING_HISTORY and TAG_REFERENCES, budget alerts can be scoped to a
cost_center, and ZopNight's own showback views stop lumping the warehouse into an
unattributed bucket. The 5 minutes per warehouse is the entire cost of the fix.
