Skip to content
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

Access pipeline.assigns or parent PID from job? #348

Open
bgentry opened this issue Oct 31, 2018 · 3 comments
Open

Access pipeline.assigns or parent PID from job? #348

bgentry opened this issue Oct 31, 2018 · 3 comments

Comments

@bgentry
Copy link

bgentry commented Oct 31, 2018

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!

@foeken
Copy link

foeken commented Jan 8, 2019

Anybody able to solve this one? Working on a similar problem.

@ananthakumaran
Copy link
Collaborator

Process.info(self(), :links) is a hack that can be used within the job to get the parent id.

@ananthakumaran
Copy link
Collaborator

The proper way would be to expose the pipeline via Exq.worker_pipeline(), like we do for Exq.worker_job()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants