You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code here is currently doing more things than it needs to, as it should be possible to leverage the baggage apis in 5.11+. Currently, the main thing needed is to influence the localSampled decision.
Another option is to not do that.. if we accept turning local sampling on 100% of the time, the design gets very easy.
Right now, when we either know this root is secondary sampling, or think it might be, we locally sample the span. If we thought it might be, but it ends up not needed, we just drop it. If we always sample local, then we don't need to intercept context creation. The tradeoff is needless overhead when no secondary sampling occurs (in process). OTOH if there's any other listener for all spans, like metrics, that wouldn't be needless overhead as the other consumer would still use the data collected.
Basically the design is simpler if we always sample locally, but there's more GC churn for possibly no benefit. I'm inclined to keep the context hook to avoid that, but it is a decision worth re-thinking now that there's some practice.
@narayaruna any thoughts on this or experience to share? cc also @anuraaga
The text was updated successfully, but these errors were encountered:
The code here is currently doing more things than it needs to, as it should be possible to leverage the baggage apis in 5.11+. Currently, the main thing needed is to influence the localSampled decision.
Another option is to not do that.. if we accept turning local sampling on 100% of the time, the design gets very easy.
Right now, when we either know this root is secondary sampling, or think it might be, we locally sample the span. If we thought it might be, but it ends up not needed, we just drop it. If we always sample local, then we don't need to intercept context creation. The tradeoff is needless overhead when no secondary sampling occurs (in process). OTOH if there's any other listener for all spans, like metrics, that wouldn't be needless overhead as the other consumer would still use the data collected.
Basically the design is simpler if we always sample locally, but there's more GC churn for possibly no benefit. I'm inclined to keep the context hook to avoid that, but it is a decision worth re-thinking now that there's some practice.
@narayaruna any thoughts on this or experience to share? cc also @anuraaga
The text was updated successfully, but these errors were encountered: