feat(log): add log viewing provider#335
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ntation Add the log provider package at internal/provider/node/log/ with a Provider interface for querying systemd journal entries, Darwin and Linux stubs returning ErrUnsupported, and a Debian implementation using journalctl --output=json with full JSON parsing and filtering. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add OpLogQuery and OpLogQueryUnit operation constants to the SDK, OperationLog* aliases in the job types, PermLogRead permission across all roles, processLogOperation processor dispatching query/queryUnit sub-ops, and createLogProvider factory wired into NewNodeProcessor and the agent registry. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add OpenAPI spec for log management domain with two endpoints:
GET /node/{hostname}/log and GET /node/{hostname}/log/unit/{name}.
Regenerate combined spec and SDK client with new log types.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 🤖 Generated with [Claude Code](https://claude.ai/code)
Add LogService with Query and QueryUnit methods wrapping the generated OpenAPI client. Includes result types, gen→SDK conversions, export bridges, and full httptest.Server test coverage for all HTTP paths. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add feature page, CLI subcommand docs, SDK doc page, and SDK example for the log management provider. Update cross-references in features table, authentication, configuration, architecture, API guidelines, Docusaurus navbar, and SDK client overview to include log:read. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…oding The Query/QueryBroadcast methods accept `any` and call json.Marshal internally. Pre-marshalling to []byte caused double-encoding — the agent received a JSON string instead of the expected object. Co-Authored-By: Claude <noreply@anthropic.com>
Add ListSources operation across all layers — runs
`journalctl --field=SYSLOG_IDENTIFIER` to discover available
log sources. New endpoint: GET /node/{hostname}/log/source.
Also add missing test coverage for query params and timestamp
edge cases to bring all new code to 100% statement coverage.
Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #335 +/- ##
==========================================
+ Coverage 99.82% 99.89% +0.07%
==========================================
Files 383 396 +13
Lines 17648 18200 +552
==========================================
+ Hits 17617 18181 +564
+ Misses 19 11 -8
+ Partials 12 8 -4
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
- Add TestProcessLogSources and query unmarshal error test - Add size field to package handler test data to cover Size > 0 branch Co-Authored-By: Claude <noreply@anthropic.com>
Follow project convention: one suite method per function, all scenarios as rows in one table. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…eferences The ListSources operation was added to code but docs were not updated: - Add CLI doc for source subcommand - Add /log/source to api-guidelines endpoint table - Add Sources to feature page operations table and CLI examples - Add Sources method and LogSourceResult to SDK doc - Add Sources demo to SDK example - Update features landing page description Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
journalctl --output=jsonGET /node/{hostname}/log(query all) andGET /node/{hostname}/log/unit/{name}(query by unit)lines(default 100),since(time filter),priority(0-7 or name)log:readpermission added to all built-in roles (admin, write, read)ErrUnsupportedin containers (journalctl requires systemd)Test plan
just go::unit)just go::vet)osapi client node log query --target _anyosapi client node log unit --target _any --name sshd.serviceosapi client node log query --target _all--jsonoutput for both commands🤖 Generated with Claude Code