-
Notifications
You must be signed in to change notification settings - Fork 714
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
Adds B3SinglePropagation for the "b3" header #763
Conversation
benchmarks:
|
cc @openzipkin/instrumentation-owners in case you'd like to see an example |
long traceIdHigh, traceId; | ||
if (b3.charAt(32) == '-') { | ||
traceIdHigh = lenientLowerHexToUnsignedLong(b3, 0, 16); | ||
traceId = lenientLowerHexToUnsignedLong(b3, 16, 32); |
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.
You do lenientLowerHexToUnsignedLong(b3, pos, pos + 16);
for parsing the span ID, did you mean to use pos
here also to be consistent?
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 probably meant to do the following in order to save from doing extra math when there will be constant results (due to this being the initial parse). Maybe the distraction isn't worth it.. I can switch to pos, pos + 16
NP
int pos;
if (b3.charAt(32) == '-') {
--snip--
pos = 33; // traceid128-
} else {
--snip--
pos = 17; // traceid64-
}
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 moved initialization of pos further down to make it ideally more clear
This will be used for JMS and other propagation formats such as w3c tracestate entry. It is notably more efficient than multi-header. Example header: `b3: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-1` To aid in migration, this teaches the normal B3 to attempt to extract single header variants as well. See openzipkin/b3-propagation#21
da2946c
to
2bbdf14
Compare
review after commit welcome. merging to progress some messaging things which hinge on this |
This adds a huge amount of state checks to understand the source of malform problems. This exposes B3SingleFormat methods so they can be used in other code, such as w3c tracestate or JMS directly. See #763
This adds a huge amount of state checks to understand the source of malform problems. This exposes B3SingleFormat methods so they can be used in other code, such as w3c tracestate or JMS directly. See #763
This will be used for JMS and other propagation formats such as w3c
tracestate entry. It is notably more efficient than multi-header.
Example header:
b3: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-1
To aid in migration, this teaches the normal B3 to attempt to extract
single header variants as well.
See openzipkin/b3-propagation#21