<?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 Re: Lakehouse Monitoring API – Timeout Error When Enabling Monitors for All Tables in a Catalog in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123468#M2523</link>
    <description>&lt;P&gt;Thank you, this is really helpful!&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jul 2025 13:54:31 GMT</pubDate>
    <dc:creator>esalazar</dc:creator>
    <dc:date>2025-07-01T13:54:31Z</dc:date>
    <item>
      <title>Lakehouse Monitoring API – Timeout Error When Enabling Monitors for All Tables in a Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123322#M2517</link>
      <description>&lt;P&gt;I'm using the Databricks Lakehouse Monitoring API to enable monitoring across every table in a catalog. I wrote a script that loops through all schemas and tables and calls the create_monitor API for each one. However, when running the script from a notebook, I consistently get a Timed out after 0:05:00 error.&lt;/P&gt;&lt;P&gt;It seems like enabling monitors sequentially for a large number of tables is exceeding the execution timeout, especially if each API call takes a few seconds.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Is there a recommended way to avoid this timeout when enabling monitors at scale?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Should I implement parallelism or batching in the script?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Is there a way to increase the execution timeout in a Databricks notebook?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any guidance or best practices would be appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 16:26:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123322#M2517</guid>
      <dc:creator>esalazar</dc:creator>
      <dc:date>2025-06-30T16:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lakehouse Monitoring API – Timeout Error When Enabling Monitors for All Tables in a Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123427#M2522</link>
      <description>&lt;DIV class="paragraph"&gt;&lt;STRONG&gt;Key Recommendations for Enabling Lakehouse Monitoring at Scale Without Notebook Timeouts&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;1. Use Parallelism and Batching&lt;BR /&gt;- Avoid sequential API calls for many tables—they are slow and will likely hit execution limits. - Implement batching and use parallel threads or asynchronous calls (such as with Python’s &lt;CODE&gt;ThreadPoolExecutor&lt;/CODE&gt;) to enable multiple monitors at once.&lt;BR /&gt;- Begin with a modest number of parallel tasks (e.g., 5–10) to avoid API rate limits and Databricks backend overload.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;2. Prefer Jobs or External Automation Over Notebooks&lt;BR /&gt;- Databricks notebooks have execution timeouts and are not intended for large-scale bulk operations. - For many tables, automate the process using a Databricks Job or external orchestrator (like Terraform or custom REST API scripts) for longer or more robust execution.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;3. Adjust Execution Timeout If Needed&lt;BR /&gt;- If using notebooks, increase the timeout if supported by your compute environment:&lt;BR /&gt;&lt;CODE&gt;python
  spark.conf.set("spark.databricks.execution.timeout", "18000")  # seconds
  &lt;/CODE&gt; - Not all compute types honor this setting. Serverless and job clusters are most likely to support overrides. - For SQL Warehouses, adjust the &lt;CODE&gt;STATEMENT_TIMEOUT&lt;/CODE&gt; parameter.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;4. Optimize Monitor Creation&lt;BR /&gt;- Enable Change Data Feed (CDF) on tables and use recommended profiles for more efficient, scalable monitoring. - Use the latest Databricks SDK (&amp;gt;= 0.28.0) for improved API handling.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;5. Handle API Rate Limits and Errors&lt;BR /&gt;- Monitor for errors like &lt;CODE&gt;PENDING_UPDATE&lt;/CODE&gt; or rate limit responses; implement retry logic if encountered. - Increase concurrency cautiously, watching for API throttling or backend queuing.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;6. There Is No "Batch Create" API&lt;BR /&gt;- Each table must be enabled via an individual API call; batching and parallelizing must be done client-side.&lt;/DIV&gt;
&lt;HR /&gt;
&lt;DIV class="paragraph"&gt;&lt;STRONG&gt;Summary Table&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH scope="col"&gt;Problem Area&lt;/TH&gt;
&lt;TH scope="col"&gt;Solution/Best Practice&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Timeouts (notebook/script)&lt;/TD&gt;
&lt;TD&gt;Increase execution timeout if possible&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Bulk/slow enablement&lt;/TD&gt;
&lt;TD&gt;Use batching &amp;amp; parallelism (reasonable limits)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Operational scale&lt;/TD&gt;
&lt;TD&gt;Run as a Job, or orchestrate externally&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;API throttling/errors&lt;/TD&gt;
&lt;TD&gt;Implement retry/error handling&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Efficiency&lt;/TD&gt;
&lt;TD&gt;Enable CDF, use proper profiles, latest SDK&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;
&lt;DIV class="paragraph"&gt;&lt;STRONG&gt;Example (Parallel Creation):&lt;/STRONG&gt; ```python from concurrent.futures import ThreadPoolExecutor&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;def create_monitor_for_table(table_info): # API call logic here pass&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;with ThreadPoolExecutor(max_workers=10) as executor: executor.map(create_monitor_for_table, list_of_tables) &lt;CODE&gt;``
_Adjust &lt;/CODE&gt;max&lt;EM&gt;workers` based on observed performance and API constraints.&lt;/EM&gt;&lt;/DIV&gt;
&lt;HR /&gt;
&lt;DIV class="paragraph"&gt;&lt;STRONG&gt;In summary:&lt;/STRONG&gt;&lt;BR /&gt;To avoid timeouts, use parallelism, increase execution timeouts when possible, handle API limits/errors gracefully, and prefer running long bulk operations via jobs or automation frameworks rather than interactive notebooks. There’s no built-in batch operation; you must implement batching/parallelism on the client side.&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="paragraph"&gt;Hope this helps, Lou.&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Jul 2025 12:10:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123427#M2522</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-07-01T12:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lakehouse Monitoring API – Timeout Error When Enabling Monitors for All Tables in a Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123468#M2523</link>
      <description>&lt;P&gt;Thank you, this is really helpful!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 13:54:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123468#M2523</guid>
      <dc:creator>esalazar</dc:creator>
      <dc:date>2025-07-01T13:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lakehouse Monitoring API – Timeout Error When Enabling Monitors for All Tables in a Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123617#M2524</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/34815"&gt;@Louis_Frolio&lt;/a&gt;&amp;nbsp;, Thank you this is very well explained and it is really helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 09:41:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/lakehouse-monitoring-api-timeout-error-when-enabling-monitors/m-p/123617#M2524</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-07-02T09:41:45Z</dc:date>
    </item>
  </channel>
</rss>

