mtth / tracing

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

Provide better support for a "root-consumer-span"? #24

Closed alaendle closed 9 months ago

alaendle commented 10 months ago

Similar to #11 - should we strive for a similar API extension that was done to support root-producers? Or will this clutter the API?

As always implementing this is already possible:

TC.rootSpanWith (ZPK.addInheritedTag (cs "service.instance.id") serviceInstance . \builder -> builder { TC.builderTags = M.insert (cs "z.k") (JSON.toJSON "CONSUMER") (TC.builderTags builder) })

Might be a rather rare scenario - in my case we have a simple MQTT3 producer which isn't able to create/transfer traces on it's own, so our consumer should create the root span.

mtth commented 9 months ago

Sounds reasonable to me. I'd be happy to review a PR that does the same as https://github.com/mtth/tracing/pull/15 for consumers.