diff options
author | Eric Eastwood <erice@element.io> | 2022-08-01 17:54:14 -0500 |
---|---|---|
committer | Eric Eastwood <erice@element.io> | 2022-08-01 17:54:14 -0500 |
commit | 00be06cfd938a6993eaa93115c663b1db64baf30 (patch) | |
tree | 70b2f92426c23a82cbbffc66f5df917fc3eb3c0a /synapse | |
parent | Remove what's left of scopemanager (diff) | |
download | synapse-00be06cfd938a6993eaa93115c663b1db64baf30.tar.xz |
Try to align read from edu content
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/logging/tracing.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/logging/tracing.py b/synapse/logging/tracing.py index 6050428d32..be0bfe2d18 100644 --- a/synapse/logging/tracing.py +++ b/synapse/logging/tracing.py @@ -571,8 +571,8 @@ def start_active_span_from_edu( if opentelemetry is None: return contextlib.nullcontext() # type: ignore[unreachable] - carrier = json_decoder.decode(edu_content.get("context", "{}")).get( - EventContentFields.TRACING_CONTEXT, {} + carrier = json_decoder.decode( + edu_content.get(EventContentFields.TRACING_CONTEXT, "{}") ) context = extract_text_map(carrier) @@ -678,6 +678,7 @@ def inject_active_span_context_into_header_dict( return active_span = get_active_span() + assert active_span is not None # This doesn't affect the current context at all, it just converts a span # into `Context` object basically (bad name). ctx = opentelemetry.trace.propagation.set_span_in_context(active_span) @@ -719,6 +720,7 @@ def get_active_span_text_map(destination: Optional[str] = None) -> Dict[str, str return {} active_span = get_active_span() + assert active_span is not None # This doesn't affect the current context at all, it just converts a span # into `Context` object basically (bad name). ctx = opentelemetry.trace.propagation.set_span_in_context(active_span) |