-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpanProcessor called even when isStartRequired / isEndRequired are false #5930
Comments
Seems like a minor bug...why would you build a span processor that literally didn't want to ever see spans, either on start or on finish/ |
This shows we call onEnd even if only isOnStartRequired=true, and we call onStart even if only isOnEnd=true. |
The test case posted above has both set to false. Am I missing something? |
Sorry I mispoke. The example shows isStartRequired=false and isEndRequired=false, and both getting called anyway. But it doesn't actually matter what isStartRequired and isEndRequired are set to. In general, if only on span processor is added, the responses of isStartRequired and isEndRequired are ignored and both onStart and onEnd are always called. |
🤔 has this always been the case? what a weird bug to last this long. |
Not sure, I think probably yes. Oddly, we rely on MultiSpanProcessor to decide whether to call onStart / onEnd. Its constructor is the only place in the code base which calls isStartRequired / isEndRequired. So the bug exists because we transform all the registered processors into a single MultiSpanProcessor, except when there's exactly 1 processor because of this code. It is definitely a weird bug to have made it this far. |
The following test shows a span processor which doesn't require start or end, and despite this, onStart and onEnd are called! Yikes!
The text was updated successfully, but these errors were encountered: