This commit is contained in:
Eric Eastwood 2022-08-01 16:21:40 -05:00
parent 322da5137f
commit 33fd24e48c
2 changed files with 6 additions and 0 deletions

View file

@ -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:

View file

@ -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,