Skip to content
Merged
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0cb11db
Introduce extended_configs test with dd_tags
mtoffl01 Sep 26, 2025
35996f7
Correct placement of annotation
mtoffl01 Sep 26, 2025
6de8166
Enable test for dotnet, python; include test log msg for debugging
mtoffl01 Sep 29, 2025
84e7856
remove print; expose config inside the test assertion
mtoffl01 Sep 29, 2025
b6c40e3
Merge branch 'main' into mtoff/scfg-all-configs
mtoffl01 Sep 30, 2025
27874b7
Use propagation_style for another input
mtoffl01 Sep 30, 2025
f4b0908
Introduce telemetry test for extended_configs
mtoffl01 Oct 1, 2025
21a11bf
change dd_tags input to exclude brackets
mtoffl01 Oct 1, 2025
4fcb3dc
Change tags to not use brackets in telemetry test
mtoffl01 Oct 1, 2025
beaa171
run linter
mtoffl01 Oct 2, 2025
286a640
Modify expected tags value for dotnet
mtoffl01 Oct 2, 2025
51021f7
change tags value for php
mtoffl01 Oct 2, 2025
4c6ee6f
Make extended_config telemetry test more verbose on failure
mtoffl01 Oct 2, 2025
0b2f111
Merge branch 'main' into mtoff/scfg-all-configs
mtoffl01 Oct 3, 2025
a8751a2
Change telemetry order to use propagation_style for fleet override
mtoffl01 Oct 3, 2025
f3c9b99
map tags to DD_TAGS for dotnet telemetry
mtoffl01 Oct 3, 2025
e281615
map tags to DD_TAGS for python telemetry
mtoffl01 Oct 3, 2025
6401306
map propagation_style for python and dotnet
mtoffl01 Oct 3, 2025
3dabf60
swap python and dotnet for telemetry mapping - propagation style
mtoffl01 Oct 6, 2025
fc65384
Add entry for php telemetry mapping
mtoffl01 Oct 6, 2025
916e25d
Add entry for ruby telemetry mapping
mtoffl01 Oct 6, 2025
5ffdeb7
run liner
mtoffl01 Oct 6, 2025
2648b8f
Use inject and extract propagation style keys for python and ruby
mtoffl01 Oct 7, 2025
c37fcab
Split config test into 'default' and 'rules'
mtoffl01 Oct 8, 2025
f1759a6
mark telemetry test with bug for ruby
mtoffl01 Oct 9, 2025
f0b51e7
merge main/ resolve conflicts
mtoffl01 Oct 10, 2025
9e50750
Merge branch 'main' into mtoff/scfg-all-configs
mtoffl01 Oct 14, 2025
3041acd
Merge branch 'main' into mtoff/scfg-all-configs
mtoffl01 Oct 15, 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
46 changes: 44 additions & 2 deletions tests/parametric/test_config_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,49 @@ def test_default_config(
config = test_library.config()
assert expected.items() <= config.items()

# @pytest.mark.parametrize("library_env", [{}])
@pytest.mark.parametrize("library_env", [{}])
@pytest.mark.parametrize(
("name", "apm_configuration_default", "expected"),
[
(
"tags",
{"DD_TAGS": ["tag1:value1", "tag2:value2"]},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this line causes an error in libdatadog. The log we have in ruby is this:
apm_configuration_default.DD_TAGS: invalid type: sequence, expected a string at line 3 column 3 which is a libdatadog log.
libdatadog can only parse strings, which I believe is the correct behaviour as it basically acts the same as environment variables.
This test should fail on all libs that uses libdatadog but NodeJS only accepts configs defined in the RFC, and PHP and Dotnet does not run them yet, which is why only Ruby and Python fails.
The correct value should be something like

Suggested change
{"DD_TAGS": ["tag1:value1", "tag2:value2"]},
{"DD_TAGS": "tag1:value1,tag2:value2"},

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm I also get 2025-10-01 15:43:07.679 +02:00 [WRN] Failed to create the global configuration source with status: LibDatadogCallError and error message: apm_configuration_default.DD_TAGS: invalid type: sequence, expected a string at line 3 column 12 .. }

{"dd_tags": "[tag1:value1,tag2:value2]"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format of the result depends on the implementation on the weblog, but most weblogs does not include the square brackets. In this state the test would still fail for them. The easiest fix would be something like:

Suggested change
{"dd_tags": "[tag1:value1,tag2:value2]"},
{
"dd_tags": "[tag1:value1,tag2:value2]"
if context.library in ["golang", "dotnet"]
else "tag1:value1,tag2:value2"
},

Copy link
Contributor

@anna-git anna-git Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after running locally we seem to indeed format it as an array in dotnet but with a space in the middle 😶‍🌫️ "dd_tags": "[tag1:value1, tag2:value2]" should work for us

Copy link
Contributor

@anna-git anna-git Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually my bad, after double checking it should be :

Suggested change
{"dd_tags": "[tag1:value1,tag2:value2]"},
{
"dd_tags": "[tag1:value1,tag2:value2]"
if context.library in ["golang"]
else ['tag1:value1', 'tag2:value2']
if context.library in ["dotnet"]
else "tag1:value1,tag2:value2"
},

I know it's terrible... I wish we had a better way to check stuff, like a more dynamic way 🤔

Copy link
Contributor

@vpellan vpellan Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking php code and they seem to simply return the input value, so if you decide to also keep the space in the input, this will be another case. To avoid having a lot of cases where the only difference will be brackets and spaces, another way to fix this would be to parse the expectation and check that the result contains each expectation entry, something like

tags = resp["dd_tags"]
assert "foo:bar" in tags
assert "baz:qux" in tags
assert "foo:otel_bar" not in tags
assert "baz:otel_qux" not in tags

Edit: Just saw Anna previous comment, this should also work with arrays I believe ?

),
(
"128bit_traceids",
{"DD_TRACE_PROPAGATION_STYLE": "tracecontext"},
{"dd_trace_propagation_style": "tracecontext"},
),
],
ids=lambda name: name,
)
@pytest.mark.parametrize(
"path",
[
"/etc/datadog-agent/managed/datadog-agent/stable/application_monitoring.yaml",
"/etc/datadog-agent/application_monitoring.yaml",
],
)
@missing_feature(
context.library in ["cpp", "golang", "nodejs"],
reason="extended configs are not supported",
)
def test_extended_configs(
self, test_agent, test_library, path, library_env, name, apm_configuration_default, expected
):
with test_library:
self.write_stable_config(
{
"apm_configuration_default": apm_configuration_default,
},
path,
test_library,
)
test_library.container_restart()
config = test_library.config()
assert expected.items() <= config.items(), f"Expected config items not found. Actual config is: {config}"

@pytest.mark.parametrize(
"test",
[
Expand Down Expand Up @@ -629,7 +671,7 @@ def test_config_precedence(self, name, test_agent, test_library, local_cfg, libr
context.library in ["ruby", "cpp", "dotnet", "golang", "nodejs", "php", "python"],
reason="UST stable config is phase 2",
)
def test_config_stable(self, library_env, test_agent, test_library):
def test_targeting_rules(self, library_env, test_agent, test_library):
path = "/etc/datadog-agent/managed/datadog-agent/stable/application_monitoring.yaml"
with test_library:
self.write_stable_config(
Expand Down
Loading