-
Notifications
You must be signed in to change notification settings - Fork 896
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
Capture HTTP request/response headers as span attributes #1898
Capture HTTP request/response headers as span attributes #1898
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.
This convention is breaking new ground, because it only defines a prefix, not a full semantic convention. We don't really have support for that in the semantic convention generator (yet?), so it's fine to only have it as a markdown table.
There are a few questions that arise from this convention, that I'll post as separate comments.
Should HTTP Request/Response be an "Event" with these as attributes on that event? |
I'd say no, because there are no meaningful timestamps one could attach to such events that are different from the span start/end. |
After seeing #1907, I wonder if my proposal to preserve casing was so good after all, or if we need something additional. IMHO a good goal would be to be able to capture header information in such a way that #1907 is resolved as well. Some ideas:
|
@Oberon00 HTTP/2 requires headers be lowercase while in HTTP/1 it doesn't matter. Normalizing them to all lowercase would be backwards compatible, while also being future proof. |
I like this idea because it's the simplest out of the three you suggested - and the most intuitive one ("why don't we lowercase headers" was the first question I asked in the linked issue 😄 ). We do lose a little bit of information that way, but since HTTP headers are supposed to be case insensitive by design it's probably not worth that much. |
Since we don't support this now (and probably it will take a little while before we do so), should we proceed with this approach for now? @bogdandrutu @yurishkuro |
You are assuming that we will support it 😉 That's not decided at all. |
Yeah, definitely. More the reason to go with the current approach. |
My thoughts: I'm somewhat strongly against adding support for more complex attributes, like maps. I think this PR should be merged as-is, and then we should close #376 because the only use case that came up so far has been solved differently. What would the purpose of adding maps after this PR be? The added-value of maps is already very small (negative IMHO), and if we add maps after this PR, there is one more negative to it, namely the disruption it causes for this semantic convention. |
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.
I'm against having the value be set as a single string instead of single-element array, as it makes typing more complicated. See #1898 (comment)
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
7747d92
to
12151ec
Compare
Will merge by EOD unless somebody opposes. |
@open-telemetry/specs-approvers @open-telemetry/specs-trace-approvers please take a look at this PR 🙏 |
…try#1898) * Capture HTTP request/response headers as span attributes * Reference footnote [2] * code review suggestions * code review suggestions * code review comments * normalize HTTP header names * Update specification/trace/semantic_conventions/http.md Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> * code review suggestion * Add a CHANGELOG entry * code review suggestions Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Fixes #1061
Changes