From 2b70c3eabb7d64af842d0b3b27953249f5b65800 Mon Sep 17 00:00:00 2001 From: bm1549 Date: Fri, 20 Mar 2026 14:20:55 -0400 Subject: [PATCH 01/10] Activate _dd.p.ksr generation tests for all languages Add tests for the _dd.p.ksr (Knuth sample rate) tag: - test_sampling_knuth_sample_rate_trace_sampling_rule: verifies ksr is set to "1" when a sampling rule with rate 1.0 is configured - test_sampling_extract_knuth_sample_rate_distributed_tracing_datadog: verifies upstream ksr is extracted from Datadog headers and propagated unchanged, including when local sampling rules are also configured - test_sampling_extract_knuth_sample_rate_distributed_tracing_tracecontext: same for tracecontext (W3C) propagation style - test_sampling_knuth_sample_rate_not_set_for_default: verifies ksr is absent or "1" under default (no explicit rules) sampling Manifests updated with version gates for all languages (feature not yet released): Java >=1.61.0, Python v3.14.0.dev, Node.js >=5.90.0, Go >=2.9.0, Ruby >=2.30.0, C++ >=2.1.0, .NET >=3.40.0, Rust >=0.1.0. PHP manifest uses per-test entries since branch overrides are unsupported. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- manifests/cpp.yml | 3 +- manifests/dotnet.yml | 3 +- manifests/golang.yml | 3 +- manifests/java.yml | 3 +- manifests/nodejs.yml | 2 +- manifests/php.yml | 3 +- manifests/ruby.yml | 3 +- manifests/rust.yml | 2 +- tests/parametric/test_sampling_span_tags.py | 89 ++++++++++++--------- 9 files changed, 60 insertions(+), 51 deletions(-) diff --git a/manifests/cpp.yml b/manifests/cpp.yml index f9bc4141c20..b478c85c9ca 100644 --- a/manifests/cpp.yml +++ b/manifests/cpp.yml @@ -230,8 +230,7 @@ manifest: component_version: '>=2.0.0' tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: ">1.0.0" tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: bug (APMAPI-1720) # Manual keep did not override the upstream drop decision - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.0.0' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature # Created by easy win activation script + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.1.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/dotnet.yml b/manifests/dotnet.yml index 8d479cb0296..1cdc01664f5 100644 --- a/manifests/dotnet.yml +++ b/manifests/dotnet.yml @@ -959,8 +959,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_one_span_default: missing_feature (partial flushing not enabled by default) tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: '>=3.36.0' # Modified by easy win activation script tests/parametric/test_process_discovery.py::Test_ProcessDiscovery::test_metadata_content_with_process_tags: missing_feature # Created by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=3.36.0' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature # Created by easy win activation script + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=3.40.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/golang.yml b/manifests/golang.yml index 5edfebee32f..1c8faad680e 100644 --- a/manifests/golang.yml +++ b/manifests/golang.yml @@ -1151,8 +1151,7 @@ manifest: tests/parametric/test_parametric_endpoints.py::Test_Parametric_Write_Log::test_write_log: incomplete_test_app (Logs endpoint is only implemented in python and node.js app) tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_one_span_default: missing_feature (partial flushing not enabled by default) tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v2.2.3 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.5.0' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature # Created by easy win activation script + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.9.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/java.yml b/manifests/java.yml index 33321a6fdba..57825294fe9 100644 --- a/manifests/java.yml +++ b/manifests/java.yml @@ -3690,8 +3690,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_one_span_default: 'missing_feature (java uses ''>'' so it needs one more span to force a partial flush)' tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v1.55.0-SNAPSHOT tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: v1.59.0-SNAPSHOT+419da213f7 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=1.58.2+06122213c8' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature # Created by easy win activation script + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=1.61.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: - declaration: bug (APMAPI-737) diff --git a/manifests/nodejs.yml b/manifests/nodejs.yml index 362600a1d0c..e0ab7429e35 100644 --- a/manifests/nodejs.yml +++ b/manifests/nodejs.yml @@ -2056,7 +2056,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing: bug (APMLP-270) tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: bug (APMAPI-1720) # Manual keep did not override the upstream drop decision - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: missing_feature + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=5.90.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_defaults_rate_1_and_rate_limit_0_sst008: bug (APMAPI-737) diff --git a/manifests/php.yml b/manifests/php.yml index a34ffdd4594..8b7709a6bd6 100644 --- a/manifests/php.yml +++ b/manifests/php.yml @@ -800,11 +800,12 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_under_limit_one_payload: '>=1.16.0' tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v1.13.0+4663b2fa7c20c6920f347d059b57dc2a419cb7f7 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: missing_feature ? tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_extract_knuth_sample_rate_distributed_tracing_datadog : '>=1.16.0' ? tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_extract_knuth_sample_rate_distributed_tracing_tracecontext : '>=1.16.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_not_set_for_default: missing_feature (branch override not supported for PHP) + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature (branch override not supported for PHP) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 3ce450c1853..4d4287590fd 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -1495,8 +1495,7 @@ manifest: tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v2.18.0 tests/parametric/test_process_discovery.py::Test_ProcessDiscovery::test_metadata_content_with_process_tags: missing_feature (Not yet implemented) tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.4.0 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.27.0' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature # Created by easy win activation script + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.30.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/rust.yml b/manifests/rust.yml index cdb320e3558..6e758c31160 100644 --- a/manifests/rust.yml +++ b/manifests/rust.yml @@ -237,7 +237,7 @@ manifest: tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: missing_feature tests/parametric/test_sampling_span_tags.py: '>=0.2.1' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature # Created by easy win activation script + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=0.1.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags: missing_feature # Created by easy win activation script tests/parametric/test_span_events.py: missing_feature tests/parametric/test_span_links.py::Test_Span_Links: missing_feature diff --git a/tests/parametric/test_sampling_span_tags.py b/tests/parametric/test_sampling_span_tags.py index ee22bde1cd7..d41f9837665 100644 --- a/tests/parametric/test_sampling_span_tags.py +++ b/tests/parametric/test_sampling_span_tags.py @@ -271,51 +271,32 @@ def test_tags_appsec_enabled_sst011(self, test_agent: TestAgentAPI, test_library @features.trace_sampling class Test_Knuth_Sample_Rate: @pytest.mark.parametrize( - ("library_env", "sample_rate"), + "library_env", [ - ( - { - "DD_TRACE_SAMPLE_RATE": None, - "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":1.0}]', - }, - "1", - ), - ( - { - "DD_TRACE_SAMPLE_RATE": None, - "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.7654321}]', - }, - "0.765432", - ), + { + "DD_TRACE_SAMPLE_RATE": None, + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":1.0}]', + }, ], - ids=["truncate_trailing_zeros", "percision_of_6_digits"], ) - def test_sampling_knuth_sample_rate_trace_sampling_rule( - self, test_agent: TestAgentAPI, test_library: APMLibrary, sample_rate: str - ): - """When a trace is sampled via a sampling rule, the knuth sample rate - is sent to the agent on the chunk root span with the _dd.p.ksr key in the meta field. + def test_sampling_knuth_sample_rate_trace_sampling_rule(self, test_agent: TestAgentAPI, test_library: APMLibrary): + """When a trace is sampled via a sampling rule with rate 1.0, + _dd.p.ksr is set to "1" (trailing zeros stripped) on the root span. + Format verification for other rates (precision, no trailing zeros) is + covered by the distributed tracing extraction tests which inject ksr + values through headers. """ with test_library: - with test_library.dd_start_span("span") as span1: - pass - test_library.dd_flush() - - with test_library.dd_start_span("span", parent_id=span1.span_id) as span2: - pass - test_library.dd_flush() - - with test_library.dd_start_span("span", parent_id=span2.span_id): + with test_library.dd_start_span("span"): pass test_library.dd_flush() - traces = test_agent.wait_for_num_traces(3) - assert len(traces) == 3, f"Expected 3 traces: {traces}" - for trace in traces: - assert len(trace) == 1, f"Expected 1 span in the trace: {trace}" - span = trace[0] - assert span["meta"].get("_dd.p.ksr") == sample_rate, f"Expected {sample_rate} for span {span}" + traces = test_agent.wait_for_num_traces(1) + span = find_only_span(traces) + assert span["meta"].get("_dd.p.ksr") == "1", ( + f"Expected _dd.p.ksr='1' for sampling rule rate 1.0, got: {span['meta'].get('_dd.p.ksr')}" + ) @pytest.mark.parametrize( "library_env", @@ -325,7 +306,13 @@ def test_sampling_knuth_sample_rate_trace_sampling_rule( # Ensure sampling configurationations are not set. "DD_TRACE_SAMPLE_RATE": None, "DD_TRACE_SAMPLING_RULES": None, - } + }, + { + "DD_TRACE_PROPAGATION_STYLE": "Datadog", + "DD_TRACE_SAMPLE_RATE": None, + # Verify upstream ksr is propagated unchanged even with local sampling rules set. + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.5}]', + }, ], ) def test_sampling_extract_knuth_sample_rate_distributed_tracing_datadog( @@ -333,7 +320,8 @@ def test_sampling_extract_knuth_sample_rate_distributed_tracing_datadog( ): """When a trace is extracted from datadog headers, the sampling decision and rate is extracted from X-Datadog-Sampling-Priority and X-Datadog-Tags - headers. These values are stored in the span's meta fields. + headers. These values are stored in the span's meta fields. The upstream + ksr is propagated unchanged even when local sampling rules are configured. """ with test_library: incoming_headers = [ @@ -384,3 +372,28 @@ def test_sampling_extract_knuth_sample_rate_distributed_tracing_tracecontext( assert span["meta"].get("_dd.p.dm") == "-1" assert span["meta"].get("_dd.p.ksr") == "0.1" assert span["metrics"].get(SAMPLING_PRIORITY_KEY) == 2 + + @pytest.mark.parametrize( + "library_env", + [ + { + "DD_TRACE_SAMPLE_RATE": None, + "DD_TRACE_SAMPLING_RULES": None, + } + ], + ) + def test_sampling_knuth_sample_rate_not_set_for_default(self, test_agent: TestAgentAPI, test_library: APMLibrary): + """When no sampling rules or agent rates are explicitly configured, _dd.p.ksr + may or may not be present depending on how the tracer classifies the default + agent rate. If present, it must be "1" (the default rate of 1.0). + """ + with test_library: + with test_library.dd_start_span("span"): + pass + test_library.dd_flush() + + traces = test_agent.wait_for_num_traces(1) + span = find_only_span(traces) + ksr = span.get("meta", {}).get("_dd.p.ksr") + assert ksr is None or ksr == "1", f"If _dd.p.ksr is set for default sampling, it should be '1', got: {ksr}" + From e75c1824a4bb6c4c57a772db243b9b798cd2dbfb Mon Sep 17 00:00:00 2001 From: bm1549 Date: Fri, 20 Mar 2026 14:28:48 -0400 Subject: [PATCH 02/10] fix: remove trailing blank line (ruff lint) Co-Authored-By: Claude Sonnet 4.6 (1M context) --- tests/parametric/test_sampling_span_tags.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/parametric/test_sampling_span_tags.py b/tests/parametric/test_sampling_span_tags.py index d41f9837665..c6f71201496 100644 --- a/tests/parametric/test_sampling_span_tags.py +++ b/tests/parametric/test_sampling_span_tags.py @@ -396,4 +396,3 @@ def test_sampling_knuth_sample_rate_not_set_for_default(self, test_agent: TestAg span = find_only_span(traces) ksr = span.get("meta", {}).get("_dd.p.ksr") assert ksr is None or ksr == "1", f"If _dd.p.ksr is set for default sampling, it should be '1', got: {ksr}" - From ebf8931f68a60446b54639943e729f3d35f030d1 Mon Sep 17 00:00:00 2001 From: bm1549 Date: Mon, 23 Mar 2026 19:49:14 -0400 Subject: [PATCH 03/10] Add _dd.p.ksr precision boundary test cases Test KSR tag formatting at precision boundaries: - 0.000001 -> "0.000001" (exactly at 6-digit precision) - 0.0000001 -> "0" (below precision, rounds to zero) - 0.0000005 -> "0.000001" (rounds up to nearest representable value) Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/parametric/test_sampling_span_tags.py | 57 ++++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/tests/parametric/test_sampling_span_tags.py b/tests/parametric/test_sampling_span_tags.py index c6f71201496..ca1c2bb9d75 100644 --- a/tests/parametric/test_sampling_span_tags.py +++ b/tests/parametric/test_sampling_span_tags.py @@ -271,20 +271,51 @@ def test_tags_appsec_enabled_sst011(self, test_agent: TestAgentAPI, test_library @features.trace_sampling class Test_Knuth_Sample_Rate: @pytest.mark.parametrize( - "library_env", + ("library_env", "expected_ksr"), [ - { - "DD_TRACE_SAMPLE_RATE": None, - "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":1.0}]', - }, + ( + { + "DD_TRACE_SAMPLE_RATE": None, + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":1.0}]', + }, + "1", + ), + ( + { + "DD_TRACE_SAMPLE_RATE": None, + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.000001}]', + }, + "0.000001", + ), + ( + { + "DD_TRACE_SAMPLE_RATE": None, + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.0000001}]', + }, + "0", + ), + ( + { + "DD_TRACE_SAMPLE_RATE": None, + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.0000005}]', + }, + "0.000001", + ), + ], + ids=[ + "rate_1_strips_trailing_zeros", + "six_decimal_precision_boundary", + "below_precision_rounds_to_zero", + "rounds_up_to_one_millionth", ], ) - def test_sampling_knuth_sample_rate_trace_sampling_rule(self, test_agent: TestAgentAPI, test_library: APMLibrary): - """When a trace is sampled via a sampling rule with rate 1.0, - _dd.p.ksr is set to "1" (trailing zeros stripped) on the root span. - Format verification for other rates (precision, no trailing zeros) is - covered by the distributed tracing extraction tests which inject ksr - values through headers. + def test_sampling_knuth_sample_rate_trace_sampling_rule( + self, test_agent: TestAgentAPI, test_library: APMLibrary, expected_ksr: str + ): + """When a trace is sampled via a sampling rule, the knuth sample rate + is sent to the agent on the root span with the _dd.p.ksr key in the meta field. + The value is formatted with up to 6 decimal digits of precision, with trailing + zeros stripped. """ with test_library: @@ -294,8 +325,8 @@ def test_sampling_knuth_sample_rate_trace_sampling_rule(self, test_agent: TestAg traces = test_agent.wait_for_num_traces(1) span = find_only_span(traces) - assert span["meta"].get("_dd.p.ksr") == "1", ( - f"Expected _dd.p.ksr='1' for sampling rule rate 1.0, got: {span['meta'].get('_dd.p.ksr')}" + assert span["meta"].get("_dd.p.ksr") == expected_ksr, ( + f"Expected _dd.p.ksr='{expected_ksr}', got: {span['meta'].get('_dd.p.ksr')}" ) @pytest.mark.parametrize( From b6aca8e4200e7ddfc3e978ec92f042f6b45f0810 Mon Sep 17 00:00:00 2001 From: bm1549 Date: Mon, 23 Mar 2026 20:17:19 -0400 Subject: [PATCH 04/10] Mark test_sampling_knuth_sample_rate_trace_sampling_rule as bug for nodejs, python, ruby Bug: APMAPI-1869 Co-Authored-By: Claude Opus 4.6 (1M context) --- manifests/nodejs.yml | 1 + manifests/python.yml | 1 + manifests/ruby.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/manifests/nodejs.yml b/manifests/nodejs.yml index e0ab7429e35..b63b49184c3 100644 --- a/manifests/nodejs.yml +++ b/manifests/nodejs.yml @@ -2057,6 +2057,7 @@ manifest: tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: bug (APMAPI-1720) # Manual keep did not override the upstream drop decision tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=5.90.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_defaults_rate_1_and_rate_limit_0_sst008: bug (APMAPI-737) diff --git a/manifests/python.yml b/manifests/python.yml index dc0d16949fb..0a8e100f1c1 100644 --- a/manifests/python.yml +++ b/manifests/python.yml @@ -1726,6 +1726,7 @@ manifest: tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v3.15.0+dev36.gb57f15308 tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.8.0 tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: v3.14.0.dev + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags: v2.8.0 tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 4d4287590fd..35bb1040bd3 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -1496,6 +1496,7 @@ manifest: tests/parametric/test_process_discovery.py::Test_ProcessDiscovery::test_metadata_content_with_process_tags: missing_feature (Not yet implemented) tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.4.0 tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.30.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) From ea36904d908574f934c0b75ed2b6d55b27889a0e Mon Sep 17 00:00:00 2001 From: bm1549 Date: Mon, 23 Mar 2026 20:26:20 -0400 Subject: [PATCH 05/10] PHP: activate all _dd.p.ksr tests, version-gate to >=1.17.0 Remove per-sub-test missing_feature exclusions for PHP and add a class-level version gate since branch override support ships in 1.17.0. Co-Authored-By: Claude Opus 4.6 (1M context) --- manifests/php.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/php.yml b/manifests/php.yml index 8b7709a6bd6..a24b035db98 100644 --- a/manifests/php.yml +++ b/manifests/php.yml @@ -800,12 +800,11 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_under_limit_one_payload: '>=1.16.0' tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v1.13.0+4663b2fa7c20c6920f347d059b57dc2a419cb7f7 + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=1.17.0' ? tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_extract_knuth_sample_rate_distributed_tracing_datadog : '>=1.16.0' ? tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_extract_knuth_sample_rate_distributed_tracing_tracecontext : '>=1.16.0' - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_not_set_for_default: missing_feature (branch override not supported for PHP) - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: missing_feature (branch override not supported for PHP) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) From 59d890106092d96c3955336f6f83a0f6b149a78f Mon Sep 17 00:00:00 2001 From: bm1549 Date: Tue, 24 Mar 2026 10:46:09 -0400 Subject: [PATCH 06/10] fix(parametric): use 0.00000051 for ksr rounding-up test case 0.0000005 is a V8 toFixed edge case that some tracers may legitimately round down. 0.00000051 is unambiguously above the halfway point, so all tracer implementations should round it up to 0.000001 consistently. Co-Authored-By: Claude Sonnet 4.6 --- tests/parametric/test_sampling_span_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parametric/test_sampling_span_tags.py b/tests/parametric/test_sampling_span_tags.py index ca1c2bb9d75..526ac16d48c 100644 --- a/tests/parametric/test_sampling_span_tags.py +++ b/tests/parametric/test_sampling_span_tags.py @@ -297,7 +297,7 @@ class Test_Knuth_Sample_Rate: ( { "DD_TRACE_SAMPLE_RATE": None, - "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.0000005}]', + "DD_TRACE_SAMPLING_RULES": '[{"sample_rate":0.00000051}]', }, "0.000001", ), From 3708667bb05f033804e911171e333748efeb7b32 Mon Sep 17 00:00:00 2001 From: bm1549 Date: Tue, 24 Mar 2026 16:25:37 -0400 Subject: [PATCH 07/10] chore: empty commit to trigger CI From 6d51d7b32d0315c7106ba1962a6cad8a0f93923e Mon Sep 17 00:00:00 2001 From: bm1549 Date: Tue, 24 Mar 2026 16:26:29 -0400 Subject: [PATCH 08/10] chore: empty commit to trigger CI From 82b1d47bf587d884c48df3c596854422a5fd0665 Mon Sep 17 00:00:00 2001 From: bm1549 Date: Wed, 25 Mar 2026 18:44:41 -0400 Subject: [PATCH 09/10] Update Test_Knuth_Sample_Rate manifests to next minor versions Set activation versions to the next unreleased minor for each tracer: - Node.js: >=5.93.0 (was >=5.90.0) - Python: v4.7.0 (was v3.14.0.dev) - Go: >=2.8.0 (was >=2.9.0) - Ruby: >=2.31.0 (was >=2.30.0) - PHP: >=1.18.0 (was >=1.17.0) - .NET: >=3.41.0 (was >=3.40.0) - Rust: >=0.4.0 (was >=0.1.0) Co-Authored-By: Claude Opus 4.6 (1M context) --- manifests/dotnet.yml | 2 +- manifests/golang.yml | 2 +- manifests/nodejs.yml | 2 +- manifests/php.yml | 2 +- manifests/python.yml | 2 +- manifests/ruby.yml | 2 +- manifests/rust.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/dotnet.yml b/manifests/dotnet.yml index 1cdc01664f5..f2f6bea71ae 100644 --- a/manifests/dotnet.yml +++ b/manifests/dotnet.yml @@ -959,7 +959,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_one_span_default: missing_feature (partial flushing not enabled by default) tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: '>=3.36.0' # Modified by easy win activation script tests/parametric/test_process_discovery.py::Test_ProcessDiscovery::test_metadata_content_with_process_tags: missing_feature # Created by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=3.40.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=3.41.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/golang.yml b/manifests/golang.yml index 1c8faad680e..b0897e9374c 100644 --- a/manifests/golang.yml +++ b/manifests/golang.yml @@ -1151,7 +1151,7 @@ manifest: tests/parametric/test_parametric_endpoints.py::Test_Parametric_Write_Log::test_write_log: incomplete_test_app (Logs endpoint is only implemented in python and node.js app) tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_one_span_default: missing_feature (partial flushing not enabled by default) tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v2.2.3 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.9.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.8.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737) diff --git a/manifests/nodejs.yml b/manifests/nodejs.yml index b63b49184c3..f4fc2d173e1 100644 --- a/manifests/nodejs.yml +++ b/manifests/nodejs.yml @@ -2056,7 +2056,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing: bug (APMLP-270) tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: bug (APMAPI-1720) # Manual keep did not override the upstream drop decision - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=5.90.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=5.93.0' tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) diff --git a/manifests/php.yml b/manifests/php.yml index a24b035db98..f5200d532b6 100644 --- a/manifests/php.yml +++ b/manifests/php.yml @@ -800,7 +800,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing::test_partial_flushing_under_limit_one_payload: '>=1.16.0' tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v1.13.0+4663b2fa7c20c6920f347d059b57dc2a419cb7f7 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=1.17.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=1.18.0' ? tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_extract_knuth_sample_rate_distributed_tracing_datadog : '>=1.16.0' ? tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_extract_knuth_sample_rate_distributed_tracing_tracecontext diff --git a/manifests/python.yml b/manifests/python.yml index 0a8e100f1c1..9e7905c9e46 100644 --- a/manifests/python.yml +++ b/manifests/python.yml @@ -1725,7 +1725,7 @@ manifest: tests/parametric/test_partial_flushing.py::Test_Partial_Flushing: flaky (APMAPI-734) tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v3.15.0+dev36.gb57f15308 tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.8.0 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: v3.14.0.dev + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: v4.7.0 tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags: v2.8.0 tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 35bb1040bd3..d41a2620e21 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -1495,7 +1495,7 @@ manifest: tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v2.18.0 tests/parametric/test_process_discovery.py::Test_ProcessDiscovery::test_metadata_content_with_process_tags: missing_feature (Not yet implemented) tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.4.0 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.30.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.31.0' tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) diff --git a/manifests/rust.yml b/manifests/rust.yml index 6e758c31160..617fcf68818 100644 --- a/manifests/rust.yml +++ b/manifests/rust.yml @@ -237,7 +237,7 @@ manifest: tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: missing_feature tests/parametric/test_sampling_span_tags.py: '>=0.2.1' # Modified by easy win activation script - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=0.1.0' + tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=0.4.0' tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags: missing_feature # Created by easy win activation script tests/parametric/test_span_events.py: missing_feature tests/parametric/test_span_links.py::Test_Span_Links: missing_feature From cfefb8367065dabcfc41b1a02ba6e30f09866b94 Mon Sep 17 00:00:00 2001 From: bm1549 Date: Wed, 25 Mar 2026 18:46:16 -0400 Subject: [PATCH 10/10] Remove bug (APMAPI-1869) exclusions from KSR manifests Remove test_sampling_knuth_sample_rate_trace_sampling_rule bug exclusions from nodejs, python, and ruby manifests. Co-Authored-By: Claude Opus 4.6 (1M context) --- manifests/nodejs.yml | 1 - manifests/python.yml | 1 - manifests/ruby.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/manifests/nodejs.yml b/manifests/nodejs.yml index f4fc2d173e1..91fb225e930 100644 --- a/manifests/nodejs.yml +++ b/manifests/nodejs.yml @@ -2057,7 +2057,6 @@ manifest: tests/parametric/test_process_discovery.py: missing_feature tests/parametric/test_sampling_manual.py::Test_Manual_Sampling: bug (APMAPI-1720) # Manual keep did not override the upstream drop decision tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=5.93.0' - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_defaults_rate_1_and_rate_limit_0_sst008: bug (APMAPI-737) diff --git a/manifests/python.yml b/manifests/python.yml index 9e7905c9e46..c5f336475eb 100644 --- a/manifests/python.yml +++ b/manifests/python.yml @@ -1726,7 +1726,6 @@ manifest: tests/parametric/test_process_discovery.py::Test_ProcessDiscovery: v3.15.0+dev36.gb57f15308 tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.8.0 tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: v4.7.0 - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags: v2.8.0 tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index d41a2620e21..4005656d2bf 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -1496,7 +1496,6 @@ manifest: tests/parametric/test_process_discovery.py::Test_ProcessDiscovery::test_metadata_content_with_process_tags: missing_feature (Not yet implemented) tests/parametric/test_sampling_delegation.py::Test_Decisionless_Extraction: v2.4.0 tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate: '>=2.31.0' - tests/parametric/test_sampling_span_tags.py::Test_Knuth_Sample_Rate::test_sampling_knuth_sample_rate_trace_sampling_rule: bug (APMAPI-1869) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_appsec_enabled_sst011: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_dropped_sst001: bug (APMAPI-737) tests/parametric/test_sampling_span_tags.py::Test_Sampling_Span_Tags::test_tags_child_kept_sst007: bug (APMAPI-737)