<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tag dynamic allpurpose in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/tag-dynamic-allpurpose/m-p/89589#M2095</link>
    <description>&lt;P&gt;hi..&lt;/P&gt;&lt;P&gt;I want to use&amp;nbsp; 1 all purpose cluster&amp;nbsp; &amp;nbsp;and use dynamic taging in each notebook.&lt;/P&gt;&lt;P&gt;for example tag&amp;nbsp; project&amp;nbsp; and department.&lt;/P&gt;&lt;P&gt;I want to be able to change the tag from the notebook&amp;nbsp; so I will be able to understand the costs for each project and department.&lt;/P&gt;&lt;P&gt;I tried spark.conf.set(spark.databricks.clusterusagetags.dep,sc)&lt;/P&gt;&lt;P&gt;it didn't change though when I ran my pipeline.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2024 10:12:56 GMT</pubDate>
    <dc:creator>pargit</dc:creator>
    <dc:date>2024-09-12T10:12:56Z</dc:date>
    <item>
      <title>Tag dynamic allpurpose</title>
      <link>https://community.databricks.com/t5/data-governance/tag-dynamic-allpurpose/m-p/89589#M2095</link>
      <description>&lt;P&gt;hi..&lt;/P&gt;&lt;P&gt;I want to use&amp;nbsp; 1 all purpose cluster&amp;nbsp; &amp;nbsp;and use dynamic taging in each notebook.&lt;/P&gt;&lt;P&gt;for example tag&amp;nbsp; project&amp;nbsp; and department.&lt;/P&gt;&lt;P&gt;I want to be able to change the tag from the notebook&amp;nbsp; so I will be able to understand the costs for each project and department.&lt;/P&gt;&lt;P&gt;I tried spark.conf.set(spark.databricks.clusterusagetags.dep,sc)&lt;/P&gt;&lt;P&gt;it didn't change though when I ran my pipeline.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 10:12:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/tag-dynamic-allpurpose/m-p/89589#M2095</guid>
      <dc:creator>pargit</dc:creator>
      <dc:date>2024-09-12T10:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Tag dynamic allpurpose</title>
      <link>https://community.databricks.com/t5/data-governance/tag-dynamic-allpurpose/m-p/137239#M2658</link>
      <description>&lt;P&gt;Greetings&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/61223"&gt;@pargit&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;Why Your Approach Isn't Working&lt;/H2&gt;
&lt;P&gt;&lt;STRONG&gt;Cluster usage tags cannot be dynamically modified at runtime from within a notebook.&lt;/STRONG&gt; The `spark.databricks.clusterUsageTags.` configurations are read-only properties set when the cluster is created or configured, and `spark.conf.set()` cannot modify them during execution.&lt;/P&gt;
&lt;P&gt;When you use `spark.conf.get("spark.databricks.clusterUsageTags.clusterAllTags")`, you can &lt;STRONG&gt;read&lt;/STRONG&gt; the current tags, but attempting to set them with `spark.conf.set()` has no effect because these are cluster-level configurations that are immutable once the cluster is running.&lt;/P&gt;
&lt;H2&gt;Alternative Solutions for Cost Tracking&lt;/H2&gt;
&lt;H3&gt;Use Job Clusters with Different Tags&lt;/H3&gt;
&lt;P&gt;&lt;BR /&gt;Instead of a single all-purpose cluster, &lt;STRONG&gt;create job-specific clusters&lt;/STRONG&gt; where each job can have custom tags for `project` and `department`. This allows granular cost attribution through the Clusters API when defining job configurations.&lt;/P&gt;
&lt;H3&gt;Serverless Budget Policies&lt;/H3&gt;
&lt;P&gt;&lt;BR /&gt;If you're using serverless compute (Public Preview), you can use &lt;STRONG&gt;serverless budget policies&lt;/STRONG&gt; to automatically tag usage at the user or group level. When users are assigned different policies, their usage is automatically tagged with the policy's custom tags.&lt;/P&gt;
&lt;H3&gt;API-Based Cluster Management&lt;/H3&gt;
&lt;P&gt;&lt;BR /&gt;Programmatically update cluster tags using the Databricks &lt;STRONG&gt;Clusters API&lt;/STRONG&gt; before running workloads:&lt;BR /&gt;- Call the API to update cluster configuration with new tags&lt;BR /&gt;- Restart the cluster (if needed)&lt;BR /&gt;- Run your notebook with the updated tags&lt;/P&gt;
&lt;H3&gt;System Tables for Cost Analysis&lt;/H3&gt;
&lt;P&gt;&lt;BR /&gt;Use the `system.billing.usage` table to track costs. While you can't change cluster tags dynamically, you can add &lt;STRONG&gt;metadata tracking within your notebooks&lt;/STRONG&gt; (logging project/department info to a table) and join this with billing data for cost attribution.&lt;/P&gt;
&lt;P&gt;The fundamental limitation is that cluster tags are designed to be set at the infrastructure level, not modified during runtime execution.&lt;/P&gt;
&lt;P&gt;Hope this helps, Louis.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Nov 2025 12:37:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/tag-dynamic-allpurpose/m-p/137239#M2658</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-11-01T12:37:59Z</dc:date>
    </item>
  </channel>
</rss>

