Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Support reading logs of running processes #170

Open
achille-roussel opened this issue Jul 8, 2023 · 0 comments
Open

Support reading logs of running processes #170

achille-roussel opened this issue Jul 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@achille-roussel
Copy link
Contributor

Timecraft commands read directly from the registry referenced in the configuration file; the time machine records are not flushed immediately after they are produced, which prevents inspecting the state of running processes until record batches are flushed (for example, reading logs of running processes).

When the processes see a lot of activity, records are flushed regularly, and the issue isn't visible, users tend to feel the issue when they are running processes that pause for a while (e.g. a http server before it receives any requests).

Here is an example highlighting the poor user experience:

$ ./timecraft run ./testdata/go/http_server.wasm
bafbbb61-d9d1-4b28-b78a-ff9f5449bd1a
2023/07/06 22:02:17 /Users/achilleroussel/go/src/github.com/stealthrocket/timecraft: serving files on :3000
$ timecraft get ps
PROCESS ID                            START   SIZE
bafbbb61-d9d1-4b28-b78a-ff9f5449bd1a  5s ago  0
23-07-06 15:02:22 ~/go/src/github.com/stealthrocket/wasi-go $ timecraft logs bafbbb61-d9d1-4b28-b78a-ff9f5449bd1a
ERR: timecraft logs: process has no records: bafbbb61-d9d1-4b28-b78a-ff9f5449bd1a

One way to address this issue would be to have a timeout on the buffered records so flushing to the registry happens predictably at regular time intervals. Once the records reach the registry files, other clients can read them.

Another approach could be for timecraft to expose APIs that clients can hit to access the system's current state without directly reading files from the registry. A running timecraft can then serve logs of running processes and other live information that may not be available in the registry.

@achille-roussel achille-roussel added the enhancement New feature or request label Jul 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant