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

+ core: provide span propagation codec for "uber-trace-id", default jaeger format #606

Conversation

slavaschmidt
Copy link
Contributor

Copy link
Contributor

@ivantopo ivantopo left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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))
Copy link
Contributor

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 😕

Copy link
Contributor Author

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.

@ivantopo
Copy link
Contributor

ivantopo commented Apr 6, 2020

Hey @slavaschmidt, I just cherry-picked this PR and merged via 25cc4ff. Thanks a lot for the contribution!

@ivantopo ivantopo closed this Apr 6, 2020
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.

2 participants