summary refs log tree commit diff
path: root/synapse/metrics/background_process_metrics.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-09-13 16:29:51 -0500
committerEric Eastwood <erice@element.io>2022-09-13 16:53:14 -0500
commitb77d49f4410ceb42880af2882e70b3b3164955cc (patch)
tree6db246badd6986552c812310780a2796e46ab391 /synapse/metrics/background_process_metrics.py
parentMerge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry (diff)
downloadsynapse-b77d49f4410ceb42880af2882e70b3b3164955cc.tar.xz
Hopefully fix problem when OTEL not installed with non recording span
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 306, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 512, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.9/site-packages/synapse/federation/transport/server/_base.py", line 357, in new_func
    remote_parent_span = create_non_recording_span()
  File "/usr/local/lib/python3.9/site-packages/synapse/logging/tracing.py", line 502, in create_non_recording_span
    return opentelemetry.trace.NonRecordingSpan(
AttributeError: 'NoneType' object has no attribute 'trace'
```
Diffstat (limited to 'synapse/metrics/background_process_metrics.py')
-rw-r--r--synapse/metrics/background_process_metrics.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/metrics/background_process_metrics.py b/synapse/metrics/background_process_metrics.py

index 59d956dd9d..ad639fe223 100644 --- a/synapse/metrics/background_process_metrics.py +++ b/synapse/metrics/background_process_metrics.py
@@ -236,7 +236,7 @@ def run_as_background_process( attributes={SynapseTags.REQUEST_ID: str(context)}, ) else: - ctx = nullcontext() # type: ignore[assignment] + ctx = nullcontext() with ctx: return await func(*args, **kwargs) except Exception: