From f7c013293c8e0f21df4ab74dd453f8bd85ae0277 Mon Sep 17 00:00:00 2001 From: Michael Stella Date: Tue, 22 Dec 2020 17:54:50 -0500 Subject: [PATCH] Don't set tags which are None This is often `None`, but tags are always strings, and so things get broken when spans get passed along to other client calls. Fixes #262 --- .../src/opentelemetry/exporter/datadog/propagator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/propagator.py b/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/propagator.py index d5f14011be..f20efd5ecf 100644 --- a/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/propagator.py +++ b/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/propagator.py @@ -97,7 +97,7 @@ def inject( self.SAMPLING_PRIORITY_KEY, str(constants.AUTO_KEEP if sampled else constants.AUTO_REJECT), ) - if constants.DD_ORIGIN in span.context.trace_state: + if span.context.trace_state.get(constants.DD_ORIGIN): set_in_carrier( carrier, self.ORIGIN_KEY,