-
Notifications
You must be signed in to change notification settings - Fork 773
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
W3C Trace propagator tests - switch to level 1 #4937
Changes from 5 commits
e785a3a
f07f636
cb2ecd8
705cecd
a4221b2
6788d16
d7ad2c4
d1ee774
2a02548
b4faa7c
f6b2d2a
904935a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,10 +193,10 @@ public void Inject_WithTracestate() | |
public void DuplicateKeys() | ||
{ | ||
// test_tracestate_duplicated_keys | ||
Assert.Empty(CallTraceContextPropagator("foo=1,foo=1")); | ||
Assert.Empty(CallTraceContextPropagator("foo=1,foo=2")); | ||
Assert.Empty(CallTraceContextPropagator(new[] { "foo=1", "foo=1" })); | ||
Assert.Empty(CallTraceContextPropagator(new[] { "foo=1", "foo=2" })); | ||
Assert.Equal("foo=1,foo=1", CallTraceContextPropagator("foo=1,foo=1")); | ||
Assert.Equal("foo=1,foo=2", CallTraceContextPropagator("foo=1,foo=2")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the correct behavior or is the behavior in @pellared's PR for opentelemetry-go correct? That is: Assert.Equal("foo=1,foo=1", CallTraceContextPropagator("foo=1"));
Assert.Equal("foo=1,foo=2", CallTraceContextPropagator("foo=1")); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, nevermind. After speaking with @utpilla, sounds like both behaviors are correct and left up to the implementation. |
||
Assert.Equal("foo=1,foo=1", CallTraceContextPropagator(new[] { "foo=1", "foo=1" })); | ||
Assert.Equal("foo=1,foo=2", CallTraceContextPropagator(new[] { "foo=1", "foo=2" })); | ||
} | ||
|
||
[Fact] | ||
|
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.
https://github.com/w3c/trace-context/blob/551a5b0855171281e98b4c2a814bf9e1f837cd53/test/test.py#L565-L567
Could we discard the duplicate ones instead of keeping them? We are only allowed 32 keys. Why waste them by storing duplicates when we could make room for other unique keys?
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 have tried to answer in PR description on it what was the reason for the change:
If you think that it is worth to keep the checj, I can update this PR.
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.
On second thought, I think we could just keep the key as-is in favor of performance as this would be exectued in the hot-path.
@alanwest @CodeBlanch @vishweshbankwar It would be great to know your thoughts as well.
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 am good to keep this as spec allows it.
Not for this PR - It would be good to check how other languages are doing it (would be good to keep consistent behavior)
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.
Java is doing similar things, at the beginning checking if there is more/less than 32 attributes https://github.com/open-telemetry/opentelemetry-java/blob/57d83344178f578eb5d2f043b0ffc5c42b6719a5/api/all/src/main/java/io/opentelemetry/api/trace/propagation/internal/W3CTraceContextEncoding.java#L43-L45
Go-lang has similar issue like here, before changes: https://github.com/open-telemetry/opentelemetry-go/blob/c047088605b454f172765621d53107f80b1e6417/trace/tracestate.go#L123-L126
Python is checking duplicates: https://github.com/open-telemetry/opentelemetry-python/blob/34d11d59e9b37052eb3aa6706288641ecb3056e7/opentelemetry-api/src/opentelemetry/trace/span.py#L231-L240
I do not think that there we will be able to find common solution.