diff --git a/synapse/federation/transport/server/_base.py b/synapse/federation/transport/server/_base.py index 80abece72c..7beafe33c1 100644 --- a/synapse/federation/transport/server/_base.py +++ b/synapse/federation/transport/server/_base.py @@ -357,6 +357,7 @@ class BaseFederationServlet: remote_parent_span_cm = use_span(remote_parent_span, end_on_exit=True) + # TODO: Make sure this works (traces as expected) with remote_parent_span_cm, local_parent_span_cm: if origin and self.RATELIMIT: with ratelimiter.ratelimit(origin) as d: diff --git a/synapse/logging/tracing.py b/synapse/logging/tracing.py index 083453554f..cdc71b0544 100644 --- a/synapse/logging/tracing.py +++ b/synapse/logging/tracing.py @@ -529,6 +529,11 @@ def start_active_span( if opentelemetry is None: return contextlib.nullcontext() # type: ignore[unreachable] + # TODO: Why is this necessary to satisfy this error? It has a default? + # ` error: Argument "kind" to "start_span" of "Tracer" has incompatible type "Optional[SpanKind]"; expected "SpanKind" [arg-type]` + if kind is None: + kind = SpanKind.INTERNAL + span = start_span( name=name, context=context,