Added Sandbox-Level Log Aggregation and Viewing Support#18
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
The Additionally, a new |
There was a problem hiding this comment.
Pull request overview
This PR adds sandbox-level aggregated log retrieval (merged across containers and ordered by CRI RFC3339Nano timestamps) and wires it through sbxlet → sbxorch proxy → sbxctl, while removing cursor/limit pagination from the logs APIs.
Changes:
- Added
GET /v1/sandboxes/{id}/logs(sbxlet) andGET /api/v1/nodes/{id}/sandboxes/{sandboxId}/logs(sbxorch) for sandbox-wide aggregated logs. - Removed cursor/limit pagination from container logs endpoints and updated clients/tests/docs accordingly.
- Updated
sbxctl logsto support sandbox-level logs by default (optional container), with a polling--watchmode.
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sandboxd-orch/http/router.go | Adds sandbox logs proxy route |
| sandboxd-orch/http/handlers/handler.go | Implements NodeSandboxLogs handler |
| sandboxd-orch/http/handlers/handler_api_test.go | Exercises new proxy endpoint |
| sandboxd-orch/docs/orchestrator_swagger.yaml | Documents new proxy API |
| sandboxd-orch/docs/orchestrator_swagger.json | Regenerates swagger JSON |
| sandboxd-orch/docs/orchestrator_docs.go | Regenerates embedded swagger |
| sandboxd-orch/client/sandboxes.go | Adds GetSandboxLogs client call |
| sandboxd-orch/client/client_test.go | Tests new client path building |
| sandboxd-let/sandbox/logs.go | Implements aggregation + removes pagination |
| sandboxd-let/sandbox/logs_test.go | Adds aggregation/sorting tests |
| sandboxd-let/http/router.go | Adds sbxlet sandbox logs route |
| sandboxd-let/http/handlers.go | Adds handler; updates container logs |
| sandboxd-let/http/dto.go | Adds SandboxLogsResponse DTO |
| sandboxd-let/docs/sandboxd_swagger.yaml | Documents new sbxlet endpoint/schema |
| sandboxd-let/docs/sandboxd_swagger.json | Regenerates swagger JSON |
| sandboxd-let/docs/sandboxd_docs.go | Regenerates embedded swagger |
| sandboxd-ctl/cmd/root.go | Updates global flag help text |
| sandboxd-ctl/cmd/resource_cmds.go | Updates logs command + --watch |
| sandboxd-ctl/cmd/output.go | Adds log line extraction helper |
| sandboxd-ctl/client/orchestrator.go | Adds NodeSandboxLogs client call |
| README.md | Updates CLI/docs for new logs behavior |
| docs/sandboxd.md | Documents sandbox logs endpoint |
| docs/orchestrator.md | Documents sandbox logs proxy endpoint |
Files not reviewed (2)
- sandboxd-let/docs/sandboxd_docs.go: Language not supported
- sandboxd-orch/docs/orchestrator_docs.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Previously, logs could only be viewed on a per-container basis within a sandbox. This PR introduces the ability to view logs aggregated across the entire sandbox.
The following sbxlet and sbxorch APIs have been added:
sbxlet GET /v1/sandboxes/{id}/logssbxorch GET /api/v1/nodes/{id}/sandboxes/{sandboxId}/logsWith this change, aggregated sandbox logs can be viewed using:
Logs are merged and displayed in chronological order by parsing RFC3339Nano timestamps from the CRI log format.
Additionally, pagination support for log output has been removed.
The decision was made because pagination introduced unnecessary operational and implementation overhead while providing limited practical value.
For more details, please refer to the API documentation and the changes included in this PR.