summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r--synapse/http/matrixfederationclient.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py

index 3c35b1d2c7..00704a6a7c 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -72,9 +72,14 @@ from synapse.http.client import ( ) from synapse.http.federation.matrix_federation_agent import MatrixFederationAgent from synapse.http.types import QueryParams -from synapse.logging import opentracing +from synapse.logging import tracing from synapse.logging.context import make_deferred_yieldable, run_in_background -from synapse.logging.opentracing import set_tag, start_active_span, tags +from synapse.logging.tracing import ( + SpanAttributes, + SpanKind, + set_attribute, + start_active_span, +) from synapse.types import JsonDict from synapse.util import json_decoder from synapse.util.async_helpers import AwakenableSleeper, timeout_deferred @@ -517,18 +522,19 @@ class MatrixFederationHttpClient: scope = start_active_span( "outgoing-federation-request", - tags={ - tags.SPAN_KIND: tags.SPAN_KIND_RPC_CLIENT, - tags.PEER_ADDRESS: request.destination, - tags.HTTP_METHOD: request.method, - tags.HTTP_URL: request.path, + kind=SpanKind.CLIENT, + attributes={ + SpanAttributes.HTTP_HOST: request.destination, + SpanAttributes.HTTP_METHOD: request.method, + SpanAttributes.HTTP_URL: request.path, }, - finish_on_close=True, ) # Inject the span into the headers headers_dict: Dict[bytes, List[bytes]] = {} - opentracing.inject_header_dict(headers_dict, request.destination) + tracing.inject_active_tracing_context_into_header_dict( + headers_dict, request.destination + ) headers_dict[b"User-Agent"] = [self.version_string_bytes] @@ -614,7 +620,7 @@ class MatrixFederationHttpClient: request.method, response.code ).inc() - set_tag(tags.HTTP_STATUS_CODE, response.code) + set_attribute(SpanAttributes.HTTP_STATUS_CODE, response.code) response_phrase = response.phrase.decode("ascii", errors="replace") if 200 <= response.code < 300: