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

Adds Brave Encoding support for v2 #208

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Adds Brave Encoding support for v2 #208

merged 1 commit into from
Jan 9, 2024

Conversation

codefromthecrypt
Copy link
Member

This adds two new artifacts to allow StackdriverSender to have no zipkin dependency:

  • zipkin-encoder-stackdriver: zipkin2.Span encoder from before
  • brave-encoder-stackdriver: new brave.handler.MutableSpan encoder

The main change is StackdriverEncoder.V2 is moved to a new package: zipkin2.reporter.stackdriver.zipkin, where it was formerly one level up. This is the part that decouples the classpath.

Most won't use this encoder anymore as you can use Brave directly like so:

spanHandler = AsyncZipkinSpanHandler.newBuilder(sender).build(new StackdriverV2Encoder(Tags.ERROR));

This adds two new artifacts to allow StackdriverSender to have no zipkin
dependency:
 * zipkin-encoder-stackdriver: zipkin2.Span encoder from before
 * brave-encoder-stackdriver: new brave.handler.MutableSpan encoder

The main change is `StackdriverEncoder.V2` is moved to a new package:
`zipkin2.reporter.stackdriver.zipkin`, where it was formerly one level
up. This is the part that decouples the classpath.

Most won't use this encoder anymore as you can use Brave directly like
so:

```java
spanHandler = AsyncZipkinSpanHandler.newBuilder(sender).build(new StackdriverV2Encoder(Tags.ERROR));
```

Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt
Copy link
Member Author

FYI classes and tests for the brave encoder were ported from the translation module as abstracting was messier.

@codefromthecrypt
Copy link
Member Author

benchmarks

Benchmark                                                                           Mode  Cnt    Score   Error  Units
TracesParserBenchmarks.parse100ClientSpans                                          avgt   15  136.369 ± 2.955  us/op
TracesParserBenchmarks.parseClientSpan                                              avgt   15    1.362 ± 0.026  us/op
brave.StackdriverV2EncoderBenchmarks.encodeClientSpan_json_stackdriver_proto3       avgt   15    0.778 ± 0.014  us/op
brave.StackdriverV2EncoderBenchmarks.encodeClientSpan_json_zipkin_json              avgt   15    0.464 ± 0.003  us/op
brave.StackdriverV2EncoderBenchmarks.sizeInBytesClientSpan_json_stackdriver_proto3  avgt   15    0.346 ± 0.003  us/op
brave.StackdriverV2EncoderBenchmarks.sizeInBytesClientSpan_json_zipkin_json         avgt   15    0.070 ± 0.001  us/op
zipkin.StackdriverEncoderBenchmarks.encodeClientSpan_json_stackdriver_proto3        avgt   15    0.672 ± 0.007  us/op
zipkin.StackdriverEncoderBenchmarks.encodeClientSpan_json_zipkin_json               avgt   15    0.409 ± 0.003  us/op
zipkin.StackdriverEncoderBenchmarks.sizeInBytesClientSpan_json_stackdriver_proto3   avgt   15    0.281 ± 0.002  us/op
zipkin.StackdriverEncoderBenchmarks.sizeInBytesClientSpan_json_zipkin_json          avgt   15    0.054 ± 0.001  us/op

@codefromthecrypt codefromthecrypt merged commit 0142330 into master Jan 9, 2024
3 checks passed
@codefromthecrypt codefromthecrypt deleted the new-2.0 branch January 9, 2024 23:25
This pull request was closed.
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.

1 participant