From 44bb4c5cb19ffa62bae79d5fff18b1d5474d6074 Mon Sep 17 00:00:00 2001 From: Brian Marks Date: Mon, 16 Dec 2024 19:27:01 -0500 Subject: [PATCH] Additional feature tag for adaptive sampling (#3648) --- tests/parametric/test_dynamic_configuration.py | 4 ++++ tests/parametric/test_trace_sampling.py | 7 +++++++ utils/_features.py | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/tests/parametric/test_dynamic_configuration.py b/tests/parametric/test_dynamic_configuration.py index c009287375..d13c2c6ad9 100644 --- a/tests/parametric/test_dynamic_configuration.py +++ b/tests/parametric/test_dynamic_configuration.py @@ -192,6 +192,7 @@ def reverse_case(s): @rfc("https://docs.google.com/document/d/1SVD0zbbAAXIsobbvvfAEXipEUO99R9RMsosftfe9jx0") @scenarios.parametric @features.dynamic_configuration +@features.adaptive_sampling class TestDynamicConfigV1: """Tests covering the v1 release of the dynamic configuration feature. @@ -338,6 +339,7 @@ def test_log_injection_enabled(self, library_env, test_agent, test_library): @rfc("https://docs.google.com/document/d/1SVD0zbbAAXIsobbvvfAEXipEUO99R9RMsosftfe9jx0") @scenarios.parametric @features.dynamic_configuration +@features.adaptive_sampling class TestDynamicConfigV1_ServiceTargets: """Tests covering the Service Target matching of the dynamic configuration feature. @@ -418,6 +420,7 @@ def test_match_service_target_case_insensitively(self, library_env, test_agent, @rfc("https://docs.google.com/document/d/1V4ZBsTsRPv8pAVG5WCmONvl33Hy3gWdsulkYsE4UZgU/edit") @scenarios.parametric @features.dynamic_configuration +@features.adaptive_sampling class TestDynamicConfigV2: @parametrize("library_env", [{**DEFAULT_ENVVARS}, {**DEFAULT_ENVVARS, "DD_TAGS": "key1:val1,key2:val2"}]) def test_tracing_client_tracing_tags(self, library_env, test_agent, test_library): @@ -476,6 +479,7 @@ def test_capability_tracing_custom_tags(self, library_env, test_agent, test_libr @scenarios.parametric @features.dynamic_configuration +@features.adaptive_sampling class TestDynamicConfigSamplingRules: @parametrize("library_env", [{**DEFAULT_ENVVARS}]) def test_capability_tracing_sample_rules(self, library_env, test_agent, test_library): diff --git a/tests/parametric/test_trace_sampling.py b/tests/parametric/test_trace_sampling.py index 6325594d95..7f632ce6d9 100644 --- a/tests/parametric/test_trace_sampling.py +++ b/tests/parametric/test_trace_sampling.py @@ -9,6 +9,7 @@ @features.trace_sampling +@features.adaptive_sampling @scenarios.parametric @rfc("https://docs.google.com/document/d/1HRbi1DrBjL_KGeONrPgH7lblgqSLGlV5Ox1p4RL97xM/") class Test_Trace_Sampling_Basic: @@ -102,6 +103,7 @@ def test_trace_kept_in_spite_trace_sampling_rule(self, test_agent, test_library) @features.trace_sampling +@features.adaptive_sampling @scenarios.parametric @rfc("https://docs.google.com/document/d/1S9pufnJjrsxH6pRbpigdYFwA5JjSdZ6iLZ-9E7PoAic/") class Test_Trace_Sampling_Globs: @@ -167,6 +169,7 @@ def test_trace_dropped_by_trace_sampling_rule(self, test_agent, test_library): @features.trace_sampling +@features.adaptive_sampling @scenarios.parametric @rfc("https://docs.google.com/document/d/1S9pufnJjrsxH6pRbpigdYFwA5JjSdZ6iLZ-9E7PoAic/") class Test_Trace_Sampling_Globs_Feb2024_Revision: @@ -212,6 +215,7 @@ def test_trace_sampled_by_trace_sampling_rule_insensitive_glob_match(self, test_ @features.trace_sampling +@features.adaptive_sampling @scenarios.parametric @rfc("https://docs.google.com/document/d/1S9pufnJjrsxH6pRbpigdYFwA5JjSdZ6iLZ-9E7PoAic/") class Test_Trace_Sampling_Resource: @@ -315,6 +319,7 @@ def test_trace_dropped_by_trace_sampling_rule(self, test_agent, test_library): @features.trace_sampling +@features.adaptive_sampling @scenarios.parametric @rfc("https://docs.google.com/document/d/1S9pufnJjrsxH6pRbpigdYFwA5JjSdZ6iLZ-9E7PoAic/") class Test_Trace_Sampling_Tags: @@ -418,6 +423,7 @@ def tag_sampling_env(tag_glob_pattern): @scenarios.parametric @rfc("https://docs.google.com/document/d/1S9pufnJjrsxH6pRbpigdYFwA5JjSdZ6iLZ-9E7PoAic/") @features.trace_sampling +@features.adaptive_sampling class Test_Trace_Sampling_Tags_Feb2024_Revision: def assert_matching_span(self, test_agent, trace_id, span_id, **kwargs): matching_span = find_span_in_traces(test_agent.wait_for_num_traces(1), trace_id, span_id) @@ -540,6 +546,7 @@ def test_metric_mismatch_non_integer(self, test_agent, test_library): @scenarios.parametric @rfc("https://docs.google.com/document/d/1S9pufnJjrsxH6pRbpigdYFwA5JjSdZ6iLZ-9E7PoAic/") @features.trace_sampling +@features.adaptive_sampling class Test_Trace_Sampling_With_W3C: @pytest.mark.parametrize( "library_env", diff --git a/utils/_features.py b/utils/_features.py index 4e2765244a..1e587b0dc9 100644 --- a/utils/_features.py +++ b/utils/_features.py @@ -2265,3 +2265,12 @@ def djm_ssi_k8s(test_object): """ pytest.mark.features(feature_id=342)(test_object) return test_object + + @staticmethod + def adaptive_sampling(test_object): + """Adaptive sampling rules + RC + + https://feature-parity.us1.prod.dog/#/?feature=346 + """ + pytest.mark.features(feature_id=346)(test_object) + return test_object