1
0
This commit is contained in:
MadLittleMods
2025-07-29 19:31:47 +00:00
parent e14f5b6663
commit 39351e788e
4 changed files with 44 additions and 2 deletions

View File

@@ -1891,6 +1891,27 @@ each upgrade are complete before moving on to the next upgrade, to avoid
stacking them up. You can monitor the currently running background updates with
<a href="usage/administration/admin_api/background_updates.html#status">the Admin API</a>.</p>
<h1 id="upgrading-to-v11360"><a class="header" href="#upgrading-to-v11360">Upgrading to v1.136.0</a></h1>
<h2 id="deprecate-run_as_background_process-exported-as-part-of-the-module-api-interface-in-favor-of-moduleapirun_as_background_process"><a class="header" href="#deprecate-run_as_background_process-exported-as-part-of-the-module-api-interface-in-favor-of-moduleapirun_as_background_process">Deprecate <code>run_as_background_process</code> exported as part of the module API interface in favor of <code>ModuleApi.run_as_background_process</code></a></h2>
<p>The <code>run_as_background_process</code> function is now a method of the <code>ModuleApi</code> class. If
you were using the function directly from the module API, it will continue to work fine
but the background process metrics will not include an accurate <code>server_name</code> label.
This kind of metric labeling isn't relevant for many use cases and is used to
differentiate Synapse instances running in the same Python process (relevant to Synapse
Pro: Small Hosts). We recommend updating your usage to use the new
<code>ModuleApi.run_as_background_process</code> method to stay on top of future changes.</p>
<details>
<summary>Example <code>run_as_background_process</code> upgrade</summary>
<p>Before:</p>
<pre><code class="language-python">class MyModule:
def __init__(self, module_api: ModuleApi) -&gt; None:
run_as_background_process(__name__ + &quot;:setup_database&quot;, self.setup_database)
</code></pre>
<p>After:</p>
<pre><code class="language-python">class MyModule:
def __init__(self, module_api: ModuleApi) -&gt; None:
module_api.run_as_background_process(__name__ + &quot;:setup_database&quot;, self.setup_database)
</code></pre>
</details>
<h2 id="metric-labels-have-changed-on-synapse_federation_last_received_pdu_time-and-synapse_federation_last_sent_pdu_time"><a class="header" href="#metric-labels-have-changed-on-synapse_federation_last_received_pdu_time-and-synapse_federation_last_sent_pdu_time">Metric labels have changed on <code>synapse_federation_last_received_pdu_time</code> and <code>synapse_federation_last_sent_pdu_time</code></a></h2>
<p>Previously, the <code>synapse_federation_last_received_pdu_time</code> and
<code>synapse_federation_last_sent_pdu_time</code> metrics both used the <code>server_name</code> label to

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -286,6 +286,27 @@ each upgrade are complete before moving on to the next upgrade, to avoid
stacking them up. You can monitor the currently running background updates with
<a href="usage/administration/admin_api/background_updates.html#status">the Admin API</a>.</p>
<h1 id="upgrading-to-v11360"><a class="header" href="#upgrading-to-v11360">Upgrading to v1.136.0</a></h1>
<h2 id="deprecate-run_as_background_process-exported-as-part-of-the-module-api-interface-in-favor-of-moduleapirun_as_background_process"><a class="header" href="#deprecate-run_as_background_process-exported-as-part-of-the-module-api-interface-in-favor-of-moduleapirun_as_background_process">Deprecate <code>run_as_background_process</code> exported as part of the module API interface in favor of <code>ModuleApi.run_as_background_process</code></a></h2>
<p>The <code>run_as_background_process</code> function is now a method of the <code>ModuleApi</code> class. If
you were using the function directly from the module API, it will continue to work fine
but the background process metrics will not include an accurate <code>server_name</code> label.
This kind of metric labeling isn't relevant for many use cases and is used to
differentiate Synapse instances running in the same Python process (relevant to Synapse
Pro: Small Hosts). We recommend updating your usage to use the new
<code>ModuleApi.run_as_background_process</code> method to stay on top of future changes.</p>
<details>
<summary>Example <code>run_as_background_process</code> upgrade</summary>
<p>Before:</p>
<pre><code class="language-python">class MyModule:
def __init__(self, module_api: ModuleApi) -&gt; None:
run_as_background_process(__name__ + &quot;:setup_database&quot;, self.setup_database)
</code></pre>
<p>After:</p>
<pre><code class="language-python">class MyModule:
def __init__(self, module_api: ModuleApi) -&gt; None:
module_api.run_as_background_process(__name__ + &quot;:setup_database&quot;, self.setup_database)
</code></pre>
</details>
<h2 id="metric-labels-have-changed-on-synapse_federation_last_received_pdu_time-and-synapse_federation_last_sent_pdu_time"><a class="header" href="#metric-labels-have-changed-on-synapse_federation_last_received_pdu_time-and-synapse_federation_last_sent_pdu_time">Metric labels have changed on <code>synapse_federation_last_received_pdu_time</code> and <code>synapse_federation_last_sent_pdu_time</code></a></h2>
<p>Previously, the <code>synapse_federation_last_received_pdu_time</code> and
<code>synapse_federation_last_sent_pdu_time</code> metrics both used the <code>server_name</code> label to