diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-05-28 16:14:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 16:14:08 +0100 |
commit | ed53bf314fee25d79d349beae409caf81a2d677f (patch) | |
tree | f2acb4524ceac8860daa2ef71e1d98a97d9e80ad /synapse/metrics | |
parent | Log method and path when dropping request due to size limit (#10091) (diff) | |
download | synapse-ed53bf314fee25d79d349beae409caf81a2d677f.tar.xz |
Set opentracing priority before setting other tags (#10092)
... because tags on spans which aren't being sampled get thrown away.
Diffstat (limited to 'synapse/metrics')
-rw-r--r-- | synapse/metrics/background_process_metrics.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/metrics/background_process_metrics.py b/synapse/metrics/background_process_metrics.py index 714caf84c3..0d6d643d35 100644 --- a/synapse/metrics/background_process_metrics.py +++ b/synapse/metrics/background_process_metrics.py @@ -22,7 +22,11 @@ from prometheus_client.core import REGISTRY, Counter, Gauge from twisted.internet import defer from synapse.logging.context import LoggingContext, PreserveLoggingContext -from synapse.logging.opentracing import noop_context_manager, start_active_span +from synapse.logging.opentracing import ( + SynapseTags, + noop_context_manager, + start_active_span, +) from synapse.util.async_helpers import maybe_awaitable if TYPE_CHECKING: @@ -202,7 +206,9 @@ def run_as_background_process(desc: str, func, *args, bg_start_span=True, **kwar try: ctx = noop_context_manager() if bg_start_span: - ctx = start_active_span(desc, tags={"request_id": str(context)}) + ctx = start_active_span( + desc, tags={SynapseTags.REQUEST_ID: str(context)} + ) with ctx: return await maybe_awaitable(func(*args, **kwargs)) except Exception: |