-
Notifications
You must be signed in to change notification settings - Fork 328
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
+ core: provide span propagation codec for "uber-trace-id", default jaeger format #606
+ core: provide span propagation codec for "uber-trace-id", default jaeger format #606
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @slavaschmidt sorry for the long wait on this one. There are a few minor comments, hopefully we will be able to merge this thing pretty soon!
private def encodeSamplingDecision(samplingDecision: SamplingDecision): Byte = samplingDecision match { | ||
case SamplingDecision.Sample => 1 | ||
case SamplingDecision.DoNotSample => 0 | ||
case SamplingDecision.Unknown => 1 // the sampling decision is mandatory in this format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be safer to default to DoNotSample
in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I wasn't sure about that. can you see the change?
val flags = (sampling + (debug << 1)).toHexString | ||
val headerValue = Seq(span.trace.id.string, span.id.string, parentContext, flags).mkString(Separator) | ||
|
||
writer.write(HeaderName, urlEncode(headerValue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the value being url-encoded? I couldn't find anything in the Jaeger docs saying that it should be like that 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TextMapCodec
on jaeger side can be configured to both flavors (urlEncoded
or not). The urlEncode reflects the default configuration. To formulate it differently, it didn't worked for us out-of-the box otherwise.
Hey @slavaschmidt, I just cherry-picked this PR and merged via 25cc4ff. Thanks a lot for the contribution! |
…as described here: https://www.jaegertracing.io/docs/1.7/client-libraries/#propagation-format