You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey I just got the library working and am pretty grateful!
tl;dr - duration is too high precision for jaeger/zipkin by default for spans (maybe it should be abstracted into another type to ensure max precision?), also current calculation using toMicros might be wrong
I noticed one small issue (that I just fixed) -- Span durations that are getting sent to Jaeger are actually too precise for it to parse, you end up getting an response like this:
[2018-04-1201:52:40JST:App.Tracing:DEBUG] ZipkinResp:Just (Response {
responseStatus =Status {statusCode =400, statusMessage ="Bad Request"},
responseVersion =HTTP/1.1,
responseHeaders = [("Content-Type","text/plain; charset=utf-8"),("X-Content-Type-Options","nosniff"),("Date","Wed, 11 Apr 2018 16:52:40 GMT"),("Content-Length","120")],
responseBody ="Unable to process request body: json: cannot unmarshal number 1500.525 into Go struct field Span.duration of type int64\n",
responseCookieJar =CJ {expose =[]},
responseClose' =ResponseClose
})
(I included more output here, but you can see Zipkin has a problem too it's just less descriptive about it)
So what I did was implement a method that reduced the precision (yikes?):
--^ Reduce the precision of the NominalDiffTime objects that are being sent-- this is necessary because the following error gets sent from Jaeger (when sending a NominalDiffTime of "0.001500525s" ):-- "Unable to process request body: json: cannot unmarshal number 1500.525 into Go struct field Span.duration of type int64\n"-- (running regular zipkin will just produce a "failed to parse" error with no details)reducePrecision:: (Numa, RealFraca) =>Int->a->a
reducePrecision places = (/ factor) .fromInteger.round. (* factor)
where
factor =10^ places
That said, I'm actually generating my Spans manually (not using the monad transformers provided by the library), but I find that when I copy your approach in publishZipkin w/ toMicros, I get the wrong result in Jaeger I think:
The most recent trace was using toMicros instead of the reducePrecision I wrote. As I'm somewhat outside of the usual case (not using the Monad transformer you provided, building the Span myself), please feel free to let me know if you're not seeing this issue, maybe I misread the code using toMicros and it's doing something more.
PS: I also tried with zipkin and see both things happening (duration used as-is not working and the wrong timing when using toMicros as I saw it being used):
The text was updated successfully, but these errors were encountered:
Hey I just got the library working and am pretty grateful!
tl;dr - duration is too high precision for jaeger/zipkin by default for spans (maybe it should be abstracted into another type to ensure max precision?), also current calculation using
toMicros
might be wrongI noticed one small issue (that I just fixed) --
Span
durations that are getting sent to Jaeger are actually too precise for it to parse, you end up getting an response like this:(I spaced out the response for readability)
Zipkin does the same thing:
(I included more output here, but you can see Zipkin has a problem too it's just less descriptive about it)
So what I did was implement a method that reduced the precision (yikes?):
That said, I'm actually generating my
Span
s manually (not using the monad transformers provided by the library), but I find that when I copy your approach inpublishZipkin
w/toMicros
, I get the wrong result in Jaeger I think:The most recent trace was using
toMicros
instead of thereducePrecision
I wrote. As I'm somewhat outside of the usual case (not using the Monad transformer you provided, building the Span myself), please feel free to let me know if you're not seeing this issue, maybe I misread the code usingtoMicros
and it's doing something more.PS: I also tried with zipkin and see both things happening (duration used as-is not working and the wrong timing when using
toMicros
as I saw it being used):The text was updated successfully, but these errors were encountered: