summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/http/matrixfederationclient.py2
-rw-r--r--synapse/logging/tracing.py14
-rw-r--r--synapse/replication/http/_base.py2
3 files changed, 9 insertions, 9 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py

index e360c04cb0..5764a4e12c 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -533,7 +533,7 @@ class MatrixFederationHttpClient: # Inject the span into the headers headers_dict: Dict[bytes, List[bytes]] = {} - tracing.inject_active_span_context_into_header_dict( + tracing.inject_active_tracing_context_into_header_dict( headers_dict, request.destination ) diff --git a/synapse/logging/tracing.py b/synapse/logging/tracing.py
index cee4a9f36c..cc5a8297c0 100644 --- a/synapse/logging/tracing.py +++ b/synapse/logging/tracing.py
@@ -671,14 +671,14 @@ def is_context_forced_tracing( # Injection and extraction -@ensure_active_span("inject the span into a header dict") -def inject_active_span_context_into_header_dict( +@ensure_active_span("inject the active tracing context into a header dict") +def inject_active_tracing_context_into_header_dict( headers: Dict[bytes, List[bytes]], destination: Optional[str] = None, check_destination: bool = True, ) -> None: """ - Injects a span context into a dict of HTTP headers + Injects the active tracing context into a dict of HTTP headers Args: headers: the dict to inject headers into @@ -712,7 +712,7 @@ def inject_active_span_context_into_header_dict( propagator.inject(headers, context=ctx) -def inject_response_headers(response_headers: Headers) -> None: +def inject_trace_id_into_response_headers(response_headers: Headers) -> None: """Inject the current trace id into the HTTP response headers""" if not opentelemetry: return @@ -731,7 +731,7 @@ def inject_response_headers(response_headers: Headers) -> None: ) def get_active_span_text_map(destination: Optional[str] = None) -> Dict[str, str]: """ - Gets a span context as a dict. This can be used instead of manually + Gets the active tracing Context as a dict. This can be used instead of manually injecting a span into an empty carrier. Args: @@ -749,7 +749,7 @@ def get_active_span_text_map(destination: Optional[str] = None) -> Dict[str, str carrier_text_map: Dict[str, str] = {} propagator = opentelemetry.propagate.get_global_textmap() - # Put all of SpanContext properties onto the carrier text map that we can return + # Put all of Context properties onto the carrier text map that we can return propagator.inject(carrier_text_map, context=ctx) return carrier_text_map @@ -934,7 +934,7 @@ def trace_servlet( ) as span: request.set_tracing_span(span) - inject_response_headers(request.responseHeaders) + inject_trace_id_into_response_headers(request.responseHeaders) try: yield finally: diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py
index 482e92d0af..af160e31aa 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py
@@ -248,7 +248,7 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta): # Add an authorization header, if configured. if replication_secret: headers[b"Authorization"] = [b"Bearer " + replication_secret] - tracing.inject_active_span_context_into_header_dict( + tracing.inject_active_tracing_context_into_header_dict( headers, check_destination=False )