Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Khanayan123/add consistent config system tests #3745

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b0eea10
save changes
khanayan123 Dec 25, 2024
264a755
Add runtime metrics tests
cbeauchesne Dec 13, 2024
252ad46
Add basic deserialization
cbeauchesne Dec 19, 2024
c1d9118
add runtime metrics test
khanayan123 Dec 25, 2024
f53f99c
push changes
khanayan123 Dec 28, 2024
60d2872
fix redordering
khanayan123 Dec 28, 2024
72fd00a
update
khanayan123 Jan 2, 2025
b792106
update
khanayan123 Jan 2, 2025
41dd15a
update
khanayan123 Jan 2, 2025
efa3ef3
update php manifest
khanayan123 Jan 2, 2025
e871399
fix redordering
khanayan123 Jan 2, 2025
d963739
try
khanayan123 Jan 2, 2025
a4d445f
update test
khanayan123 Jan 2, 2025
6cf3b31
update manifest file
khanayan123 Jan 2, 2025
918fbbb
update logger
khanayan123 Jan 2, 2025
bb91710
lint
khanayan123 Jan 2, 2025
78b9e7b
update test
khanayan123 Jan 2, 2025
e954a94
enable 128 bit trace id tests
khanayan123 Jan 3, 2025
6a2057e
update
khanayan123 Jan 6, 2025
bf111d5
add new endpoint logs
khanayan123 Jan 6, 2025
dd4a9c6
format
khanayan123 Jan 6, 2025
3afd035
fix
khanayan123 Jan 6, 2025
7f51151
update implemented version
khanayan123 Jan 6, 2025
f5b4d41
update version
khanayan123 Jan 6, 2025
59c1a37
address feedback
khanayan123 Jan 9, 2025
3429244
refactor
khanayan123 Jan 9, 2025
9f484c5
run lint
khanayan123 Jan 9, 2025
54b89be
update annotations
khanayan123 Jan 9, 2025
2d42831
add jira ticket number
khanayan123 Jan 10, 2025
69a1e60
break apart test_w3c_128_bit_propagation_tid_in_chunk_root test
khanayan123 Jan 10, 2025
0eb65dd
run format
khanayan123 Jan 10, 2025
17b45bd
skip ruby
khanayan123 Jan 10, 2025
6945a62
address feedback
khanayan123 Jan 10, 2025
3d14959
run format
khanayan123 Jan 10, 2025
9ed1223
simplify
khanayan123 Jan 10, 2025
4c75e27
format
khanayan123 Jan 10, 2025
7d68776
add ipv6 tests, wait for generator
khanayan123 Jan 10, 2025
d2e0312
update node test app
khanayan123 Jan 10, 2025
75e4d32
run formatter
khanayan123 Jan 10, 2025
bda76a0
update to skip test for missing_features
khanayan123 Jan 10, 2025
9dfa2a3
run formatter
khanayan123 Jan 10, 2025
6e8f305
fix test app
khanayan123 Jan 10, 2025
c363d24
fix testapp
khanayan123 Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/weblog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,14 @@ Expected query parameters:
This endpoint loads a module/package in applicable languages. It's mainly used for telemetry tests to verify that
the `dependencies-loaded` event is appropriately triggered.

### GET /log/library

This endpoint facilitates logging a message using a logging library. It is primarily designed for testing log injection functionality. Weblog apps must log using JSON format.

The following query parameters are optional:
- `msg`: Specifies the message to be logged. If not provided, the default message "msg" will be logged.
- `level`: Specifies the log level to be used. If not provided, the default log level is "info".

### GET /e2e_single_span

This endpoint will create two spans, a parent span (which is a root-span), and a child span.
Expand Down
6 changes: 6 additions & 0 deletions manifests/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,14 @@ tests/:
Test_Config_HttpServerErrorStatuses_FeatureFlagCustom: missing_feature
Test_Config_IntegrationEnabled_False: missing_feature
Test_Config_IntegrationEnabled_True: missing_feature
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: missing_feature
Test_Config_ObfuscationQueryStringRegexp_Empty: missing_feature
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: missing_feature
Test_Config_UnifiedServiceTagging_Default: missing_feature
test_distributed.py:
Expand Down
6 changes: 6 additions & 0 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,14 @@ tests/:
Test_Config_HttpServerErrorStatuses_FeatureFlagCustom: v3.5.0
Test_Config_IntegrationEnabled_False: v3.5.0
Test_Config_IntegrationEnabled_True: v3.5.0
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: v3.4.1
Test_Config_ObfuscationQueryStringRegexp_Empty: v3.4.1
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: v3.3.0
Test_Config_UnifiedServiceTagging_Default: v3.3.0
test_data_integrity.py:
Expand Down
6 changes: 6 additions & 0 deletions manifests/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,14 @@ tests/:
uds-echo: missing_feature
Test_Config_IntegrationEnabled_False: irrelevant (not applicable to Go because of how they do auto instrumentation)
Test_Config_IntegrationEnabled_True: irrelevant (not applicable to Go because of how they do auto instrumentation)
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: v1.67.0
Test_Config_ObfuscationQueryStringRegexp_Empty: v1.67.0
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: v1.67.0
Test_Config_UnifiedServiceTagging_Default: v1.67.0
test_data_integrity.py:
Expand Down
6 changes: 6 additions & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1648,8 +1648,14 @@ tests/:
Test_Config_IntegrationEnabled_True:
'*': irrelevant (kafka endpoints are not implemented)
spring-boot: v1.42.0
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: v1.39.0
Test_Config_ObfuscationQueryStringRegexp_Empty: v1.39.0
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: v1.39.0
Test_Config_UnifiedServiceTagging_Default: v1.39.0
test_data_integrity.py:
Expand Down
25 changes: 21 additions & 4 deletions manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ tests/:
test_k8s_manual_inject.py:
TestAdmisionControllerProfiling: *ref_5_22_0
parametric/:
test_128_bit_traceids.py:
Test_128_Bit_Traceids: *ref_3_0_0
test_config_consistency.py:
Test_Config_Dogstatsd: *ref_5_29_0
Test_Config_RateLimit: *ref_5_25_0
Expand Down Expand Up @@ -848,14 +850,29 @@ tests/:
Test_Config_HttpServerErrorStatuses_FeatureFlagCustom: missing_feature
Test_Config_IntegrationEnabled_False:
'*': *ref_5_25_0
express4-typescript: irrelevant
nextjs: irrelevant # nextjs is not related with kafka
express4-typescript: incomplete_test_app
nextjs: incomplete_test_app
Test_Config_IntegrationEnabled_True:
'*': *ref_5_25_0
express4-typescript: irrelevant
nextjs: irrelevant # nextjs is not related with kafka
express4-typescript: incomplete_test_app
nextjs: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Default: missing_feature
Test_Config_LogInjection_128Bit_TradeId_Disabled:
'*': *ref_3_15_0
express4-typescript: incomplete_test_app
nextjs: incomplete_test_app
Test_Config_LogInjection_Default:
'*': *ref_3_0_0
express4-typescript: incomplete_test_app
nextjs: incomplete_test_app
Test_Config_LogInjection_Enabled:
'*': *ref_3_0_0
express4-typescript: incomplete_test_app
nextjs: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: *ref_3_0_0
Test_Config_ObfuscationQueryStringRegexp_Empty: *ref_3_0_0
Test_Config_RuntimeMetrics_Default: *ref_3_0_0
Test_Config_RuntimeMetrics_Enabled: *ref_3_0_0
Test_Config_UnifiedServiceTagging_CustomService: *ref_5_25_0
Test_Config_UnifiedServiceTagging_Default: *ref_5_25_0
test_distributed.py:
Expand Down
6 changes: 6 additions & 0 deletions manifests/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,14 @@ tests/:
Test_Config_HttpServerErrorStatuses_FeatureFlagCustom: missing_feature
Test_Config_IntegrationEnabled_False: v1.4.0
Test_Config_IntegrationEnabled_True: v1.4.0
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: v1.5.0
Test_Config_ObfuscationQueryStringRegexp_Empty: v1.5.0
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: v1.4.0
Test_Config_UnifiedServiceTagging_Default: v1.4.0
test_distributed.py:
Expand Down
6 changes: 6 additions & 0 deletions manifests/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,14 @@ tests/:
Test_Config_IntegrationEnabled_True:
'*': irrelevant (kafka endpoint is not implemented)
flask-poc: v2.0.0
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: v2.0.0
Test_Config_ObfuscationQueryStringRegexp_Empty: v2.15.0
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: v2.0.0
Test_Config_UnifiedServiceTagging_Default: v2.0.0
test_data_integrity.py:
Expand Down
6 changes: 6 additions & 0 deletions manifests/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,14 @@ tests/:
Test_Config_IntegrationEnabled_True:
'*': irrelevant (endpoint not implemented)
rails70: v2.0.0
Test_Config_LogInjection_128Bit_TradeId_Default: incomplete_test_app
Test_Config_LogInjection_128Bit_TradeId_Disabled: incomplete_test_app
Test_Config_LogInjection_Default: incomplete_test_app
Test_Config_LogInjection_Enabled: incomplete_test_app
Test_Config_ObfuscationQueryStringRegexp_Configured: missing_feature
Test_Config_ObfuscationQueryStringRegexp_Empty: missing_feature (environment variable is not supported)
Test_Config_RuntimeMetrics_Default: incomplete_test_app
Test_Config_RuntimeMetrics_Enabled: incomplete_test_app
Test_Config_UnifiedServiceTagging_CustomService: v2.0.0
Test_Config_UnifiedServiceTagging_Default: v2.0.0
test_distributed.py:
Expand Down
25 changes: 22 additions & 3 deletions tests/parametric/test_128_bit_traceids.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_datadog_128_bit_generation_enabled(self, test_agent, test_library):

@missing_feature(context.library == "golang", reason="not implemented")
@missing_feature(context.library < "[email protected]", reason="Implemented in 1.24.0")
@missing_feature(context.library == "nodejs", reason="not implemented")
@missing_feature(context.library < "nodejs@4.19.0", reason="Implemented in 4.19.0 & 3.40.0")
@missing_feature(context.library == "ruby", reason="not implemented")
@pytest.mark.parametrize("library_env", [{"DD_TRACE_PROPAGATION_STYLE": "Datadog"}])
def test_datadog_128_bit_generation_enabled_by_default(self, test_agent, test_library):
simon-id marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -383,6 +383,7 @@ def test_w3c_128_bit_propagation(self, test_agent, test_library):
assert dd_p_tid == "640cfd8d00000000"
check_128_bit_trace_id(fields[1], trace_id, dd_p_tid)

@missing_feature(context.library < "[email protected]", reason="implemented in 5.7.0 & 4.31.0")
@missing_feature(context.library == "ruby", reason="not implemented")
@pytest.mark.parametrize(
"library_env",
Expand All @@ -409,8 +410,6 @@ def test_w3c_128_bit_propagation_tid_consistent(self, test_agent, test_library):
assert propagation_error is None

@missing_feature(context.library == "ruby", reason="not implemented")
@missing_feature(context.library == "nodejs", reason="not implemented")
@missing_feature(context.library == "java", reason="not implemented")
@pytest.mark.parametrize(
"library_env",
[{"DD_TRACE_PROPAGATION_STYLE": "tracecontext", "DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": "true"}],
Expand All @@ -422,6 +421,26 @@ def test_w3c_128_bit_propagation_tid_in_chunk_root(self, test_agent, test_librar
with test_library.dd_start_span(name="child", service="service", parent_id=parent.span_id) as child:
pass

traces = test_agent.wait_for_num_traces(1, clear=True, sort_by_start=False)
trace = find_trace(traces, parent.trace_id)
assert len(trace) == 2
first_span = find_first_span_in_trace_payload(trace)
tid_chunk_root = first_span["meta"].get("_dd.p.tid")
assert tid_chunk_root is not None

@missing_feature(context.library == "ruby", reason="not implemented")
@missing_feature(context.library == "java", reason="not implemented")
@pytest.mark.parametrize(
"library_env",
[{"DD_TRACE_PROPAGATION_STYLE": "tracecontext", "DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": "true"}],
)
def test_w3c_128_bit_propagation_tid_only_in_chunk_root(self, test_agent, test_library):
"""Ensure that only root span contains the tid."""
with test_library:
with test_library.dd_start_span(name="parent", service="service", resource="resource") as parent:
with test_library.dd_start_span(name="child", service="service", parent_id=parent.span_id) as child:
pass

traces = test_agent.wait_for_num_traces(1, clear=True, sort_by_start=False)
trace = find_trace(traces, parent.trace_id)
assert len(trace) == 2
Expand Down
45 changes: 45 additions & 0 deletions tests/parametric/test_config_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,51 @@ def test_dd_trace_agent_http_url_nonexistent(self, library_env, test_agent, test
assert url.hostname == "random-host"
assert url.port == 9999

@parametrize(
"library_env",
[
{
"DD_TRACE_AGENT_URL": "http://[::1]:5000",
"DD_AGENT_HOST": "localhost",
"DD_AGENT_PORT": "8126",
}
],
)
@missing_feature(context.library == "ruby", reason="does not support ipv6 hostname")
def test_dd_trace_agent_http_url_ipv6(self, library_env, test_agent, test_library):
with test_library as t:
resp = t.config()

url = urlparse(resp["dd_trace_agent_url"])
assert url.scheme == "http"
assert url.hostname == "::1"
assert url.port == 5000

@parametrize(
"library_env",
[
{
"DD_AGENT_HOST": "[::1]",
"DD_AGENT_PORT": "5000",
}
],
)
@missing_feature(context.library == "java", reason="does not support ipv6 hostname")
@missing_feature(context.library == "dotnet", reason="does not support ipv6 hostname")
@missing_feature(context.library == "golang", reason="does not support ipv6 hostname")
@missing_feature(context.library == "nodejs", reason="does not support ipv6 hostname")
@missing_feature(context.library == "python", reason="does not support ipv6 hostname")
@missing_feature(context.library == "ruby", reason="does not support ipv6 hostname")
@missing_feature(context.library == "php", reason="does not support ipv6 hostname")
def test_dd_agent_host_ipv6(self, library_env, test_agent, test_library):
with test_library as t:
resp = t.config()

url = urlparse(resp["dd_trace_agent_url"])
assert url.scheme == "http"
assert url.hostname == "::1"
assert url.port == 5000


@scenarios.parametric
@features.tracing_configuration_consistency
Expand Down
Loading
Loading