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
Hey folks, I've been trying to understand tracing's internals better and there's a question that's been bugging me and I haven't been able to figure it out.
Let's imagine we've got something like this, ignoring the fact both subscribers are FmtSubscribers here:
We've got two subscribers with a per-subscriber filter each. None of the filters have "dynamics", so the static callsite should be enough to say that the first one is an Always and the second one is a Never.
When the callsites are registered through a Filtered, it looks like they are combined into a Sometimes in the FILTERING thread local.
This then ends up calling enabled on the collector for every single event. From my perspective, in this specific example, it looks like enabled would always return true for this callsite. When it comes to per-subscriber filters, only if all of them return false would the overall enabled return false.
I get that enabled is used by each filter to evaluate their filter and store it in FILTERED. What I'm wondering is why can't we skip enabled by returning Always here? Then the filtering could still be done in event_enabled? ?
Note: This is not a problem, just seeking to understand internals a bit better.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey folks, I've been trying to understand tracing's internals better and there's a question that's been bugging me and I haven't been able to figure it out.
Let's imagine we've got something like this, ignoring the fact both subscribers are FmtSubscribers here:
We've got two subscribers with a per-subscriber filter each. None of the filters have "dynamics", so the static callsite should be enough to say that the first one is an Always and the second one is a Never.
When the callsites are registered through a Filtered, it looks like they are combined into a
Sometimes
in theFILTERING
thread local.This then ends up calling enabled on the collector for every single event. From my perspective, in this specific example, it looks like
enabled
would always returntrue
for this callsite. When it comes to per-subscriber filters, only if all of them return false would the overall enabled return false.I get that enabled is used by each filter to evaluate their filter and store it in
FILTERED
. What I'm wondering is why can't we skip enabled by returningAlways
here? Then the filtering could still be done inevent_enabled?
?Note: This is not a problem, just seeking to understand internals a bit better.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions