mtth / tracing

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

Wrong documentation - and somehow misleading API #14

Closed alaendle closed 3 years ago

alaendle commented 3 years ago

Guess this should be equivalent (or it least was once intended) , but it is not since tag adds the publicKeyPrefix while addTag doesn't.

https://github.com/mtth/tracing/blob/82bdea2b1f96b7a16fb7334c0f35c74d2f188c56/src/Monitor/Tracing/Zipkin.hs#L168-L173

Since the user of the library shouldn't now about the internal prefixes addTag is somehow useless (or at least a very low-level) function. So maybe it just should not be exported? Or it should be splited into an internal version that doesn't add a prefix and an exported version that also adds publicKeyPrefix?

mtth commented 3 years ago

You're right - this is a bug: addTag should add the public prefix. All exported functions should add it to guarantee that private prefixes are not overwritten.