diff options
author | Erik Johnston <erik@matrix.org> | 2023-07-12 15:07:13 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2023-07-12 15:07:13 +0100 |
commit | 9c815553ed061d2d9288c9756f12a473c67ff869 (patch) | |
tree | 04c818607469c59745dafc427def8c7a6c47cb59 /synapse/logging | |
parent | Add prometheus exemplars support (diff) | |
download | synapse-9c815553ed061d2d9288c9756f12a473c67ff869.tar.xz |
Fix exemplars
Diffstat (limited to '')
-rw-r--r-- | synapse/logging/opentracing.py | 8 |
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 |