-
Notifications
You must be signed in to change notification settings - Fork 65
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
wingtips-zipkin: NumberFormatException in WingtipsToZipkinSpanConverterDefaultImpl #14
Comments
Thanks for the report @jpiechowka ! Can you copy/paste an example of one of the values being sent by the Cujojs-rest Zipkin instrumentation that is failing with the We definitely want to support receiving propagation headers from Zipkin, so we'll have to come up with a solution that supports both Wingtips and Zipkin headers. |
And just to make sure I'm clear on the desired outcome here: |
This is my application with my fix applied in |
Can you just copy/paste the full |
@nicmunroe Sure! Here it is:
If you need anything more please feel free to ask. But I need to go to sleep. I will be available in couple of hours. |
@nicmunroe so I've been thinking about making a |
@jpiechowka Thanks, that's exactly what I was looking for. We'll get on this ASAP - should hopefully be a quick fix. @adriancole Yeah that's what's happening here. Is @jpiechowka 's suggestion of Context for why this bug exists - Wingtips just passes around decimal longs as strings rather than hex-encoded even when serializing to JSON, so I never considered this case. And Zipkin -> Wingtips -> * HTTP header propagation would work fine since Wingtips stores the IDs as strings internally rather than longs so it would pass through without issue. This particular case of Zipkin -> Wingtips -> Zipkin reporter fails though because the wingtips reporter assumes decimal encoded longs. |
Zipkin has a hipster hex to unsigned long parser which profiles well. Main On 18 Aug 2016 12:22, "Nic Munroe" notifications@github.com wrote:
|
@adriancole perfect! Thanks for the pointer. I only see one problem at this point - my naive initial approach to solving this problem was going to be to attempt decimal long parsing first, and if that failed with a I ran a quick test with 100 million randomly generated longs, and about 1 in every 2000 falls into this category where the hex string could be successfully parsed as a decimal encoded string. So at this point I'm thinking maybe you just have to tell the Wingtips-to-Zipkin-span-converter whether you expect hex or decimal encoded IDs, and supporting both at the same time won't be a supported use case? Or is a 0.05% incorrect ID rate an ok tradeoff? WDYT? |
Just to clarify, are you saying in wingtips that only the reporting does ids as numbers, or also header propagation? If the latter, it certainly won't be compatible with B3, which means the problem is bigger than span reporting. The impact of not using hex ids is pretty big.. this means that B3 traces that start before wingtips won't propagate compatibly into wingtips. Similarly, outbound, if a wingtips user calls a ruby app or c# B3 instrumented app, they won't join properly. My suggestion would be to phase in a change to wingtips to encode in B3 (lowerhex fixed width) by default. For example, start traces that way, and assume fixed-width 16 char ids are hex. I ack that this cleanup is dirty in the brown field. One way is to propagate a special header that knows about this change and eventually remove it once internal wingtips deployments are converged. While a punch, a punch like this is certainly better earlier than later because when B3 works the same was here as outside, users can get access to the whole ecosystem compatibly. There's probably other approaches, too. these are just my thoughts. |
Unfortunately it is the latter, but good news is cleanup shouldn't be too bad. Since wingtips uses strings for the internal model, zk -> wt -> * propagation should work fine - wingtips just passes IDs through as strings without any change. The only problem comes in when wingtips does the ID creation since wingtips-created decimal IDs won't be joined properly by a hex ID B3 tracing system. The way we collect and aggregate spans internally shouldn't be affected by changing to hex IDs so I don't think we need a phased migration strategy. I think it's just band-aid ripping time. |
Ok, I've created a new issue for switching to hex IDs for proper B3 compatibility: #15 . @jpiechowka the issue you raised here should be solved as part of the work for #15 . |
…s with lowercase hex encoding for trace and span IDs Fixes issues Nike-Inc#14 and Nike-Inc#15
…s with lowercase hex encoding for trace and span IDs Fixes issues Nike-Inc#14 and Nike-Inc#15
…s with lowercase hex encoding for trace and span IDs Fixes issues Nike-Inc#14 and Nike-Inc#15
…s with lowercase hex encoding for trace and span IDs Fixes issues Nike-Inc#14 and Nike-Inc#15
👏 On Fri, Aug 19, 2016 at 11:41 PM, Nic Munroe notifications@github.com
|
…s with lowercase hex encoding for trace and span IDs Fixes issues Nike-Inc#14 and Nike-Inc#15
@nicmunroe Great work! 👍 |
I have been trying out Wingtips with Zipkin today. I love the docs and overall simplicity of use. I created simple client-server app. Client is written using Cujojs-rest Zipkin instrumentation and Server is created in Spark web framework. When I make request from client to server, and Wingtips tries to convert strings extracted from headers to long it always ends in
NumberFormatException
inWingtipsToZipkinSpanConverterDefaultImpl
innullSafeLong()
method. The solution I found working was to add this:The text was updated successfully, but these errors were encountered: