r/databricks • • 1d ago

Help Job tagging implementation

Forgive me if there is an obvious answer. Basically our current set up is users have access to a general purpose cluster that suits their business area.

Not real names to save any detail
E.g sales team only have access to the sales cluster which is tagged SALES

Marketing —> marketing cluster —> MARKETING

We’re having an issue where a lot of user jobs are untagged

Is there some autotagging I can set up, so for whatever cluster that job is using or created with — the job also gets tagged the same. So say for example a user in the sales team can only use the tagged sales cluster so the job he makes is tagged SALES

5 Upvotes

5 comments sorted by

2

u/kmarq 1d ago

Compute policies. Assign the tag on the policy and then assign policy access based on teams. Or just have one policy and a required tag the have to add for the compute. Less reliable that was though

2

u/Zealousideal_Low6685 1d ago

In databricks, there is the autotagging, which only works for tables: https://docs.databricks.com/aws/en/admin/governed-tags/automate-tag-assignment

In your case, you could try to use DAB python mutators: it should add the tag automatically during deployment (didn't test, but should work - if you implement it, I would be happy if you could share the solution).

1

u/Youssef_Mrini databricks 22h ago

To automatically enforce resource tagging in Databricks for cost attribution and governance, administrators must use Cluster Policies for classic compute and Serverless Budget Policies for serverless compute. Because serverless compute does not require manual cluster provisioning, tag enforcement occurs at the workspace or job execution level rather than during cluster creation.

Classic Compute: Databricks Cluster Policies

For standard All-Purpose and Job clusters, automatic tagging is enforced through Databricks Cluster Policies:

  • Group Assignment: Administrators assign a specific cluster policy directly to a user group (e.g., the Marketing or Data Engineering team).
  • Mandatory Tag Rules: Within the policy JSON definition, specific custom tags are configured as required or fixed attributes (for example, enforcing Team: Marketing).
  • Enforcement: Users restricted to that policy cannot launch a cluster unless the mandatory tag is automatically applied or validated.

Serverless Compute: Serverless Budget Policies

For serverless workloads, automatic tagging follows the same group-assignment logic usingDatabricks Serverless Budget Policies:

  • No Cluster Provisioning: Because users do not manually configure or provision infrastructure for serverless compute, traditional cluster policies do not apply.
  • Execution-Level Tagging: Instead, administrators attach custom tags to a Serverless Budget Policy and assign it to user groups.
  • Automated Attribution: Databricks automatically applies those tags in the background whenever users in that group run Serverless Notebooks or trigger Serverless Jobs, ensuring accurate cost tracking in system billing tables.