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

Reports 128-bit ids to Zipkin #34

Merged
merged 1 commit into from
Nov 20, 2016
Merged

Reports 128-bit ids to Zipkin #34

merged 1 commit into from
Nov 20, 2016

Conversation

codefromthecrypt
Copy link

This allows Wingtips to report 128-bit trace IDs to Zipkin, by parsing
this high bits of a 32-character hex-encoded ID.

See openzipkin/b3-propagation#6

@codefromthecrypt
Copy link
Author

Note: this doesn't initiate 128-bit traces. This might be desired at some point. For example Brave has the following builder to do that. Note span ids in a trace are still 64-bit.

Brave.Builder.traceId128Bit(true)

@codecov-io
Copy link

codecov-io commented Nov 18, 2016

Current coverage is 98.53% (diff: 81.81%)

Merging #34 into master will decrease coverage by 0.27%

@@             master        #34   diff @@
==========================================
  Files            12         12          
  Lines           674        682     +8   
  Methods           0          0          
  Messages          0          0          
  Branches        121        124     +3   
==========================================
+ Hits            666        672     +6   
- Misses            2          3     +1   
- Partials          6          7     +1   

Powered by Codecov. Last update 9fa505f...94c2328

@@ -245,6 +245,7 @@ public void unsignedLowerHexStringToLong_throws_NumberFormatException_for_illega
@Override
public void call() throws Throwable {
TraceAndSpanIdGenerator.unsignedLowerHexStringToLong(badHexString);
TraceAndSpanIdGenerator.unsignedLowerHexStringToLong(badHexString, 0);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this line will ever be reached - the test data is setup so that it should blow up on the previous line.

@codefromthecrypt
Copy link
Author

codefromthecrypt commented Nov 19, 2016 via email

@nicmunroe
Copy link
Member

@adriancole whatever you want to do is fine - feel free to duplicate the test, or add another dimension. Either way. If you want to add another dimension and you're not familiar with the com.tngtech.java:junit-dataprovider all you should have to do is separate the new dimension with a | pipe, something like:

@DataProvider(value = {
        "                                      |    true", // less than 16 chars
        "                                      |    false", // less than 16 chars
        "123e4567-e89b-12d3-a456-426655440000  |    true", // longer than 32 chars
        "123e4567-e89b-12d3-a456-426655440000  |    false", // longer than 32 chars
etc etc

And then add the new dimension to the method args: public void huge_long_method_name(final String badHexString, boolean goodNameForNewDimension).

This allows Wingtips to report 128-bit trace IDs to Zipkin, by parsing
this high bits of a 32-character hex-encoded ID.

See openzipkin/b3-propagation#6
@codefromthecrypt
Copy link
Author

thanks.. I rejigged the one test to show the parsing exceptions were the same regardless of offset. Then, made one that looks redundant, but I think useful to have in the context of where this is all put together.

@nicmunroe
Copy link
Member

Looks great. I'll go through at some point and fill in the remaining code coverage - it'll be good for me to make sure I understand 100% what you added. And I added a ticket for optionally supporting 128 bit trace ID initiation. Thank you!

@nicmunroe nicmunroe merged commit 38d8ce8 into Nike-Inc:master Nov 20, 2016
@codefromthecrypt codefromthecrypt deleted the report-128 branch November 20, 2016 09:01
@codefromthecrypt
Copy link
Author

thanks for the support!

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.

3 participants