-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Bug]: Worker logs on Prism Stand-Alone Binary Not Appearing #30703
Comments
Agreed that the logs should be accessible. I'm uncertain that they should be in the prism process terminal output though. They should ideally be routed to the launching process/via API access, or visible via the prism UI. |
I had made a mistake earlier when I first looked at this. Here's how it's all going down:
Running against a stand alone prism runner is technically the "common case" we're moving towards, since that affects support for the Java and Python SDKs (and future SDKs). I know that ultimately I'd like Prism to actually write such logs to files, in some default directory and similar, and be able to surface them in the UI to some degree. Eg. Select a ParDo and get the related log information displayed in the browser. This doesn't necessarily help the command line case, short of also printing out information to the prism terminal command line like "job data and logs are found at ". That requires moving forward on not keeping everything in memory though. I can see two options, which could both be implemented since they cover different things. FlagsI do need to see what's possible for the current Java and Python SDKs, but for the current Go SDK at least, we could add a job configuration option to route worker logs to the Job Log messages. This could be set as a flag stand alone prism flag for the process's default, and overridden on a per job level via Pipeline Options. That would then allow SDKs that are downloading and starting prism by default to set that configuration since it would support most test uses, and selectively by the user on either the pipeline launch, or the prism launch. This helps auto-solve debugging running in Docker containers too. Disable Logging in Loopback, have SDKs default to StdOut in that case.The other option is to simply not send a logging address to the SDK when prism is executing a pipeline in LOOPBACK mode. I believe the SDKs do fallback to StdOut and StdErr output for logs if there's no logging connection, but that's only for failure. This would avoid round trips to the prism process, and rely on the SDK fallback options.
Basically we'd just check if there's actually a logging endpoint here, and if it's empty, we quietly write logs to StdOut instead. Likely we would need to do something similar for Java and Python though. Edit: On reflection, I don't love the endpoint idea just above here, since it would require more changes to the Python and Java SDKs. It also doesn't solve anything for Xlang pipelines, as it encourages loss of the logs. |
The fastest ham-fisted Go SDK solution could also be in the universal runner code: Where if the pipeline is executing in Loopback mode, disable the remote logging hook:
Since that Std.Logger does exactly what we want already and reduces the blast radius to just Go Loopback execution (which would then apply to all universal pipeline runner invocations, including the in process prism). Edit: This would lose the local Go logs from Prism, but not the Xlang logs from other processes/containers. In combination with the flags suggested above, everything could be routed locally. But I think the best option is that flags routing to JobLogs solution I mentioned, since that feels closer to the desired behavior of "local debugging of the whole pipeline", while also being compatible with debugging cross language transforms. |
* Migrate to standard library slog package * Add dev logger dependency for pre printed development logs * Improve logging output for prism and user side logs, and emit container logs. * Fix missed lines from artifact and worker. --------- Co-authored-by: lostluck <[email protected]>
What happened?
To replicate this issue:
From my understanding, both of these are run on the Prism runner. Comparing the excerpts:
(stand-alone binary)
(command in the quickstart)
Issue Priority
Priority: 3 (minor)
Issue Components
The text was updated successfully, but these errors were encountered: