Closed alaendle closed 3 years ago
Sounds like a reasonable thing to support. How about adding a function similar to:
producer = addTag "z.k" "PRODUCER"
Can you elaborate on the downside of b3FromSpan
? AFAICT the span is copied as-is, no parent/child relationship is added.
I'm still not sure if this corner-case justifies an expansion of the API. Nonetheless the linked PR adds an addProducerTag
method (that is needed to hide magic values) and exports the b3FromSpan
method (that is needed by the client to extract and forward the b3 identifier). I guess that this is the minimal change that is necessary to support the creation of a "root producer". Another way would be the addition of explicit rootProducerSpan
/rootProducerSpanWith
methods.
Regarding the b3FromSpan
downside I think we talked past each other. The only downside of this function was that it is needed to extract and forward the b3 information, but it wasn't exported by the module.
As always, just let me know what you think 😃
Fixed in #15 and released as 0.0.7.1
.
If I have some software that's main purpose is to generate and ingest events, I believe something like a "root-producer-span" is useful. However implementing this is already possible with the current state of the library:
The downside is that you need to copy
b3FromSpan
(also impliesparentID
) and use the 'magic' values "z.k" and "PRODUCER". So I wonder if it is worth to provide a convenience function in the library? Your thoughts? Could an additional function be an improvement? Or maybe it's better to just expose more internals likeb3FromSpan
so that client code is empowered to directly implement such things?