Skip to content

Commit e3c8a55

Browse files
authored
fix: W3C datadog parent state propagation (#122)
Remove validation on Datadog's W3C tracestate for `p` field.
1 parent 622585c commit e3c8a55

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

src/datadog/w3c_propagation.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Optional<PartiallyParsedTracestate> parse_tracestate(StringView tracestate) {
174174
// - `origin`
175175
// - `trace_tags`
176176
// - `sampling_priority`
177+
// - `datadog_w3c_parent_id`
177178
// - `additional_datadog_w3c_tracestate`
178179
void parse_datadog_tracestate(ExtractedData& result, StringView datadog_value) {
179180
const std::size_t end = datadog_value.size();
@@ -217,10 +218,6 @@ void parse_datadog_tracestate(ExtractedData& result, StringView datadog_value) {
217218
result.sampling_priority = priority;
218219
}
219220
} else if (key == "p") {
220-
if (value.size() != 16) {
221-
continue;
222-
}
223-
224221
result.datadog_w3c_parent_id = std::string(value);
225222
} else if (starts_with(key, "t.")) {
226223
// The part of the key that follows "t." is the name of a trace tag,

test/test_tracer.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -897,18 +897,6 @@ TEST_CASE("span extraction") {
897897
"00000000000d69ac", // expected_datadog_w3c_parent_id
898898
},
899899

900-
{
901-
__LINE__,
902-
"dd parent id is malformed",
903-
traceparent_drop, // traceparent
904-
"dd=p:XxDDOGxX", // tracestate
905-
0, // expected_sampling_priority
906-
nullopt, // expected_origin
907-
{}, // expected_trace_tags
908-
nullopt, // expected_additional_w3c_tracestate
909-
nullopt, // expected_additional_datadog_w3c_tracestate
910-
"0000000000000000", // expected_datadog_w3c_parent_id,
911-
},
912900
{
913901
__LINE__,
914902
"dd parent id is propagated even if not valid",

0 commit comments

Comments
 (0)