-
Notifications
You must be signed in to change notification settings - Fork 14
Test Stable Config support for extended configs #5357
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
Changes from 6 commits
0cb11db
35996f7
6de8166
84e7856
b6c40e3
27874b7
f4b0908
21a11bf
4fcb3dc
beaa171
286a640
51021f7
4c6ee6f
0b2f111
a8751a2
f3c9b99
e281615
6401306
3dabf60
fc65384
916e25d
5ffdeb7
2648b8f
c37fcab
f1759a6
f0b51e7
9e50750
3041acd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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"]}, | ||||||||||||||||||||||||||||||||||||||||
| {"dd_tags": "[tag1:value1,tag2:value2]"}, | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
| {"dd_tags": "[tag1:value1,tag2:value2]"}, | |
| { | |
| "dd_tags": "[tag1:value1,tag2:value2]" | |
| if context.library in ["golang", "dotnet"] | |
| else "tag1:value1,tag2:value2" | |
| }, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :
| {"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 🤔
There was a problem hiding this comment.
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
system-tests/tests/parametric/test_otel_env_vars.py
Lines 43 to 47 in 31c3b79
| 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 ?
There was a problem hiding this comment.
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 3which 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
There was a problem hiding this comment.
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 .. }