From 02e7632d4abaad2e7a21e9619e9a50888e032e3d Mon Sep 17 00:00:00 2001 From: Victor Pellan Date: Thu, 19 Mar 2026 15:00:32 +0100 Subject: [PATCH 1/2] Change telemetry keys to env vars and temporarily disable related tests --- manifests/ruby.yml | 6 ++--- tests/parametric/test_telemetry.py | 36 +++++++++++------------------- utils/telemetry_utils.py | 2 +- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 8b66aeb8b74..3ce450c1853 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -382,7 +382,7 @@ manifest: tests/appsec/test_asm_standalone.py::Test_AppSecStandalone_NotEnabled: v2.13.0 tests/appsec/test_asm_standalone.py::Test_AppSecStandalone_UpstreamPropagation_V2: v2.13.0 tests/appsec/test_asm_standalone.py::Test_IastStandalone_UpstreamPropagation_V2: missing_feature - tests/appsec/test_asm_standalone.py::Test_SCAStandalone_Telemetry_V2: v2.13.0 + tests/appsec/test_asm_standalone.py::Test_SCAStandalone_Telemetry_V2: missing_feature (Temporarily disabled to move to environment variables as telemetry keys) tests/appsec/test_asm_standalone.py::Test_UserEventsStandalone_Automated: - weblog_declaration: "*": v2.20.0-dev @@ -1534,12 +1534,12 @@ manifest: tests/parametric/test_telemetry.py::Test_Environment: missing_feature tests/parametric/test_telemetry.py::Test_Environment::test_telemetry_otel_env_hiding: missing_feature (Not implemented) tests/parametric/test_telemetry.py::Test_Environment::test_telemetry_otel_env_invalid: missing_feature (Not implemented) - tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin: v2.18.0 + tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin: missing_feature (Temporarily disabled to move to environment variables as telemetry keys) ? tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin::test_stable_configuration_origin_extended_configs_good_use_case : bug (APMAPI-1631) tests/parametric/test_telemetry.py::Test_TelemetryInstallSignature: '>=2.27.0' # Modified by easy win activation script tests/parametric/test_telemetry.py::Test_TelemetryInstallSignature::test_telemetry_event_not_propagated: missing_feature # Created by easy win activation script - tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar: v2.1.0 + tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar: missing_feature (Temporarily disabled to move to environment variables as telemetry keys) tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar::test_telemetry_sca_enabled_propagated_specifics: irrelevant tests/parametric/test_telemetry.py::Test_TelemetrySSIConfigs: v2.18.0 tests/parametric/test_trace_sampling.py::Test_Trace_Sampling_Basic: v1.0.0 # TODO what is the earliest version? diff --git a/tests/parametric/test_telemetry.py b/tests/parametric/test_telemetry.py index 376af21ec56..8c3537d997e 100644 --- a/tests/parametric/test_telemetry.py +++ b/tests/parametric/test_telemetry.py @@ -44,7 +44,7 @@ "nodejs": "DD_LOG_INJECTION", # TODO: rename to DD_LOGS_INJECTION in subsequent PR "python": "DD_LOGS_INJECTION", "php": "trace.logs_enabled", - "ruby": "tracing.log_injection", + "ruby": "DD_LOGS_INJECTION", "golang": ["DD_LOGS_INJECTION", "trace.logs_enabled"], "java": "DD_LOGS_INJECTION_ENABLED", }, @@ -54,6 +54,7 @@ "python": "DD_TRACE_HEADER_TAGS", "golang": ["DD_TRACE_HEADER_TAGS", "trace_header_tags"], "java": "DD_TRACE_HEADER_TAGS", + "ruby": "DD_TRACE_HEADER_TAGS", }, "trace_tags": { "dotnet": "DD_TAGS", @@ -61,20 +62,21 @@ "nodejs": "DD_TAGS", "python": "DD_TAGS", "golang": ["DD_TAGS", "trace_tags"], + "ruby": "DD_TAGS", }, "trace_enabled": { "dotnet": "DD_TRACE_ENABLED", "java": "DD_TRACE_ENABLED", "nodejs": "tracing", "python": "DD_TRACE_ENABLED", - "ruby": "tracing.enabled", + "ruby": "DD_TRACE_ENABLED", "golang": ["DD_TRACE_ENABLED", "trace_enabled"], }, "profiling_enabled": { "dotnet": "DD_PROFILING_ENABLED", "nodejs": "profiling.enabled", "python": "DD_PROFILING_ENABLED", - "ruby": "profiling.enabled", + "ruby": "DD_PROFILING_ENABLED", "golang": ["DD_PROFILING_ENABLED", "profiling_enabled"], "java": "DD_PROFILING_ENABLED", }, @@ -82,7 +84,7 @@ "dotnet": "DD_APPSEC_ENABLED", "nodejs": "appsec.enabled", "python": "DD_APPSEC_ENABLED", - "ruby": "appsec.enabled", + "ruby": "DD_APPSEC_ENABLED", "golang": ["DD_APPSEC_ENABLED", "appsec_enabled"], "java": "DD_APPSEC_ENABLED", }, @@ -92,13 +94,14 @@ "python": "DD_DATA_STREAMS_ENABLED", "java": "DD_DATA_STREAMS_ENABLED", "golang": ["DD_DATA_STREAMS_ENABLED", "data_streams_enabled"], + "ruby": "DD_DATA_STREAMS_ENABLED", }, "runtime_metrics_enabled": { "java": "DD_RUNTIME_METRICS_ENABLED", "dotnet": "DD_RUNTIME_METRICS_ENABLED", "nodejs": "runtime.metrics.enabled", "python": "DD_RUNTIME_METRICS_ENABLED", - "ruby": "runtime_metrics_enabled", + "ruby": "DD_RUNTIME_METRICS_ENABLED", "golang": ["DD_RUNTIME_METRICS_ENABLED", "runtime_metrics_enabled"], }, "dynamic_instrumentation_enabled": { @@ -107,7 +110,7 @@ "nodejs": "dynamicInstrumentation.enabled", "python": "DD_DYNAMIC_INSTRUMENTATION_ENABLED", "php": "dynamic_instrumentation.enabled", - "ruby": "dynamic_instrumentation.enabled", + "ruby": "DD_DYNAMIC_INSTRUMENTATION_ENABLED", "golang": ["DD_DYNAMIC_INSTRUMENTATION_ENABLED", "dynamic_instrumentation_enabled"], }, "trace_debug_enabled": { @@ -123,12 +126,14 @@ "python": "DD_TAGS", "nodejs": "DD_TAGS", "golang": ["DD_TAGS", "trace_tags"], + "ruby": "DD_TAGS", }, "trace_propagation_style": { "java": "DD_TRACE_PROPAGATION_STYLE", "dotnet": "DD_TRACE_PROPAGATION_STYLE", "php": "trace.propagation_style", "golang": ["DD_TRACE_PROPAGATION_STYLE", "trace.propagation_style"], + "ruby": "DD_TRACE_PROPAGATION_STYLE", }, } @@ -144,18 +149,6 @@ def _mapped_telemetry_name(apm_telemetry_name: str) -> list[str]: return [apm_telemetry_name] -def _find_configuration_by_origin(config_list: list[dict], origin: str) -> dict | None: - """Find a configuration by origin from a list of configuration dictionaries. - - Returns the first configuration that matches the origin, - or None if no match is found. - """ - for config in config_list: - if config.get("origin") == origin: - return config - return None - - def _check_propagation_style_with_inject_and_extract( test_agent: TestAgentAPI, configuration_by_name: dict, expected_origin: str, library_name: str ) -> None: @@ -168,12 +161,9 @@ def _check_propagation_style_with_inject_and_extract( Raises an AssertionError if either key is missing, has wrong origin, or has empty value """ # Define the inject and extract key names for each language - if library_name == "python": + if library_name in ("python", "ruby"): inject_key = "DD_TRACE_PROPAGATION_STYLE_INJECT" extract_key = "DD_TRACE_PROPAGATION_STYLE_EXTRACT" - elif library_name == "ruby": - inject_key = "tracing.propagation_style_inject" - extract_key = "tracing.propagation_style_extract" elif library_name == "nodejs": inject_key = "tracePropagationStyle.inject" extract_key = "tracePropagationStyle.extract" @@ -1251,7 +1241,7 @@ def test_telemetry_sca_enabled_not_propagated(self, test_agent: TestAgentAPI, te dd_appsec_sca_enabled = TelemetryUtils.get_dd_appsec_sca_enabled_str(context.library) - if context.library in ("java", "nodejs", "python"): + if context.library in ("java", "nodejs", "python", "ruby"): cfg_appsec_enabled = configuration_by_name.get(dd_appsec_sca_enabled) assert cfg_appsec_enabled is not None, f"Missing telemetry config item for '{dd_appsec_sca_enabled}'" assert cfg_appsec_enabled[0].get("value") is None diff --git a/utils/telemetry_utils.py b/utils/telemetry_utils.py index 2d633696b6e..033cddc723a 100644 --- a/utils/telemetry_utils.py +++ b/utils/telemetry_utils.py @@ -21,6 +21,6 @@ def get_dd_appsec_sca_enabled_str(library: ComponentVersion) -> str: result = "DD_APPSEC_SCA_ENABLED" if library == "nodejs": result = "appsec.sca.enabled" - elif library in ("php", "ruby"): + elif library == "php": result = "appsec.sca_enabled" return result From 7125c9b20f157897da4276b6786727297fb209af Mon Sep 17 00:00:00 2001 From: Victor Pellan Date: Thu, 19 Mar 2026 15:04:39 +0100 Subject: [PATCH 2/2] Re-enable telemetry tests --- manifests/ruby.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 3ce450c1853..c3d24e1ae9b 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -382,7 +382,7 @@ manifest: tests/appsec/test_asm_standalone.py::Test_AppSecStandalone_NotEnabled: v2.13.0 tests/appsec/test_asm_standalone.py::Test_AppSecStandalone_UpstreamPropagation_V2: v2.13.0 tests/appsec/test_asm_standalone.py::Test_IastStandalone_UpstreamPropagation_V2: missing_feature - tests/appsec/test_asm_standalone.py::Test_SCAStandalone_Telemetry_V2: missing_feature (Temporarily disabled to move to environment variables as telemetry keys) + tests/appsec/test_asm_standalone.py::Test_SCAStandalone_Telemetry_V2: v2.31.0-dev tests/appsec/test_asm_standalone.py::Test_UserEventsStandalone_Automated: - weblog_declaration: "*": v2.20.0-dev @@ -1534,12 +1534,12 @@ manifest: tests/parametric/test_telemetry.py::Test_Environment: missing_feature tests/parametric/test_telemetry.py::Test_Environment::test_telemetry_otel_env_hiding: missing_feature (Not implemented) tests/parametric/test_telemetry.py::Test_Environment::test_telemetry_otel_env_invalid: missing_feature (Not implemented) - tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin: missing_feature (Temporarily disabled to move to environment variables as telemetry keys) + tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin: v2.31.0-dev ? tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin::test_stable_configuration_origin_extended_configs_good_use_case : bug (APMAPI-1631) tests/parametric/test_telemetry.py::Test_TelemetryInstallSignature: '>=2.27.0' # Modified by easy win activation script tests/parametric/test_telemetry.py::Test_TelemetryInstallSignature::test_telemetry_event_not_propagated: missing_feature # Created by easy win activation script - tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar: missing_feature (Temporarily disabled to move to environment variables as telemetry keys) + tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar: v2.31.0-dev tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar::test_telemetry_sca_enabled_propagated_specifics: irrelevant tests/parametric/test_telemetry.py::Test_TelemetrySSIConfigs: v2.18.0 tests/parametric/test_trace_sampling.py::Test_Trace_Sampling_Basic: v1.0.0 # TODO what is the earliest version?