diff --git a/baseplate/lib/propagator_redditb3_http.py b/baseplate/lib/propagator_redditb3_http.py index c47fe7068..58ceaebea 100644 --- a/baseplate/lib/propagator_redditb3_http.py +++ b/baseplate/lib/propagator_redditb3_http.py @@ -40,6 +40,10 @@ def extract( context = Context() extracted_trace_id = _extract_first_element(getter.get(carrier, self.TRACE_ID_KEY)) + if extracted_trace_id is None: + # try lowercase + extracted_trace_id = _extract_first_element(getter.get(carrier, self.TRACE_ID_KEY.lower())) + logger.debug( "Extracted trace_id from carrier. [carrier=%s, context=%s, trace_id=%s]", carrier, @@ -47,6 +51,9 @@ def extract( extracted_trace_id, ) extracted_span_id = _extract_first_element(getter.get(carrier, self.SPAN_ID_KEY)) + if extracted_span_id is None: + # try lowercase + extracted_span_id = _extract_first_element(getter.get(carrier, self.SPAN_ID_KEY.lower())) logger.debug( "Extracted span_id from carrier. [carrier=%s, context=%s, span_id=%s]", carrier, @@ -54,6 +61,9 @@ def extract( extracted_span_id, ) sampled = _extract_first_element(getter.get(carrier, self.SAMPLED_KEY), default="0") + if sampled is None: + # try lowercase + sampled = _extract_first_element(getter.get(carrier, self.SAMPLED_KEY.lower())) logger.debug( "Extracted sampled from carrier. [carrier=%s, context=%s, sampled=%s]", carrier, @@ -61,6 +71,9 @@ def extract( sampled, ) flags = _extract_first_element(getter.get(carrier, self.FLAGS_KEY)) + if flags is None: + # try lowercase + flags = _extract_first_element(getter.get(carrier, self.FLAGS_KEY.lower())) logger.debug( "Extracted flags from carrier. [carrier=%s, context=%s, flags=%s]", carrier, diff --git a/baseplate/server/__init__.py b/baseplate/server/__init__.py index 79d9bf95b..39c533346 100644 --- a/baseplate/server/__init__.py +++ b/baseplate/server/__init__.py @@ -66,6 +66,7 @@ from baseplate.lib.log_formatter import CustomJsonFormatter from baseplate.lib.prometheus_metrics import is_metrics_enabled from baseplate.lib.propagator_redditb3_http import RedditB3HTTPFormat +from baseplate.lib.propagator_redditb3_thrift import RedditB3ThriftFormat from baseplate.server import einhorn from baseplate.server import reloader from baseplate.server.net import bind_socket @@ -275,7 +276,7 @@ def configure_tracing(config: Configuration) -> None: otlp_exporter = OTLPSpanExporter(endpoint=config.tracing["endpoint"], insecure=insecure) propagate.set_global_textmap( - CompositePropagator([RedditB3HTTPFormat(), TraceContextTextMapPropagator()]) + CompositePropagator([RedditB3ThriftFormat(), RedditB3HTTPFormat(), TraceContextTextMapPropagator()]) ) provider = TracerProvider(sampler=sampler, resource=resource) provider.add_span_processor(