-
Notifications
You must be signed in to change notification settings - Fork 233
Supports spans filtering before reporting #471
Comments
Spans cannot be skipped based on some random condition, because it will result in broken causality links |
Most of the tiny spans are leafs, I hope it can be skipped if works as expected (fast and without error and debug) to save network traffic and keep trace more cleaner. |
Skip base on duration, If parent is skipped then all of children are skipped, no orphan span survives, It's safe, am I right? |
The problem is that the way you propose to do it (with a predicate) does not take into account if those spans are leaves or not. So if instrumentation, say, has an internal span around some function, its duration very well may be short, but if it's skipped it will break the rest of the trace subtree. I think span pruning is a useful feature, but we need to find a better way to implement it. I haven't put too much thought into it so far, but perhaps the following might work:
I think DataDog's clients support something similar, maybe it's worth looking into how they are doing that. |
You would also need to know whether a span's context had been extracted, as an indication that it had been propagated to another service, and therefore the pruning should preserve that span. |
@yurishkuro That's what I want, I think it's a little related to my previous #465 . |
Requirement - what kind of business use case are you trying to solve?
Most short spans is verbose, Tracer should provide a option let application to decide which spans should be simply dropped, and those spans should never be dropped :
Proposal - what do you suggest to solve the problem or improve the existing situation?
Sample Code:
I'm not sure the name "spanPredicate" is accurate.
The text was updated successfully, but these errors were encountered: