-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Implement "b3 single" header format for zipkin #4712
Conversation
@adriancole @objectiser PTAL if you have some time. @zyfjeff can you add a release note for this and any relevant docs? |
can do!
…On Sun, 14 Oct 2018, 07:34 Matt Klein, ***@***.***> wrote:
@adriancole <https://github.com/adriancole> @objectiser
<https://github.com/objectiser> PTAL if you have some time.
@zyfjeff <https://github.com/zyfjeff> can you add a release note for this
and any relevant docs?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4712 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD61-9uo1V0gSPSyRMm2f9-7ZgT_zK8ks5ukniQgaJpZM4XaY5z>
.
|
so ping me when some basic tests are in. It would be easiest to use the
example data in the b3 spec and show for example single header and multiple
headers with the same ID literals. thanks for the start
https://github.com/openzipkin/b3-propagation/blob/master/README.md#single-header
…On Sun, 14 Oct 2018, 08:35 Adrian Cole, ***@***.***> wrote:
can do!
On Sun, 14 Oct 2018, 07:34 Matt Klein, ***@***.***> wrote:
> @adriancole <https://github.com/adriancole> @objectiser
> <https://github.com/objectiser> PTAL if you have some time.
>
> @zyfjeff <https://github.com/zyfjeff> can you add a release note for
> this and any relevant docs?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#4712 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAD61-9uo1V0gSPSyRMm2f9-7ZgT_zK8ks5ukniQgaJpZM4XaY5z>
> .
>
|
06e1052
to
f7ce6b9
Compare
@adriancole I have two questions want to consult with you Why FORMAT_MAX_LENGTH equal If I received from downstream b3 header format, that spread to the upstream whether change to b3 single header format ? |
This is a bug in brave. thanks for noticing! I'll copy you on the fix.
…On Wed, Oct 17, 2018 at 9:45 PM tianqian.zyf ***@***.***> wrote:
@adriancole <https://github.com/adriancole> I have two questions want to
consult with you?
Why FORMAT_MAX_LENGTH equal 32 + 1 + 16 + 2 + 16, not equal 32 + 1 + 16 +
2 + 1 + 16
https://github.com/openzipkin/brave/blob/master/brave/src/main/java/brave/propagation/B3SingleFormat.java#L45
If I received from downstream b3 header format, that spread to the
upstream whether change to b3 single header format ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4712 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD612AdcY4jZBk0OxuFMIcc7g_QEL7Mks5ulzRlgaJpZM4XaY5z>
.
|
Thanks to @zyfjeff for finding this! See envoyproxy/envoy#4712 (comment)
Thanks to @zyfjeff for finding this! See envoyproxy/envoy#4712 (comment)
Thanks to @zyfjeff for finding this! See envoyproxy/envoy#4712 (comment)
61c7c7b
to
31ad8b1
Compare
@adriancole If I received from downstream b3 header format, that spread to the upstream whether change to b3 single header format ? this problem is not answer me yet |
If I understand you, you are asking if you receive a "b3" header, should
you also send "b3" header?
I think for starters you only send "X-B3-*" headers because the most
important thing is to read "b3". You can make a setting to send both, but
it will cost a little more. I doubt sites will want to send only "b3" by
default.
So you can choose from:
* send "X-B3-*" (no change downstream)
* send both "X-B3-*" and "b3"
* add option to control the behavior. Default to current, and allow people
to opt-in to sending both or just "b3".
maybe there is another choice
…On Fri, Oct 19, 2018 at 4:47 PM tianqian.zyf ***@***.***> wrote:
@adriancole <https://github.com/adriancole> If I received from downstream
b3 header format, that spread to the upstream whether change to b3 single
header format ? this problem is not answer me yet
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4712 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD615qPty4I-36Q0XgUWIPiiRCF_kkHks5umZGwgaJpZM4XaY5z>
.
|
This PR default only send |
This PR default only send X-B3-*, the next PR add option to control the behaviors.
SGTM
|
8d4ac3b
to
adf6322
Compare
@adriancole @objectiser I have already finished, can undertake codereview |
@mattklein123 In which file do you add release note? |
b84e650
to
e617027
Compare
Signed-off-by: zyfjeff <tianqian.zyf@alibaba-inc.com>
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.
Thanks, some high level comments. Deferring to @adriancole and @objectiser for the detailed Zipkin review.
docs/root/intro/version_history.rst
Outdated
@@ -4,6 +4,7 @@ Version history | |||
1.9.0 (pending) | |||
=============== | |||
* access log: added a :ref:`JSON logging mode <config_access_log_format_dictionaries>` to output access logs in JSON format. | |||
* tracing: added support for Zipkin tracer of b3 single header format. |
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.
alpha order please
namespace { | ||
constexpr int FormatMaxLength = 32 + 1 + 16 + 3 + 16; // traceid128-spanid-1-parentid | ||
bool validSamplingFlags(char c) { | ||
if (c == '1' || c == '0' || c == 'd') |
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.
braces
const Http::LowerCaseString X_B3_SAMPLED{"X-B3-Sampled"}; | ||
const Http::LowerCaseString X_B3_FLAGS{"X-B3-Flags"}; | ||
|
||
// Zipkin b3 siggle header |
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.
typo "siggle"
Signed-off-by: tianqian.zyf <tianqian.zyf@alibaba-inc.com>
Signed-off-by: zyfjeff <tianqian.zyf@alibaba-inc.com>
if you want to try this out in real life you can put your envoy around this
and propagate b3: tracid-spanid
https://github.com/openzipkin/brave-webmvc-example
check zipkin and see if it works end to end. I am good on this change.
|
@adriancole I found a bug The following case will cause the if condition to be false, pos is not incremented and stays in the sampled position, causing the following to testcase:
And https://github.com/openzipkin/brave/blob/master/brave/src/main/java/brave/propagation/B3SingleFormat.java#L207 is a dead code, Because 194 lines has been verified |
thanks again! I will look into it now
|
right we were making the log statement, though still falling back (as
opposed to raising an exception and breaking the request). To add log
verification in unit tests is annoying but worth it. will fix :P
|
Signed-off-by: tianqian.zyf <tianqian.zyf@alibaba-inc.com>
Signed-off-by: zyfjeff <tianqian.zyf@alibaba-inc.com>
fixed in 5.4.4 you can also retry the example if you like. logs should be
prettier now
|
@zyfjeff ps I've spoken to a number of sites who are not thrilled that envoy still emits data in zipkin v1 format. I think you can win even more friends if you have cycles to do v2 data format (json or proto3) as well. This would work in zipkin, but also clones of it like jaeger (who also accept zipkin v2 data) and all the myriad of proxies. |
I am not familiar with zipkin v2 data format, related documents?I can see first |
Not sure if there are different docs but I did find https://zipkin.io/zipkin-api/#/ which appears to be v2. |
I am not familiar with zipkin v2 data format, related documents?I can see
first
I opened a new issue. Hope you can help!
#4839
I can help review and also point you at java code if you want.
|
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.
LGTM, a few small comments. Thank you!
Signed-off-by: tianqian.zyf <tianqian.zyf@alibaba-inc.com>
4db0b84
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.
Thanks!
Thanks to @zyfjeff for finding this! See envoyproxy/envoy#4712 (comment)
Signed-off-by: zyfjeff tianqian.zyf@alibaba-inc.com
Description: Implement "b3 single" header format for zipkin
Risk Level: medium
Testing: unittest
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue] #4289
[Optional Deprecated:]