-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Active Job reporter reports incorrect data if a job is run within another job via perform_now
#2467
Comments
right, technically if we're in the same process and not in the worker, we could just start a span instead. I'll have to see what the best way of detecting this is though, or maybe not patch |
When I reported this bug, option 2 is what I was expecting:
But I can also see your argument that that behaviour may be confusing and depends on the user's expectations. The reason I expected this behaviour is that when I see an exception reported as coming from In our application, this behaviour lead to confusion about which job execution was actually failing.
I don't really see it that way - I see Either way, if some controller code executes |
First of all, So using "which process this exception is raised at" to decide what the transaction attribute should be is a wrong assumption. A better question would be: "Does having a separate transaction for And I'm torn on this one because:
Any thoughts? @sl0thentr0py @solnic |
Agree with @st0012's two points. I just want to add one more point.
In general, Sentry is gradually shifting to a trace-centric UI where the actual transaction will not be the primary model of organizing, so this discussion is somewhat less relevant from a future point of view. As long as the job is part of the trace irrespective of it being a new transaction or not, we should be good. |
Issue Description
Sentry's Active Job reporting code works by prepending a module to overload the
perform_now
method.This has the outcome that if one job runs the code in another job via
perform_now
, and an error occurs, the transaction and context will be reported as the inner job, even though it's the outer job being run.Similarly, we may not even be in a job run at all, e.g. if some controller calls
perform_now
on a job, the context will be wrong. It will look like the error occurred in a worker process, when it actually occurred in a web process.Reproduction Steps
Call
AJob.perform_later
.Expected Behavior
Transaction/context is reported from
AJob
.Actual Behavior
Transaction/context is reported from
BJob
.Ruby Version
3.3.5
SDK Version
5.21.0
Integration and Its Version
No response
Sentry Config
No response
The text was updated successfully, but these errors were encountered: