-
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
Conversation
| [ | ||
| ( | ||
| "tags", | ||
| {"DD_TAGS": ["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.
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
| {"DD_TAGS": ["tag1:value1", "tag2:value2"]}, | |
| {"DD_TAGS": "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.
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 .. }
| ( | ||
| "tags", | ||
| {"DD_TAGS": ["tag1:value1", "tag2:value2"]}, | ||
| {"dd_tags": "[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.
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:
| {"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 ?
|
|
| context.library in ["cpp", "golang", "nodejs"], | ||
| reason="extended configs are not supported", | ||
| ) | ||
| @bug(context.library == "ruby", reason="APMAPI-1650") |
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.
This will be removed once related ruby fix is merged (in progress)
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.
DataDog/dd-trace-rb#4963 has been merged, this line can be removed (tested locally)
vpellan
left a comment
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.
LGTM!
| ) | ||
| @bug(context.library == "ruby", reason="APMAPI-1650") | ||
| @irrelevant(context.library in ["java", "php", "dotnet"], reason="temporary use case for python and ruby") | ||
| def test_stable_configuration_origin_extended_configs_temporary_use_case( |
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'll ask the reason why we don't report the tags and why we report the extract/inject config instead of the main one when only the main one is set
| context.library in ["cpp", "golang", "nodejs"], | ||
| reason="extended configs are not supported", | ||
| ) | ||
| @bug(context.library == "ruby", reason="APMAPI-1650") |
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.
DataDog/dd-trace-rb#4963 has been merged, this line can be removed (tested locally)
anna-git
left a comment
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.
thank you!
cbeauchesne
left a comment
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.
From framework usage, all good. I suggest getting a review with someone familiar with the feature
Motivation
In Phase 1, tracer SDKs supported a shortlist of product-enablement configurations in Declarative Config (formerly “Stable Config”) files.
In Phase 2 (“extended configs”), SDKs now support all valid configurations.
These tests use
DD_TAGSandDD_TRACE_PROPAGATION_STYLEas representative examples of this broader support, since they were not part of the original Phase 1 list, and they behave consistently (...mostly) across SDKs according to the Feature Parity Dashboard.Changes
Refactor:
Moved service-targeting subtests from
Test_Stable_Config_Defaultinto a new test class,Test_Stable_Config_Rules.Test_Stable_Config_Defaultnow focuses onapm_configuration_defaultbehavior, whileTest_Stable_Config_Rulescoversapm_configuration_rulesbehavior.New tests:
Added a
Test_Stable_Config_Defaultcase that verifiesDD_TAGSandDD_TRACE_PROPAGATION_STYLEcan be configured via Declarative Config files (both local and fleet sources).Added two new
test_stable_configuration_origin_extended_configstests which assert thatDD_TAGSandDD_TRACE_PROPAGATION_STYLEreport telemetry with an origin of eitherfleet_stable_configorlocal_stable_configwhen configured through Declarative Config. There are two tests with this logic: one for "good_use_case" and one for "temporary_use_case." the latter accounts for current Ruby and Python behavior, which differs slightly from other SDKs but isn’t directly relevant to the intent of this test.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
[<language>], double-check that only<language>is impacted by the changebuild-XXX-imagelabel is present