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

fix: http trace exporter fix network byte order on little endian machines #105

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

krynju
Copy link
Collaborator

@krynju krynju commented Apr 11, 2024

Noticed that the span and trace ids were reversed once uploaded to the collector
Turns out we assumed endianess of the machine, so on big endian it (would) work fine, but on little endian the bytes were reversed

we need to use hton to convert machine endianess to network order

example

julia> reinterpret(UInt8, [0x18178a164dff94cc2d9651beb5749db7])
16-element reinterpret(UInt8, ::Vector{UInt128}):
 0xb7
 0x9d
 0x74
 0xb5
 0xbe
 0x51
 0x96
 0x2d
 0xcc
 0x94
 0xff
 0x4d
 0x16
 0x8a
 0x17
 0x18

julia> reinterpret(UInt8, [hton(0x18178a164dff94cc2d9651beb5749db7)]) 
16-element reinterpret(UInt8, ::Vector{UInt128}):
 0x18
 0x17
 0x8a
 0x16
 0x4d
 0xff
 0x94
 0xcc
 0x2d
 0x96
 0x51
 0xbe
 0xb5
 0x74
 0x9d
 0xb7



@krynju krynju merged commit fb0439e into oolong-dev:master Apr 11, 2024
4 checks passed
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.

None yet

1 participant