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

trace: ParseTraceState ignores duplicated tracestate keys #4638

Closed
wants to merge 5 commits into from

Conversation

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #4638 (b2f83be) into main (5dff273) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

❗ Current head b2f83be differs from pull request most recent head 5f4ac4f. Consider uploading reports for the commit 5f4ac4f to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #4638     +/-   ##
=======================================
- Coverage   81.3%   81.3%   -0.1%     
=======================================
  Files        222     222             
  Lines      17682   17682             
=======================================
- Hits       14391   14389      -2     
- Misses      2991    2993      +2     
  Partials     300     300             
Files Coverage Δ
trace/tracestate.go 100.0% <100.0%> (ø)

... and 22 files with indirect coverage changes

@@ -121,7 +120,7 @@ func ParseTraceState(tracestate string) (TraceState, error) {
}

if _, ok := found[m.Key]; ok {
return TraceState{}, wrapErr(errDuplicate)
continue // Duplicate is ignored per https://github.com/w3c/trace-context/blob/551a5b0855171281e98b4c2a814bf9e1f837cd53/test/test.py#L563-L568.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a link to W3C unit tests. Can you instead link to the part of the W3C specification that describes this behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have not found anything better than the test code in the specification that describes it. See: https://github.com/instana/trace-context/blob/master/spec/20-http_request_header_format.md

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@pellared pellared Oct 16, 2023

Choose a reason for hiding this comment

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

Do you have any other suggestion or can this comment be resolved?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this behavior is only mentioned in the editor draft of the W3C trace-context as optional. This PR seems premature given that unreleased state.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changing to draft

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like this behavior is only mentioned in the editor draft of the W3C trace-context as optional.

For me even the editor draft does not clearly defines this behavior thus I created w3c/trace-context#548

@pellared pellared marked this pull request as ready for review October 17, 2023 21:22
@pellared pellared marked this pull request as draft October 17, 2023 21:25
@pellared pellared closed this Oct 23, 2023
@pellared pellared deleted the tracestate-dups branch November 17, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants