-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[windows][usm] Fix json parsing for usm #30780
Conversation
The parsing of `datadog.json` for USM service tagging was far too restrictive. It assumed all values were always string values, and failed if any entry had a non-string (e.g. bool) value; even though those values are allowed for other keys. Fixes parser to allow this case, and also updates test to have the additional entries in them.
[Fast Unit Tests Report] On pipeline 48376905 (CI Visibility). The following jobs did not run any unit tests: Jobs:
If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-devx-help |
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=48376905 --os-family=ubuntu Note: This applies to commit 07eaf9b |
/merge |
🚂 MergeQueue: pull request added to the queue The median merge time in Use |
(cherry picked from commit 1c2a21b)
The parsing of
datadog.json
for USM service tagging was far too restrictive. It assumed all values were always string values, and failed if any entry had a non-string (e.g. bool) value; even though those values are allowed for other keys.Fixes parser to allow this case, and also updates test to have the additional entries in them.
Motivation
Customer reported issue with USM service tagging not working
Describe how to test/QA your changes
Automated tests in place.
Create a
datadog.json
in the directorInstall IIS.
Create one or more IIS sites in the IIS configuration.
Place a datadog.json or web.config file in the root of the site directory, with any combination of env/version/service tags.
The file formats are documented
https://datadoghq.atlassian.net/wiki/spaces/WKIT/pages/4012835378/USM+APM+Compatibility#.NET-Tracer-configuration-file-formats
In addition, the customer had a valid entry that we were parsing as invalid, such as:
"DD_RUNTIME_METRICS_ENABLED": true
Add this entry to the top level block.
Make a connection to the site.
YOu can check that the appropriate tag(s) have been added by hitting the HTTP information endpoint:
(from the source tree, download
NamedPipeCmd.ex
).\NamedPipeCmd.exe -method GET -path /network_tracer/debug/http_monitoring -quiet |convertfrom-json
YOu should see output such as:
Client : @{IP=::1; Port=80}
Server : @{IP=::1; Port=62700}
DNS :
Path : /
Method : GET
ByStatus : @{200=}
StaticTags : 0
DynamicTags : {http.iis.app_pool:DefaultAppPool, http.iis.site:1, http.iis.sitename:Default Web Site}
with the addition of service, env, and or version tags that match what was configured in the file that you applied.
Possible Drawbacks / Trade-offs