summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-09-14 01:59:37 -0500
committerEric Eastwood <erice@element.io>2022-09-14 01:59:37 -0500
commita027c6e9fe1122e9279f9158386a4e218d8f9433 (patch)
treeab1245fd6136ff881fa16df99785db14b9c09611 /synapse
parentHopefully fix problem when OTEL not installed with non recording span (diff)
downloadsynapse-a027c6e9fe1122e9279f9158386a4e218d8f9433.tar.xz
Maybe fix positional argument mismatch for DummyLink
Hopefully fix:
```
  File "/home/runner/work/synapse/synapse/synapse/storage/controllers/persist_events.py", line 246, in add_to_queue
    links=[Link(end_item.tracing_span_context)],
builtins.TypeError: __init__() takes 1 positional argument but 2 were given
```
Diffstat (limited to 'synapse')
-rw-r--r--synapse/logging/tracing.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/synapse/logging/tracing.py b/synapse/logging/tracing.py
index b92c1d96e3..d594ab735b 100644
--- a/synapse/logging/tracing.py
+++ b/synapse/logging/tracing.py
@@ -216,7 +216,7 @@ class _DummyLookup(object):
 class DummyLink(ABC):
     """Dummy placeholder for `opentelemetry.trace.Link`"""
 
-    def __init__(self) -> None:
+    def __init__(self, *args: Any) -> None:
         self.not_implemented_message = (
             "opentelemetry isn't installed so this is just a dummy link placeholder"
         )
@@ -547,7 +547,7 @@ def start_active_span(
     name: str,
     *,
     context: Optional["opentelemetry.context.context.Context"] = None,
-    kind: Optional["opentelemetry.trace.SpanKind"] = SpanKind.INTERNAL,
+    kind: "opentelemetry.trace.SpanKind" = SpanKind.INTERNAL,
     attributes: "opentelemetry.util.types.Attributes" = None,
     links: Optional[Sequence["opentelemetry.trace.Link"]] = None,
     start_time: Optional[int] = None,
@@ -560,11 +560,6 @@ 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,