-
Notifications
You must be signed in to change notification settings - Fork 713
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
Introduces SpanIdGenerator, used to control id generation. #110
Conversation
ec89406
to
7435c70
Compare
Hm, the difficult problem here is the encoding of the IDs on the wire once they are made opaque. Right now Brave doesn't have that since SpanId class still prescribes a Zipkin-esque structure. If you make SpanId completely opaque like I have in opentracing-go, you have to address two issues, (a) provide pluggable serialization mechanism (e.g. StringPickler in opentracing-go), and (b) find a way to deal with binary protocols, such as TChannel, which assumes tracing info to be of fixed length, and specifically to be Zipkin-esque. That last part is an unfortunate design choice in TChannel, imo, but the fixed length within a binary frame can be a common limitation. Just curious, are you suggesting one of the ID implementations to be path-like IDs |
* can encode where in the call tree the span originates from, or use alternate | ||
* random number generators. | ||
*/ | ||
// @FunctionalInterface |
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.
Uncomment?
(edit): oh, brave supports 1.7.
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.
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.
PTAL updated the comment!
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.
I guess adding a note like // @FunctionalInterface (commented out because of Java 7 support)
or // @FunctionalInterface (uncomment after dropping Java 7 support)
would help. But it's a minor thing :)
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.
I added this last comment before seeing your changes. It's ok :)
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, Yuri
Appreciate the feedback, but this wasn't an attempt to make brave not
zipkin. You'll notice that requires far more work than this (ex. Zipkin
span is used everywhere). This is mainly to make it possible to control id
generation for the existing use cases without breaking compat.
In other words a strategic move to be more different is indeed interesting,
but I would at least title the pull request more profoundly if that were my
intent!
|
Ex at Twitter, different random seeds were used by device to avoid Also trace ids are not mutated once created, so when brave creates a trace, |
7435c70
to
5e444cd
Compare
Changing the way we generate span IDs was a suggestion from the Budapest workshop, Autolytics' software memory did something similar. |
ahh so you weren't referring to encoding into the bytes, more changing the
structure of the ids so that they can hold a tree. gotcha.
|
I'll remove the "encoding" part as I think this doesn't solve that problem as I now understand it. cheers. |
There are a few use cases that support decoupling ID generation * allow an alternate random generator, or change its seed to avoid collisions * opt out of span id == trace id for the root span * make trace-id a request-id, for log correlation, regardless of sampling * make Brave easier to test
5e444cd
to
22963e4
Compare
ok code is the same, but I updated the description/commit message |
PS this is no longer blocking me, as I found a way around it. We can close
this or park it if there's no other person interested.
|
Here's some rationale from @jcarres-mdsol about trace-id vs span-id
|
closing for lack of interest and need. can always re-open |
There are a few use cases that support decoupling ID generation
See openzipkin/zipkin#849