Skip to content

Commit 1a401b1

Browse files
MilanGarnierclaude
andcommitted
feat: add DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT config
Adds the new `DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT` config key (values: continue, restart, ignore) with a CUSTOM(INT) parser, the corresponding C enum, and the supported-configurations.json entry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1d6b7ca commit 1a401b1

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

metadata/supported-configurations.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,13 @@
19951995
"default": "false"
19961996
}
19971997
],
1998+
"DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT": [
1999+
{
2000+
"implementation": "A",
2001+
"type": "string",
2002+
"default": "continue"
2003+
}
2004+
],
19982005
"DD_TRACE_PROPAGATION_STYLE": [
19992006
{
20002007
"implementation": "D",

tracer/configuration.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
CONFIG(SET_LOWERCASE, DD_TRACE_PROPAGATION_STYLE, "datadog,tracecontext,baggage", \
100100
.env_config_fallback = ddtrace_conf_otel_propagators) \
101101
CONFIG(SET, DD_TRACE_BAGGAGE_TAG_KEYS, "user.id, session.id, account.id") \
102+
CONFIG(CUSTOM(INT), DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT, "continue", .parser = dd_parse_propagation_behavior_extract) \
102103
CONFIG(BOOL, DD_TRACE_IGNORE_AGENT_SAMPLING_RATES, "false", .ini_change = zai_config_system_ini_change) \
103104
CONFIG(SET, DD_TRACE_TRACED_INTERNAL_FUNCTIONS, "") \
104105
CONFIG(INT, DD_TRACE_DEBUG_PRNG_SEED, "-1", .ini_change = ddtrace_reseed_seed_change) \
@@ -192,6 +193,12 @@ enum ddtrace_sampling_rules_format {
192193
DD_TRACE_SAMPLING_RULES_FORMAT_GLOB
193194
};
194195

196+
enum ddtrace_propagation_behavior_extract {
197+
DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT_CONTINUE = 0,
198+
DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT_RESTART,
199+
DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT_IGNORE,
200+
};
201+
195202
#define DD_CONFIGURATION DDTRACE_CONFIGURATION
196203
#include <ext/configuration_helpers.h>
197204

tracer/configuration_dependencies.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ static bool dd_parse_dbm_mode(zai_str value, zval *decoded_value, bool persisten
2222
return true;
2323
}
2424

25+
static bool dd_parse_propagation_behavior_extract(zai_str value, zval *decoded_value, bool persistent) {
26+
UNUSED(persistent);
27+
if (zai_str_eq_ci_cstr(value, "continue")) {
28+
ZVAL_LONG(decoded_value, DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT_CONTINUE);
29+
} else if (zai_str_eq_ci_cstr(value, "restart")) {
30+
ZVAL_LONG(decoded_value, DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT_RESTART);
31+
} else if (zai_str_eq_ci_cstr(value, "ignore")) {
32+
ZVAL_LONG(decoded_value, DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT_IGNORE);
33+
} else {
34+
return false;
35+
}
36+
37+
return true;
38+
}
39+
2540
static bool dd_parse_sampling_rules_format(zai_str value, zval *decoded_value, bool persistent) {
2641
UNUSED(persistent);
2742
if (zai_str_eq_ci_cstr(value, "regex")) {

0 commit comments

Comments
 (0)