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
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.
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 perform_now but the enqueue/execute separately.
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: