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

Config Consistency Tests for DD_TRACE_<INTEGRATION>_ENABLED #3060

Merged
merged 15 commits into from
Sep 25, 2024

Conversation

link04
Copy link
Contributor

@link04 link04 commented Sep 17, 2024

Motivation

Our APMAPI-284 Jira card where we need to write a test that validates the outcome of using the setting with both true and false values so that we can test if the auto instrumented library behaves as expected.

Changes

  • Included the MongoDB container to the tracing_config_nondefault scenario and added the env var with the value of false and to tracing_config_nondefault_2with the value off true.
  • Added a new endpoint for .NET where I run a MongoDB query to check for the version of Mongo.
  • Added two tests cases where I check for spans that belong to the expected Integration by checking the operation name for now(most consistent tag based on my research), and then assert on them depending on the test.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@link04 link04 added the dotnet Pull requests that update .NET code label Sep 18, 2024
tests/test_config_consistency.py Outdated Show resolved Hide resolved
docs/weblog/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mabdinur mabdinur left a comment

Choose a reason for hiding this comment

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

left some nits but overall looks good to me

tests/test_config_consistency.py Outdated Show resolved Hide resolved
doc="",
scenario_groups=[ScenarioGroup.ESSENTIALS],
)

tracing_config_nondefault_3 = EndToEndScenario(
"TRACING_CONFIG_NONDEFAULT_3", weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false"}, doc="",
"TRACING_CONFIG_NONDEFAULT_3",
weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false", "DD_TRACE_Kafka_ENABLED": "true"},
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: casing

Suggested change
weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false", "DD_TRACE_Kafka_ENABLED": "true"},
weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false", "DD_TRACE_KAFKA_ENABLED": "true"},

Copy link
Contributor

Choose a reason for hiding this comment

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

This casing may actually be required for the .NET SDK to recognize the flag on Linux so we might need to keep this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed so the other languages need to add the env var as their tracer expects it as they enable the test(some languages may even have different integrations names).

Copy link
Contributor

@bwoebi bwoebi Sep 25, 2024

Choose a reason for hiding this comment

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

@zacharycmontoya Well, the casing is required for the PHP extension to recognize the flag on Linux, but in uppercase.
If I read it correctly at least Java and Ruby are using full uppercase too. From a quick glance at docs I couldn't determine what exactly Python and node are doing.
So... we have to change this in any case in at least one place.
I'd propose to universally move to fully uppercase. I find uppercase also more intuitive, in the midst of everything else being uppercase.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd propose to universally move to fully uppercase. I find uppercase also more intuitive, in the midst of everything else being uppercase.

Agree, all our configuration env var are upper case. It looks weird to have one that mix both. By the why, is there a RFC for that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it was previously implemented like that, not sure I could find the RFC for that since is so old, but we have agreed that for these efforts of the Config Consistency RFC it should be added that we always expected a all Upper cased env var.

doc="",
scenario_groups=[ScenarioGroup.ESSENTIALS],
)

tracing_config_nondefault_3 = EndToEndScenario(
"TRACING_CONFIG_NONDEFAULT_3", weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false"}, doc="",
"TRACING_CONFIG_NONDEFAULT_3",
weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false", "DD_TRACE_Kafka_ENABLED": "true"},
Copy link
Contributor

Choose a reason for hiding this comment

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

We should leave a comment stating that kafka is being used to validate DD_TRACE__ENABLED configurations. There's nothing special about kafka, it just an integration that is consistent across all libraries (🤞).

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not present in PHP though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the plan was to use a different existing endpoint and env var for PHP since is the only one left out.

manifests/cpp.yml Show resolved Hide resolved
@link04 link04 marked this pull request as ready for review September 24, 2024 22:40
@link04 link04 requested review from a team as code owners September 24, 2024 22:40
@link04 link04 requested review from a team as code owners September 24, 2024 22:40
@link04 link04 requested review from tabgok, vitor-de-araujo, smola, Mariovido and cataphract and removed request for a team September 24, 2024 22:40
Copy link
Collaborator

@cbeauchesne cbeauchesne left a comment

Choose a reason for hiding this comment

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

Testing : ok
CI: ok (failures are not related)

There is only the question of lowecase/uppercase. Not my decision here (even if I have a strong opinion 😉 ) So I let @bwoebi the charge to approve the PR.

@link04 link04 marked this pull request as draft September 25, 2024 17:50
@link04 link04 marked this pull request as ready for review September 25, 2024 20:15
@link04 link04 merged commit fee8800 into main Sep 25, 2024
399 of 403 checks passed
@link04 link04 deleted the maximo/integration-enabled-consistency branch September 25, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Pull requests that update .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants