Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add inferred proxy spans #3052
base: main
Are you sure you want to change the base?
Add inferred proxy spans #3052
Changes from 3 commits
6fb5400
9762bfd
63c8418
5f16ca4
10ed7f7
923d28b
b356a70
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you add tests to make sure the other aspects of the span metadata is present? Some examples can be found in the JS version: https://github.com/DataDog/dd-trace-js/pull/4837/files#diff-30cfe20da922154edf4288007e440ef1fc0873c26813eb2cc7c78e064024ebd0 .
Namely, span metadata like:
I'm curious if you can assert that the inferred span in Go follows the underlying span created by httptrace.
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.
Currently working through a bug I found related to this in expected tag assertion
I am assuming you mean asserting that httptrace is a parent of the inferredSpan? - I have a line that checks this https://github.com/DataDog/dd-trace-go/pull/3052/files#diff-5c136a85a92fba2b6b3bdb1a3b8f5c43ed87d3dcb3d65a4bab64d68df68b769cR88
assert.True(web_req_span.ParentID() == gateway_span.SpanID())
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.
Sorry, to clarify, I mean asserting that the httptrace span and the inferred span have matching:
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.
Just a question: Is this casing Go syntax specific? I noticed in the test that it'd work with
x-dd-proxy-path
.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.
Golang's http library parses and returns http request header content in "Canonical Form" with each word capitalized, so when accessing headers from a request we need to reference the exact spelling. https://ron-liu.medium.com/what-canonical-http-header-mean-in-golang-2e97f854316d
In the tests we are passing in the headers to create a new Request, so the http library automatically formats/capitalizes our headers to canonical form for us even if we pass in lowercased strings.
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.
Is this comment asking if it's possible for something like domain to have multiple "domain values"? At the moment, I don't think so.
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.
HTTP headers may have multiple values but it's up to specs to treat each header as a concrete value or a list of them, according to RFC 7231:
So, whoever is emitting PROXY_HEADER_DOMAIN need to confirm if it may have multiple values or not. The same for the rest of headers.