mtth / tracing

Distributed tracing
https://hackage.haskell.org/package/tracing
BSD 3-Clause "New" or "Revised" License
24 stars 11 forks source link

Allow 16 lower-hex character TraceId's #12

Closed alaendle closed 3 years ago

alaendle commented 3 years ago

The spec seems to allow 16 lower-hex character TraceId's: https://github.com/openzipkin/b3-propagation#traceid-2

However the parser checks explicit for a length of 16 bytes (32 hex character): https://github.com/mtth/tracing/blob/82bdea2b1f96b7a16fb7334c0f35c74d2f188c56/src/Control/Monad/Trace/Internal.hs#L45

The workaround/solution is simple - just add 16 times '0' if the TraceId string is shorter than expected; however this is something that the library could handle.

mtth commented 3 years ago

Thanks for bring this up. I'd be happy to merge a PR allowing this.