-
Notifications
You must be signed in to change notification settings - Fork 11
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
Adding weblog tests for TRACE_CLIENT_IP_ENABLED Configuration #3657
Conversation
weblog_env={"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false"}, | ||
weblog_env={ | ||
"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false", | ||
"DD_TRACE_CLIENT_IP_ENABLED": "false", |
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.
default behavior is false, so no need to add this for the Test_Config_ClientIPHeaderEnabled_False test
tests/test_config_consistency.py
Outdated
@scenarios.tracing_config_nondefault_3 | ||
@features.tracing_configuration_consistency | ||
class Test_Config_ClientIPHeaderEnabled_False: | ||
"""Verify headers containing ips are not tagged when DD_TRACE_CLIENT_IP_ENABLED=false |
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.
We should update the comment to state DD_TRACE_CLIENT_IP_ENABLED=false is default behavior. So Verify headers containing ips are not tagged by default
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.
There are tests failures. Could you check if are related with your PR before merge?
The .NET parametric scenarios are unrelated (seem to be caused by this PR). I don't believe the python weblog is related either...? |
tests/test_config_consistency.py
Outdated
) | ||
|
||
def test_ip_headers_sent_in_one_request(self): | ||
trace = [span for _, _, span in interfaces.library.get_spans(self.req, full_trace=True)] |
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 array is a lit if spans if I'm not wrong
trace = [span for _, _, span in interfaces.library.get_spans(self.req, full_trace=True)] | |
spans = [span for _, _, span in interfaces.library.get_spans(self.req, full_trace=True)] |
trace = [span for _, _, span in interfaces.library.get_spans(self.req, full_trace=True)] | |
trace = [span for _, _, span in interfaces.library.get_spans(self.req, full_trace=True)] |
tests/test_config_consistency.py
Outdated
|
||
def test_ip_headers_sent_in_one_request(self): | ||
trace = [span for _, _, span in interfaces.library.get_spans(self.req, full_trace=True)] | ||
print(trace) |
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.
print(trace) | |
logger.info(spans) |
weblog_env={ | ||
"DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING": "false", | ||
"DD_TRACE_CLIENT_IP_HEADER": "custom-ip-header", | ||
# disable ASM to test non asm client ip tagging |
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.
There is a appsec_enabled
argument to EndToEndScenario
, you can set it to False
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.
Failures are not related
Motivation
Adding tests for tracing configs to make sure implementation across all languages are consistent, based upon the following RFC.
Changes
DD_TRACE_CLIENT_IP_ENABLED
is set tofalse
andDD_TRACE_CLIENT_IP_HEADER
is specifiedAPMAPI-943
Workflow
codeowners
file quickly.🚀 Once your PR is reviewed, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
[<language>]
, double-check that only<language>
is impacted by the changebuild-XXX-image
label is present