summary refs log tree commit diff
path: root/synapse/logging
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-07-12 15:07:13 +0100
committerErik Johnston <erik@matrix.org>2023-07-12 15:07:13 +0100
commit9c815553ed061d2d9288c9756f12a473c67ff869 (patch)
tree04c818607469c59745dafc427def8c7a6c47cb59 /synapse/logging
parentAdd prometheus exemplars support (diff)
downloadsynapse-9c815553ed061d2d9288c9756f12a473c67ff869.tar.xz
Fix exemplars
Diffstat (limited to '')
-rw-r--r--synapse/logging/opentracing.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py
index f5e4993fab..9a7fd7026b 100644
--- a/synapse/logging/opentracing.py
+++ b/synapse/logging/opentracing.py
@@ -672,8 +672,12 @@ def active_span() -> Optional["opentracing.Span"]:
     return opentracing.tracer.active_span
 
 
-def get_prometheus_exemplar() -> Optional[Dict[str, str]]:
-    span = active_span()
+def get_prometheus_exemplar(
+    span: Optional["opentracing.Span"] = None,
+) -> Optional[Dict[str, str]]:
+    if not span:
+        span = active_span()
+
     if not span:
         return None