From 660c8c1415704f0b9c6fe17fe74d40dfefd78f0a Mon Sep 17 00:00:00 2001 From: Sean Quah <8349537+squahtx@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:23:25 +0100 Subject: [PATCH] Log stack traces when a missing opentracing span is detected (#10983) Make it easier to track down where opentracing spans are going missing by including stack traces in the logs. --- changelog.d/10983.misc | 1 + synapse/logging/opentracing.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/10983.misc diff --git a/changelog.d/10983.misc b/changelog.d/10983.misc new file mode 100644 index 000000000..235899d14 --- /dev/null +++ b/changelog.d/10983.misc @@ -0,0 +1 @@ +Log stack traces when a missing opentracing span is detected. diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py index 03d2dd94f..5276c4bfc 100644 --- a/synapse/logging/opentracing.py +++ b/synapse/logging/opentracing.py @@ -339,6 +339,7 @@ def ensure_active_span(message, ret=None): "There was no active span when trying to %s." " Did you forget to start one or did a context slip?", message, + stack_info=True, ) return ret