summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-07-17 11:52:27 +0100
committerJorik Schellekens <joriks@matrix.org>2019-07-17 14:22:55 +0100
commit3e5f4a40ded0b1b8c2da8dca9df4b03791f8f0c7 (patch)
tree4375cc7c9746e976b30cbed0478bd05a2f3667e9
parentNoop if opentracing is disabled (diff)
downloadsynapse-3e5f4a40ded0b1b8c2da8dca9df4b03791f8f0c7.tar.xz
Unbreak json parsing.
-rw-r--r--synapse/logging/opentracing.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py
index 4f85412631..3374c41591 100644
--- a/synapse/logging/opentracing.py
+++ b/synapse/logging/opentracing.py
@@ -391,13 +391,11 @@ def inject_active_span_text_map(carrier, destination=None):
 
 
 def active_span_context_as_string():
-    if not opentracing:
-        return None
-
     carrier = {}
-    opentracing.tracer.inject(
-        opentracing.tracer.active_span, opentracing.Format.TEXT_MAP, carrier
-    )
+    if opentracing:
+        opentracing.tracer.inject(
+            opentracing.tracer.active_span, opentracing.Format.TEXT_MAP, carrier
+        )
     return json.dumps(carrier)