Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Client half. Needs widgrensit/asobi_saas#293 merged and deployed first.
Two decisions
No
--follow. The backend query is a bounded range — Loki'squery_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.--sincetakes30m,2hor a bare number of seconds. The bare number matters because the API itself takes seconds, so somebody who reads the docs and passes3600should 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 —TestEnvLogsOmitsUnsetOptionspins that.Checks
gofmt -lclean,go vetclean,go build ./...,go test ./...pass (4 new). Usage text and README updated.