Skip to content

add pid to log lines from parent process - #7290

Merged
andrewnitu merged 1 commit into
mainfrom
andrewnitu/json-log-pid
Sep 15, 2026
Merged

andrewnitu merged 1 commit into
mainfrom
andrewnitu/json-log-pid

Conversation

@andrewnitu

@andrewnitu andrewnitu commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What

This PR adds 'pid' to log lines from the parent worker process (logs such as registered worker, HTTP server listening, preloading plugins) where the pid is not already present.

Lines from the child processes already carry pid so no need to add it here.

NOTE: This doesn't cover all possible lines, e.g. lines printed via print() without using the logger, lines from imported libraries, etc. Might be ways around this but not sure at the moment.

JS parity

JS SDK already emits pid from both parent processes and child processes.

Testing

Verified on a hosted agent in staging: parent lines pid: 1, job child 50, prewarmed child 122, no JSON line without a pid.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@andrewnitu andrewnitu changed the title cli: emit pid on every JSON log line emit pid on every log line Sep 15, 2026
@andrewnitu andrewnitu changed the title emit pid on every log line add pid to log lines from parent process Sep 15, 2026
@andrewnitu
andrewnitu marked this pull request as ready for review September 15, 2026 18:14
@andrewnitu
andrewnitu requested a review from a team as a code owner September 15, 2026 18:14
@theomonnom

theomonnom commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

This isn't going to work for any native libraries, since they don't use the Python logger. We have the same issue on the job processes

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@andrewnitu

Copy link
Copy Markdown
Contributor Author

@theomonnom agreed, I noted that in the description. But it's better than what was before :-)

we have to come up with another solution if we want to capture those.

@andrewnitu
andrewnitu merged commit 9d395c3 into main Sep 15, 2026
38 of 39 checks passed
@andrewnitu
andrewnitu deleted the andrewnitu/json-log-pid branch September 15, 2026 23:57
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

Successfully merging this pull request may close these issues.

2 participants