deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Databricks tagging split: cost tags attribute spend, data tags govern access

A two-part guide on dev.to separates Databricks' two tagging systems: cost tags that attribute compute spend, and Unity Catalog data tags that label and govern data.

Databricks tagging split: cost tags attribute spend, data tags govern access

Two tagging systems, one platform

A two-part guide published on dev.io... A two-part guide published on dev.to walks through tagging across Databricks and lands on a distinction that trips up many teams: the tags that explain your bill and the tags that govern your data live in entirely separate systems. According to the guide, a tag attached to compute plays no role in deciding who can see data, and a tag attached to a table contributes nothing to cost reporting.

The first part covers data tags in Unity Catalog; the second covers the cost tags that follow compute spend into usage records, budgets and Azure cost analysis.

Data tags: regular, governed and system

Data tags are key-value attributes applied to securable objects in Unity Catalog, including catalogs, schemas, tables, columns, volumes, views and functions. The guide sorts them into three kinds:

  • Regular tags are simple labels, useful for marking an owning team or domain and making objects easier to find.
  • Governed tags are account-level tags with enforced value lists and assignment permissions, suited to cases where consistency matters or an access policy depends on the tag.
  • System tags are governed tags Databricks defines itself; they cannot be modified or deleted, and their keys use the reserved prefixes system., class., sap. and ai..

Tags are applied with SET TAG and removed with UNSET TAG on Databricks Runtime 16.1 and above, or through Catalog Explorer. Tags set on a catalog or schema show up on contained objects as inherited tags, so the guide suggests tagging at the highest level that makes sense.

Governed tags reject values outside their allow list: the guide shows an assignment of sensitivity = medium failing with an error that names the permitted values. Tag values can be read through information_schema views such as table_tags and column_tags, and workspace search supports queries like tag:quality:gold. One caveat is that inherited catalog and schema tags do not match tag searches, and catalogs, schemas and columns cannot be searched by tag at all.

Tags themselves enforce nothing, according to the guide; access control comes from Unity Catalog permissions and from policies that reference governed tags. Tag propagation, which copies governed tags to derived tables and views, is currently in Beta.

Cost tags: default, custom and usage policy

Cost tags attribute compute spend to teams, projects and workloads, and they also come in three kinds:

  • Default tags are added by Databricks and vary by compute type. All-purpose and jobs compute carries Vendor, ClusterId, ClusterName and Creator, with jobs adding RunName and JobId; SQL warehouses add SqlEndpointId; pools carry DatabricksInstancePoolId and the pool creator's ID. These flow into detailed cost analysis reports in the Azure portal without any setup.
  • Custom tags are keys you define on workspaces, pools, clusters, SQL warehouses and jobs. They reach account usage logs and the underlying cloud resources, and they can scope budgets. An Azure resource holds at most 50 tags, and a pool supports up to 41 custom tags.
  • Usage policy tags are custom tags that a serverless usage policy attaches to serverless workloads. The feature is in Public Preview, and some pages and URLs still call it a budget policy.

Custom keys must not collide with default keys, and the consequences differ by location: workspace, cluster and pool tags that reuse a default key get renamed with an x_ prefix during propagation; tags added through a compute policy cause the resource to fail with an invalid settings error; and job tags with default keys are rejected outright at creation.

Serverless compute has no cluster to tag, which is why usage policies exist. A policy covers serverless notebooks, jobs, pipelines, model serving endpoints, apps and Lakebase Autoscaling projects. Users with one policy get it applied automatically; users with several must choose one, and if they do not, the first policy alphabetically applies. Existing assets are not covered retroactively, a notebook running inside a job follows only the job's policy, and a pipeline triggered by a job does not inherit that policy.

For enforcement, the guide shows a compute policy with an allowlist rule on a custom tag, and recommends usage policies for serverless. Tags reach billing through the custom_tags map column in system.billing.usage, which holds both compute tags and usage-policy tags, though records can take several hours to arrive. Budgets can be scoped by custom tags, and budget threshold webhooks are in Beta.

Why it matters

Cloud tagging programmes often assume a single namespace can serve both chargeback and governance. Databricks' design says otherwise: to split the bill by team, you tag compute; to mark a table sensitive and drive policy on it, you tag data in Unity Catalog. Teams running serverless have an extra gap to close, because that spend carries no tags at all unless a usage policy is attached. Together the two guides amount to a practical checklist: pick key names that avoid the defaults, keep sensitive values out of plain-text tags, enforce required tags through compute policies or usage policies, and verify the result by querying system.billing.usage rather than assuming the tags landed.

  • #databricks
  • #unity-catalog
  • #cloud-costs
  • #finops
  • #governance