Skip to content

feat: asobi logs, engine logs for an environment - #53

Merged
Taure merged 1 commit into
mainfrom
feat/logs
Aug 17, 2026
Merged

feat: asobi logs, engine logs for an environment#53
Taure merged 1 commit into
mainfrom
feat/logs

Conversation

@Taure

@Taure Taure commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Client half. Needs widgrensit/asobi_saas#293 merged and deployed first.

asobi logs prod
asobi logs prod --filter error --since 30m --limit 50

Two decisions

No --follow. The backend query is a bounded range — Loki's query_range — not a stream. A tail would be a poll wearing a costume, and promising one this cannot deliver is worse than not offering it. If it's wanted later it needs Loki's tail websocket, which is a real change rather than a flag.

--since takes 30m, 2h or a bare number of seconds. The bare number matters because the API itself takes seconds, so somebody who reads the docs and passes 3600 should get an hour rather than a parse error.

Errors worth distinguishing

A 422 is a filter the caller can fix; a 503 is Loki being down and nothing to do with them. Reporting both as logs failed (N) makes the first one unfixable, so each gets its own message and a test.

Zero-valued options are omitted rather than sent as 0, or they would shadow the server's defaults with something it clamps back up — TestEnvLogsOmitsUnsetOptions pins that.

Checks

gofmt -l clean, go vet clean, go build ./..., go test ./... pass (4 new). Usage text and README updated.

…terminal

The backend has done the tenant-scoped Loki query since the dashboard gained
its logs page. The CLI had no way to reach it, so debugging a deploy meant
opening a browser.

No --follow. The backend query is a bounded range (Loki's query_range), not
a stream, so a tail would be a poll pretending to be one; promising it and
not delivering is worse than not offering it.

--since takes 30m, 2h or a bare number of seconds. The bare number matters
because the API itself takes seconds, so somebody who reads the docs and
passes 3600 should get an hour rather than a parse error.

A 422 and a 503 get their own messages: a bad filter is the caller's to fix
and an unavailable Loki is not, and reporting both generically makes the
first one unfixable.
@Taure
Taure merged commit 9a5752e into main Aug 17, 2026
1 check passed
@Taure
Taure deleted the feat/logs branch August 17, 2026 11:30
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.

1 participant