exq
exq copied to clipboard
Access pipeline.assigns or parent PID from job?
Hi there,
I have an Exq middleware for AppSignal that adds instrumentation (code is here). I begin the AppSignal transaction as part of the middleware. However, the job itself runs in a different process, and AppSignal's Elixir library has no way to know this is a part of the parent transaction, not unless I'm able to tell it that the child PID is related to the parent.
Is there any way to a) access the PID of the parent (i.e. the process that calls the middleware chain), or b) access the middleware pipeline.assigns from within the job?
Either of those would allow me to correlate the job itself with the parent that's running it. The existing Job metadata does not contain any such info.
Thanks!
Anybody able to solve this one? Working on a similar problem.
Process.info(self(), :links) is a hack that can be used within the job to get the parent id.
The proper way would be to expose the pipeline via Exq.worker_pipeline(), like we do for Exq.worker_job()