Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the release command logic to stream release command machine logs during execution, instead of only fetching them afterwards. This should help improve the log-fetching experience in release commands as a response the recently increased ingestion delay in the app logs endpoint.
Logs will be printed to standard error in real-time when using the
--verbose
flag, or otherwise the last 100 lines will be buffered and displayed on a command failure. (We can adjust this to display more lines, or all of them if that would be better!)The stream will use NATS logs by default, with a fallback to polling the logs API if the wireguard connection is unavailable. By setting up the stream before starting the machine, NATS won't miss any of the release command logs.
NATS logs should provide a better experience than the app logs API for longer commands, since streaming logs can be printed in real-time to the console. It also doesn't depend on the availability of a centralized log-ingestion server, so it may be more reliable.
This PR also improves the fallback API polling, by waiting until the release command finishes fetching all of the logs (in verbose mode or if there is a command failure) by matching the
"Main child exited normally"
string at the end of the app logs when a command exits.Finally, this fixes a bug where a log-fetching failure would exit the release command with an error, preventing the deploy from continuing. This would block deploys after successful release commands with the
--verbose
flag when the logs cluster was unavailable.Documentation