-
Notifications
You must be signed in to change notification settings - Fork 10
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
Migrating compound extraction span link tests to weblog #3499
Conversation
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.
Left some nits overall the approach looks good to me
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.
left two more comments but overall this migration looks good to me. Good job!
assert link1["trace_id"] == 1 | ||
assert link1["span_id"] == 987654321 | ||
assert link1["attributes"] == {"reason": "terminated_context", "context_headers": "tracecontext"} | ||
assert link1["tracestate"] == "dd=s:2;t.tid:1111111111111111,foo=1" |
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.
nit: Assertion on tracestate could get tricky. I don't think every library sets this field in the same 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.
Hmm this test isn't expected to pass as of now, and exists as a result of extracting the tests that are expected to pass versus the ones that test fields that do not have a spec currently. I think keeping it here is fine right now, as it is marked as missing_feature
due to lack of spec.
assert link1.get("tracestate") == None | ||
|
||
|
||
def _retrieve_span_links(span): |
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.
nit: can we move utils.parametric.spec.trace.retrieve_span_links()
to a new shared module (ex: utils.trace.py) so that we can re-use this function in weblog tests.
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 was addressed by @cbeauchesne above. If a new weblog test will use the function, we can move it out then?
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.
Some test are failing in the CI. But the rest is fine to me
CI failures are the msgpack issue ? |
yes it is. Checking |
You may have found a real issue in this tracer, the agent does not like either the data from the lib, here is its response :
|
I've sent a message on slack to the java guild, let's wait for their response |
Waiting for #3587 to move forward. Once it's merged, we'll skip the test for spring-boot-native |
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.
Ok, almost good. There is still one weblog failing : https://github.com/DataDog/system-tests/actions/runs/12075461097/job/33675669767?pr=3499#step:25:57
The java error has been fixed by DataDog/dd-trace-java#8036 |
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
Currently, we test the results of compound extraction of inconsistent headers through parametric tests. However, using the parametric app does not truly reflect the behavior exhibited through automatic instrumentation, as we have to manually call extract on the headers passed in, create a span, and add the extracted context/span links to the span. This PR aims to migrate the parametric tests into weblog tests to remove the manual process of imitating this scenario, and have the system-tests represent what actually happens when we have compound extraction on a set of inconsistent headers.
Changes
Add 2 weblog scenarios that take in
DD_TRACE_PROPAGATION_STYLE_EXTRACT
with values of tracecontext -> datadog -> b3 and datadog -> tracecontext -> b3 respectively. The tests create a span through themake_distant_call
endpoint and we verify that we get back a span that has the appropriate span links for different scenarios.APMAPI-899
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