diff options
author | Eric Eastwood <erice@element.io> | 2022-08-02 13:27:45 -0500 |
---|---|---|
committer | Eric Eastwood <erice@element.io> | 2022-08-02 13:27:45 -0500 |
commit | fb0e8203ca419212725ee03b806df2392acfcb96 (patch) | |
tree | 6f2c04ae52e6022eccee0c3f1dae7c813e128f2c /synapse | |
parent | Remove type ignore comments (diff) | |
download | synapse-fb0e8203ca419212725ee03b806df2392acfcb96.tar.xz |
More clear method names
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 2 | ||||
-rw-r--r-- | synapse/logging/tracing.py | 14 | ||||
-rw-r--r-- | synapse/replication/http/_base.py | 2 |
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 ) |