summary refs log tree commit diff
path: root/synapse/metrics/background_process_metrics.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-06-07 17:57:49 +0100
committerGitHub <noreply@github.com>2021-06-07 17:57:49 +0100
commitb2557cbf42d39fbd8a497a2f859cb45f84539da9 (patch)
tree1319ad53cd6c90c346c4ce9083486d7123e61f2a /synapse/metrics/background_process_metrics.py
parentMake link in docs use HTTPS (#10130) (diff)
downloadsynapse-b2557cbf42d39fbd8a497a2f859cb45f84539da9.tar.xz
opentracing: use a consistent name for background processes (#10135)
... otherwise we tend to get a namespace clash between the bg process and the
functions that it calls.
Diffstat (limited to '')
-rw-r--r--synapse/metrics/background_process_metrics.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/metrics/background_process_metrics.py b/synapse/metrics/background_process_metrics.py
index 0d6d643d35..de96ca0821 100644
--- a/synapse/metrics/background_process_metrics.py
+++ b/synapse/metrics/background_process_metrics.py
@@ -204,11 +204,12 @@ def run_as_background_process(desc: str, func, *args, bg_start_span=True, **kwar
 
         with BackgroundProcessLoggingContext(desc, count) as context:
             try:
-                ctx = noop_context_manager()
                 if bg_start_span:
                     ctx = start_active_span(
-                        desc, tags={SynapseTags.REQUEST_ID: str(context)}
+                        f"bgproc.{desc}", tags={SynapseTags.REQUEST_ID: str(context)}
                     )
+                else:
+                    ctx = noop_context_manager()
                 with ctx:
                     return await maybe_awaitable(func(*args, **kwargs))
             except Exception: