-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add V1 to V2 conversion logic. #100
Conversation
py_zipkin/utils/_thrift_decoder.py
Outdated
|
||
def _write_hex_long(data, pos, value): | ||
""" | ||
Writes an unsigned long value across a byte array. |
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.
might want to qualify big endian
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.
PS I am happy once you are comfortable with unit test coverage
b98e452
to
cb91631
Compare
cb91631
to
24fbc6f
Compare
I've rewritten most of this logic since the previous version had several errors and I couldn't understand it. The new code might be missing some corner cases, but we can add those as we find them. Some of the corner cases were for merged client/server which we should never encounter since the merging is now done in the ui. I realized that since |
Test coverage is still < 100%, I'll try to fix that. I'm also not yet 100% sure this code works correctly every time. I'll run it a bit more in dev and make sure the output is reasonable. |
Also, the diff is huge since I moved |
thanks for the updates!
… |
This will better split out the logic and make it easier to add decoders in Yelp#100
24fbc6f
to
a7696e7
Compare
a7696e7
to
ba1414d
Compare
ba1414d
to
5635cb0
Compare
_V2_ATTRIBUTES = ["tags", "localEndpoint", "remoteEndpoint", "shared", "kind"] | ||
|
||
|
||
def detect_span_version_and_encoding(message): |
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.
your code is neater than mine :D
This logic is very convoluted and the code is not pythonic, however we
tried to stay as close as possible to the openzipkin/zipkin
implementation so that it'd be easier to port over future fixes.
@adriancole This is logic that @msindwan wrote a while ago to convert v1 thrift spans to v2 json. This PR is still a work in progress, but can you have a look at whether the code makes sense.
We didn't really know what a bunch of these edge cases protect against, but decided it was best to just replicate the exact same code as zipkin-server.
Also, I'm adding this here due to the discussion we had last Thursday of providing tools to convert v1 to v2. But I'm also fine if we decide this shouldn't live here