-
Notifications
You must be signed in to change notification settings - Fork 70
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
brave: adds PROTO3 encoding #252
Conversation
This adds `MutableSpanEncoder.PROTO3` similar to what's available for `zipkin2.Span`. The code and tests are based on similar inside zipkin and brave. This is added to the reporter, not brave, to reduce version lock-up for a useful, but more rare encoding type. Fixes #178
Signed-off-by: Adrian Cole <adrian@tetrate.io>
brave/src/test/java/zipkin2/reporter/brave/JsonV2RoundTripTest.java
Outdated
Show resolved
Hide resolved
This adds 24KB to the brave jar, which I think is not enough for people to fuss about. |
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Note: write speed is less than json, which might not seem intuitive. However, there is some work to do converting string IPs to their binary representation. Similarly, we need to decode the hex IDs. So, if you were expecting dramatically different encoding speed, bear this in mind. It is in the same ballpark as JSON even if on the wire will be smaller and of course other advantages of proto. I'll post benchmarks in a few minutes when they complete. |
actually I got found the biggest issue and now proto is not as slow encoding. Regardless, this isn't new just something I noticed looking closely. zipkin-core cheats by coercing IPs to bytes in the critical path. Someone who wants to mess around and improve the ipv6 writer more, but anyway encoding is off-thread. The most important latency is sizeOfBytes which is a guard to make sure a span isn't too big to send. This is faster in proto a lot. |
Signed-off-by: Adrian Cole <adrian@tetrate.io>
updating the ipv6 writing code to latest guava (as the previous snippet copied allocated a lot..) did the trick. proto is now as fast or faster than json as one might expect. @anuraaga I'm done mucking around if you have time for a look. only other thing I'll do here is bump to brave 6.0.1 which is releasing now. |
thanks for all the reviews, @anuraaga! I'll do a quick test with micrometer+spring boot prior to cutting the release. |
This adds
MutableSpanEncoder.PROTO3
similar to what's available forzipkin2.Span
. The code and tests are based on similar inside zipkin and brave. This is added to the reporter, not brave, to reduce version lock-up for a useful, but more rare encoding type.Fixes #178