summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-01 17:54:14 -0500
committerEric Eastwood <erice@element.io>2022-08-01 17:54:14 -0500
commit00be06cfd938a6993eaa93115c663b1db64baf30 (patch)
tree70b2f92426c23a82cbbffc66f5df917fc3eb3c0a /synapse
parentRemove what's left of scopemanager (diff)
downloadsynapse-00be06cfd938a6993eaa93115c663b1db64baf30.tar.xz
Try to align read from edu content
Diffstat (limited to 'synapse')
-rw-r--r--synapse/logging/tracing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/logging/tracing.py b/synapse/logging/tracing.py
index 6050428d32..be0bfe2d18 100644
--- a/synapse/logging/tracing.py
+++ b/synapse/logging/tracing.py
@@ -571,8 +571,8 @@ def start_active_span_from_edu(
     if opentelemetry is None:
         return contextlib.nullcontext()  # type: ignore[unreachable]
 
-    carrier = json_decoder.decode(edu_content.get("context", "{}")).get(
-        EventContentFields.TRACING_CONTEXT, {}
+    carrier = json_decoder.decode(
+        edu_content.get(EventContentFields.TRACING_CONTEXT, "{}")
     )
 
     context = extract_text_map(carrier)
@@ -678,6 +678,7 @@ def inject_active_span_context_into_header_dict(
             return
 
     active_span = get_active_span()
+    assert active_span is not None
     # This doesn't affect the current context at all, it just converts a span
     # into `Context` object basically (bad name).
     ctx = opentelemetry.trace.propagation.set_span_in_context(active_span)
@@ -719,6 +720,7 @@ def get_active_span_text_map(destination: Optional[str] = None) -> Dict[str, str
         return {}
 
     active_span = get_active_span()
+    assert active_span is not None
     # This doesn't affect the current context at all, it just converts a span
     # into `Context` object basically (bad name).
     ctx = opentelemetry.trace.propagation.set_span_in_context(active_span)