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 support for json encoding, notably zipkin2 format #48

Merged
merged 1 commit into from
Aug 13, 2017

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Aug 12, 2017

Before the AWS transports only supported thrift encoding. This adds json
support, which will notably be used for zipkin2 format.

This uses the recently released detecting decoder to support the new
Span2 format defined in openzipkin/zipkin#1499

@@ -136,7 +137,6 @@ private void sendSpansInternal(List<Span> spans) {

private static List<Span> fromBase64(String base64) {
byte[] bytes = Base64.decode(base64);
return Codec.THRIFT.readSpans(bytes);
return SpanDecoder.DETECTING_DECODER.readSpans(bytes);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works with all the formats and prevents us from needing to access internal classes (for the not yet released span2 type)

@@ -68,6 +69,9 @@ public static Builder builder() {
/** Maximum size of a message. Kinesis max message size is 1MB */
Builder messageMaxBytes(int messageMaxBytes);

/** Allows you to change to json format. Default is thrift */
Builder encoding(Encoding encoding);
Copy link
Member Author

@codefromthecrypt codefromthecrypt Aug 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: "encoding" is thrift or json, the "encoder" says how to encode in thrift or json. So, this automatically works with any format, span1 or span2

Before the AWS transports only supported thrift encoding. This adds json
support, which will notably be used for zipkin2 format.

This uses the recently released detecting decoder to support the new
Span2 format defined in openzipkin/zipkin#1499
@codefromthecrypt codefromthecrypt changed the title Adds support for json encoding Adds support for json encoding, notably zipkin2 format Aug 12, 2017
@codefromthecrypt codefromthecrypt merged commit 1ec3daf into master Aug 13, 2017
@codefromthecrypt codefromthecrypt deleted the json-encoding branch August 13, 2017 00:21
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