Skip to content

feat: job logs are read and followed by line - #48

Closed
jwric wants to merge 2 commits into
mainfrom
feat/job-log-lines
Closed

jwric wants to merge 2 commits into
mainfrom
feat/job-log-lines

Conversation

@jwric

@jwric jwric commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Job logs are read and followed by line, on top of tracel-ai/tracel-app#1762 and tracel-ai/tracel-client#61.

tracel jobs logs <n> shows the job's whole log the way kubectl logs does. It reads 1,000 lines at a time from the first one, so output starts right away and a pipe sees every line, and --tail <n> shows only the last lines. --start <byte> is gone.

--follow starts with the last 10 lines, or --tail of them, as tail -f does, so following a long-running job doesn't replay its whole log into the terminal. It then shows each new line as soon as Console receives it, over the job's log websocket. Reading the job and the lines after the newest one every 2 seconds stays the source of truth: a line already shown is dropped, a frame that skips a line is caught up at once by reading after the newest, and a websocket that can't open or is lost leaves following to those reads. tracel run --remote --follow attaches while the job is queued and shows every line from the first.

With --json, every line is a log event carrying its number, stream, timestamp and text, as experiments logs --follow does with its entries, and following ends with the end event. docs/cli.md covers all of it.

This replaces #47, which follows the current websocket: one string per line, with nothing to line it up with the stored log. tracel-client is pinned to the #61 commit until 0.24.0 is released, and the three changes ship together.

I tried it against a dev stack running #1762. A finished job with 150,001 lines prints in full in about 2.5 seconds, --tail and --follow --tail start where they should, and following a running job keeps every line in order.

jwric added 2 commits October 15, 2026 15:22
Console now keeps a job's log as numbered lines, so `tracel jobs logs <n>`
reads it by line instead of by byte. It shows the whole log the way
`kubectl logs` does, a page of 1,000 lines at a time from the first one,
and `--tail <n>` shows only the last lines. `--start <byte>` is gone.

`--follow` starts with the last 10 lines, or `--tail` of them, as
`tail -f` does, so following a long-running job no longer replays its
whole log, then reads after the newest line until the job has finished.
`tracel run --remote --follow` attaches as the job is queued and shows
every line from the first.

With `--json`, each line is a `log` event carrying its number, stream,
timestamp and text, as `experiments logs --follow` does with its
entries. Lines are whole, so the end event no longer closes a partial
line.

tracel-client is pinned to tracel-ai/tracel-client#61 until it is
released.
`tracel jobs logs <n> --follow` and `tracel run --remote --follow` open
the job's log websocket after their first read, so each line shows as
soon as Console receives it. Reading the job and the lines after the
newest one every 2 seconds stays the source of truth: a line already
shown is dropped, a frame that skips a line is caught up at once by
reading after the newest, and a websocket that cannot open or is lost
leaves following to those reads.
@Marc-AnthonyG

Copy link
Copy Markdown
Member

Replaced by #51, which carries this PR's two commits unchanged together with the managed-compute removal, the audit fixes and tracel-client 0.24.0, so the cli ships as one change with tracel-ai/tracel-app#1762.

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