summary refs log tree commit diff
path: root/synapse/logging/tracing.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-02 13:27:45 -0500
committerEric Eastwood <erice@element.io>2022-08-02 13:27:45 -0500
commitfb0e8203ca419212725ee03b806df2392acfcb96 (patch)
tree6f2c04ae52e6022eccee0c3f1dae7c813e128f2c /synapse/logging/tracing.py
parentRemove type ignore comments (diff)
downloadsynapse-fb0e8203ca419212725ee03b806df2392acfcb96.tar.xz
More clear method names
Diffstat (limited to 'synapse/logging/tracing.py')
-rw-r--r--synapse/logging/tracing.py14
1 files changed, 7 insertions, 7 deletions
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: