mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Set opentracing priority before setting other tags (#10092)
... because tags on spans which aren't being sampled get thrown away.
This commit is contained in:
parent
3f96dbbda7
commit
ed53bf314f
5 changed files with 32 additions and 11 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue