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

WIP: Support for 128 bit TraceIDs #31

Merged
merged 5 commits into from
Oct 26, 2016
Merged

WIP: Support for 128 bit TraceIDs #31

merged 5 commits into from
Oct 26, 2016

Conversation

basvanbeek
Copy link
Member

This PR handles the ability of the tracer to work with 128 bit TraceIDs.

See: openzipkin/zipkin#1298

Copy link

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

looks great!

@basvanbeek
Copy link
Member Author

this PR has been tested with 64 bit traceID Zipkin instance and is backwards compatible if tracing with 128 bit traceIDs by simply having the high bits of the traceID be ignored.

Sampling functionality is also solely on the low 64 bits.

This PR will be merged once Zipkin backend supports 128 bit TraceIDs.

@codefromthecrypt
Copy link

I ran the example against snapshot zipkin and looks great!

   {
      "traceId": "15225468d9e004834ec2cc8befaf251f",
      "id": "3230ce0f79a9b1d9",
      "name": "mycomplexquery",

@codefromthecrypt
Copy link

ps for those unacclimated, here's what I did to test..

$ export GOPATH=$HOME/work
$ export PATH=$PATH:$GOPATH/bin
$ cd $GOPATH/src/github.com/openzipkin/zipkin-go-opentracing/examples/cli_with_2_services
$ git checkout -t -b 128bit-traceid origin/128bit-traceid
$ make
$ build/svc1&
$ build/svc2&
$ build/cli

@basvanbeek
Copy link
Member Author

awesome... sounds like merge time to me!

@basvanbeek basvanbeek merged commit c2f58fe into master Oct 26, 2016
@basvanbeek basvanbeek deleted the 128bit-traceid branch October 26, 2016 11:27
codefromthecrypt pushed a commit to openzipkin/brave that referenced this pull request Oct 27, 2016
Traditionally, Zipkin trace IDs were 64-bit. Starting with Zipkin 1.14,
128-bit trace identifiers are supported. This can be useful in sites that
have very large traffic volume, persist traces forever, or are re-using
externally generated 128-bit IDs.

If you want Brave to generate 128-bit trace identifiers when starting new
root spans, set `Brave.Builder.traceId128Bit(true)`

When 128-bit trace ids are propagated, they will be twice as long as
before. For example, the `X-B3-TraceId` header will hold a 32-character
value like `163ac35c9f6413ad48485a3953bb6124`.

Before doing this, ensure your Zipkin setup is up-to-date, and downstream
instrumented services can read the longer 128-bit trace IDs.

Note: this only affects the trace ID, not span IDs. For example, span ids
within a trace are always 64-bit.

See openzipkin/zipkin#1298
See openzipkin-contrib/zipkin-go-opentracing#31
richardmarshall pushed a commit to richardmarshall/zipkin-go-opentracing that referenced this pull request Dec 13, 2016
…rtcard

Minor fixes to appease formatting and linting tools.
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