Skip to content

Commit a2a93bc

Browse files
mhliddsarahchen6
authored andcommitted
Re-enable Java Telemetry Tests w/ New Telemetry Normalization (#6511)
1 parent 21b15d4 commit a2a93bc

4 files changed

Lines changed: 38 additions & 32 deletions

File tree

manifests/java.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,9 +1618,7 @@ manifest:
16181618
ratpack: missing_feature (endpoint not implemented)
16191619
vertx3: missing_feature (endpoint not implemented)
16201620
vertx4: missing_feature (endpoint not implemented)
1621-
tests/appsec/test_asm_standalone.py::Test_SCAStandalone_Telemetry_V2::test_telemetry_sca_enabled_propagated:
1622-
- declaration: missing_feature (Temporarily disabling until Java PR is merged https://github.com/DataDog/dd-trace-java/pull/10823)
1623-
component_version: '>=1.60.1'
1621+
tests/appsec/test_asm_standalone.py::Test_SCAStandalone_Telemetry_V2::test_telemetry_sca_enabled_propagated: v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
16241622
tests/appsec/test_asm_standalone.py::Test_UserEventsStandalone_Automated:
16251623
- weblog_declaration:
16261624
"*": v1.45.0
@@ -3018,9 +3016,7 @@ manifest:
30183016
tests/docker_ssi/test_docker_ssi.py::TestDockerSSIFeatures::test_instrumentation_source_ssi:
30193017
- declaration: missing_feature (Not implemented yet)
30203018
component_version: <1.52.0
3021-
tests/docker_ssi/test_docker_ssi_appsec.py::TestDockerSSIAppsecFeatures::test_telemetry_source_ssi:
3022-
- declaration: missing_feature (Temporarily disabling until Java PR is merged https://github.com/DataDog/dd-trace-java/pull/10823)
3023-
component_version: '>=1.60.1'
3019+
tests/docker_ssi/test_docker_ssi_appsec.py::TestDockerSSIAppsecFeatures::test_telemetry_source_ssi: 1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
30243020
tests/docker_ssi/test_docker_ssi_crash.py::TestDockerSSICrash::test_crash: missing_feature (No implemented the endpoint /crashme)
30253021
tests/ffe/test_dynamic_evaluation.py:
30263022
- weblog_declaration:
@@ -3667,22 +3663,18 @@ manifest:
36673663
- component_version: ">=1.57.0"
36683664
declaration: flaky (APMAPI-1785)
36693665
tests/parametric/test_telemetry.py::Test_Consistent_Configs: missing_feature
3670-
tests/parametric/test_telemetry.py::Test_Defaults: '>=1.31.0 <1.60.1' # temporarily disabling until Java PR is merged (https://github.com/DataDog/dd-trace-java/pull/10823)
3671-
tests/parametric/test_telemetry.py::Test_Environment: '>=1.31.0 <1.60.1' # temporarily disabling until Java PR is merged (https://github.com/DataDog/dd-trace-java/pull/10823)
3666+
tests/parametric/test_telemetry.py::Test_Defaults: v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
3667+
tests/parametric/test_telemetry.py::Test_Environment: v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
36723668
tests/parametric/test_telemetry.py::Test_Environment::test_telemetry_otel_env_hiding: missing_feature (Not implemented)
36733669
tests/parametric/test_telemetry.py::Test_Environment::test_telemetry_otel_env_invalid: missing_feature (Not implemented)
3674-
tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin: '>=1.47.0-SNAPSHOT <1.60.1'
3675-
tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin::test_stable_configuration_config_id:
3676-
- declaration: missing_feature (Not implemented)
3677-
component_version: <=1.53.0-SNAPSHOT
3678-
- declaration: missing_feature (Temporarily disabling until Java PR is merged https://github.com/DataDog/dd-trace-java/pull/10823)
3679-
component_version: '>=1.60.1'
3670+
tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin: 1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
3671+
tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin::test_stable_configuration_config_id: 1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
36803672
? tests/parametric/test_telemetry.py::Test_Stable_Configuration_Origin::test_stable_configuration_origin_extended_configs_temporary_use_case
36813673
: irrelevant (temporary use case for python, ruby and nodejs)
36823674
tests/parametric/test_telemetry.py::Test_TelemetryInstallSignature: v1.27.0
3683-
tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar: '>=1.34.0 <1.60.1' # temporarily disabling until Java PR is merged (https://github.com/DataDog/dd-trace-java/pull/10823)
3675+
tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar: v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
36843676
tests/parametric/test_telemetry.py::Test_TelemetrySCAEnvVar::test_telemetry_sca_enabled_propagated_specifics: irrelevant
3685-
tests/parametric/test_telemetry.py::Test_TelemetrySSIConfigs: '>=1.51.0 <1.60.1' # temporarily disabling until Java PR is merged (https://github.com/DataDog/dd-trace-java/pull/10823)
3677+
tests/parametric/test_telemetry.py::Test_TelemetrySSIConfigs: v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
36863678
tests/parametric/test_trace_sampling.py::Test_Trace_Sampling_Basic: v0.111.0
36873679
tests/parametric/test_trace_sampling.py::Test_Trace_Sampling_Globs: v1.25.1
36883680
tests/parametric/test_trace_sampling.py::Test_Trace_Sampling_Globs_Feb2024_Revision: v1.30.0
@@ -4223,9 +4215,8 @@ manifest:
42234215
tests/test_telemetry.py::Test_Telemetry::test_app_product_change: missing_feature (Weblog GET/enable_product and app-product-change event is not implemented yet.)
42244216
tests/test_telemetry.py::Test_Telemetry::test_app_started_client_configuration: # Created by easy win activation script
42254217
- weblog_declaration:
4218+
"*": v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
42264219
spring-boot-3-native: missing_feature (GraalVM. Tracing support only)
4227-
- declaration: missing_feature (Temporarily disabling until Java PR is merged https://github.com/DataDog/dd-trace-java/pull/10823)
4228-
component_version: '>=1.60.1'
42294220
tests/test_telemetry.py::Test_Telemetry::test_app_started_is_first_message: # Created by easy win activation script
42304221
- weblog_declaration:
42314222
spring-boot-3-native: missing_feature (GraalVM. Tracing support only)
@@ -4247,10 +4238,8 @@ manifest:
42474238
- weblog_declaration:
42484239
spring-boot-3-native: missing_feature (GraalVM. Tracing support only)
42494240
tests/test_telemetry.py::Test_TelemetryEnhancedConfigReporting:
4250-
- declaration: missing_feature (Temporarily disabling until Java PR is merged https://github.com/DataDog/dd-trace-java/pull/10823)
4251-
component_version: '>=1.60.1'
42524241
- weblog_declaration:
4253-
"*": v1.54.0-SNAPSHOT
4242+
"*": v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
42544243
spring-boot-3-native: missing_feature (GraalVM. Tracing support only)
42554244
tests/test_telemetry.py::Test_TelemetrySCAEnvVar: missing_feature
42564245
tests/test_telemetry.py::Test_TelemetryV2: v1.23.0

tests/parametric/test_telemetry.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@
1616

1717

1818
telemetry_name_mapping: dict[str, dict[str, str | list[str]]] = {
19+
"instrumentation_source": {
20+
"java": "DD_INSTRUMENTATION_SOURCE",
21+
},
1922
"ssi_injection_enabled": {
2023
"python": "DD_INJECTION_ENABLED",
21-
"java": "injection_enabled",
24+
"java": "DD_INJECTION_ENABLED",
2225
"ruby": "DD_INJECTION_ENABLED",
2326
"golang": ["DD_INJECTION_ENABLED", "injection_enabled"],
2427
},
2528
"ssi_forced_injection_enabled": {
2629
"python": "DD_INJECT_FORCE",
2730
"ruby": "DD_INJECT_FORCE",
28-
"java": "inject_force",
31+
"java": "DD_INJECT_FORCE",
2932
"golang": ["DD_INJECT_FORCE", "inject_force"],
3033
},
3134
"trace_sample_rate": {
3235
"dotnet": "DD_TRACE_SAMPLE_RATE",
36+
"java": "DD_TRACE_SAMPLE_RATE",
3337
"nodejs": "DD_TRACE_SAMPLE_RATE",
3438
"python": "DD_TRACE_SAMPLE_RATE",
3539
"ruby": "DD_TRACE_SAMPLE_RATE",
@@ -42,16 +46,25 @@
4246
"php": "trace.logs_enabled",
4347
"ruby": "tracing.log_injection",
4448
"golang": ["DD_LOGS_INJECTION", "trace.logs_enabled"],
49+
"java": "DD_LOGS_INJECTION_ENABLED",
4550
},
4651
"trace_header_tags": {
4752
"dotnet": "DD_TRACE_HEADER_TAGS",
4853
"nodejs": "DD_TRACE_HEADER_TAGS",
4954
"python": "DD_TRACE_HEADER_TAGS",
5055
"golang": ["DD_TRACE_HEADER_TAGS", "trace_header_tags"],
56+
"java": "DD_TRACE_HEADER_TAGS",
57+
},
58+
"trace_tags": {
59+
"dotnet": "DD_TAGS",
60+
"java": "DD_TRACE_TAGS",
61+
"nodejs": "DD_TAGS",
62+
"python": "DD_TAGS",
63+
"golang": ["DD_TAGS", "trace_tags"],
5164
},
52-
"trace_tags": {"dotnet": "DD_TAGS", "nodejs": "DD_TAGS", "python": "DD_TAGS", "golang": ["DD_TAGS", "trace_tags"]},
5365
"trace_enabled": {
5466
"dotnet": "DD_TRACE_ENABLED",
67+
"java": "DD_TRACE_ENABLED",
5568
"nodejs": "tracing",
5669
"python": "DD_TRACE_ENABLED",
5770
"ruby": "tracing.enabled",
@@ -63,28 +76,33 @@
6376
"python": "DD_PROFILING_ENABLED",
6477
"ruby": "profiling.enabled",
6578
"golang": ["DD_PROFILING_ENABLED", "profiling_enabled"],
79+
"java": "DD_PROFILING_ENABLED",
6680
},
6781
"appsec_enabled": {
6882
"dotnet": "DD_APPSEC_ENABLED",
6983
"nodejs": "appsec.enabled",
7084
"python": "DD_APPSEC_ENABLED",
7185
"ruby": "appsec.enabled",
7286
"golang": ["DD_APPSEC_ENABLED", "appsec_enabled"],
87+
"java": "DD_APPSEC_ENABLED",
7388
},
7489
"data_streams_enabled": {
7590
"dotnet": "DD_DATA_STREAMS_ENABLED",
7691
"nodejs": "dsmEnabled",
7792
"python": "DD_DATA_STREAMS_ENABLED",
93+
"java": "DD_DATA_STREAMS_ENABLED",
7894
"golang": ["DD_DATA_STREAMS_ENABLED", "data_streams_enabled"],
7995
},
8096
"runtime_metrics_enabled": {
97+
"java": "DD_RUNTIME_METRICS_ENABLED",
8198
"dotnet": "DD_RUNTIME_METRICS_ENABLED",
8299
"nodejs": "runtime.metrics.enabled",
83100
"python": "DD_RUNTIME_METRICS_ENABLED",
84101
"ruby": "runtime_metrics_enabled",
85102
"golang": ["DD_RUNTIME_METRICS_ENABLED", "runtime_metrics_enabled"],
86103
},
87104
"dynamic_instrumentation_enabled": {
105+
"java": "DD_DYNAMIC_INSTRUMENTATION_ENABLED",
88106
"dotnet": "DD_DYNAMIC_INSTRUMENTATION_ENABLED",
89107
"nodejs": "dynamicInstrumentation.enabled",
90108
"python": "DD_DYNAMIC_INSTRUMENTATION_ENABLED",
@@ -94,19 +112,20 @@
94112
},
95113
"trace_debug_enabled": {
96114
"php": "trace.debug",
97-
"java": "trace_debug",
115+
"java": "DD_TRACE_DEBUG",
98116
"ruby": "DD_TRACE_DEBUG",
99117
"python": "DD_TRACE_DEBUG",
100118
"golang": ["trace_debug_enabled", "DD_TRACE_DEBUG"],
101119
},
102120
"tags": {
103-
"java": "trace_tags",
121+
"java": "DD_TRACE_TAGS",
104122
"dotnet": "DD_TAGS",
105123
"python": "DD_TAGS",
106124
"nodejs": "DD_TAGS",
107125
"golang": ["DD_TAGS", "trace_tags"],
108126
},
109127
"trace_propagation_style": {
128+
"java": "DD_TRACE_PROPAGATION_STYLE",
110129
"dotnet": "DD_TRACE_PROPAGATION_STYLE",
111130
"php": "trace.propagation_style",
112131
"golang": ["DD_TRACE_PROPAGATION_STYLE", "trace.propagation_style"],

tests/test_telemetry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def test_app_started_client_configuration(self):
461461
"python": {},
462462
"cpp_nginx": {"trace_agent_port": trace_agent_port},
463463
"cpp_httpd": {"trace_agent_port": trace_agent_port},
464-
"java": {"trace_agent_port": trace_agent_port, "telemetry_heartbeat_interval": 2},
464+
"java": {"DD_TRACE_AGENT_PORT": trace_agent_port, "DD_TELEMETRY_HEARTBEAT_INTERVAL": 2},
465465
"ruby": {"DD_AGENT_TRANSPORT": "TCP"},
466466
"golang": {"lambda_mode": False},
467467
}
@@ -489,7 +489,7 @@ def validator(data: dict):
489489
if cnf.get("name") == config_name_to_check:
490490
config_value = cnf.get("value")
491491
# Accept both the expected value and its float version for telemetry_heartbeat_interval
492-
if expected_config_name == "telemetry_heartbeat_interval":
492+
if expected_config_name == "DD_TELEMETRY_HEARTBEAT_INTERVAL":
493493
try:
494494
expected_float = float(expected_value)
495495
config_float = float(config_value)
@@ -589,7 +589,7 @@ class Test_TelemetryEnhancedConfigReporting:
589589
],
590590
},
591591
"java": {
592-
"name": "logs_injection_enabled",
592+
"name": "DD_LOGS_INJECTION_ENABLED",
593593
"precedence": [
594594
{"origin": "default", "value": "true"},
595595
{

utils/telemetry_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ def get_loaded_dependency(library: str) -> dict[str, bool]:
1919
@staticmethod
2020
def get_dd_appsec_sca_enabled_str(library: ComponentVersion) -> str:
2121
result = "DD_APPSEC_SCA_ENABLED"
22-
if library == "java":
23-
result = "appsec_sca_enabled"
24-
elif library == "nodejs":
22+
if library == "nodejs":
2523
result = "appsec.sca.enabled"
2624
elif library in ("php", "ruby"):
2725
result = "appsec.sca_enabled"

0 commit comments

Comments
 (0)