GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Add JSON logging format support for scan jobs and enforcer by moshemorad · Pull Request #539 · robusta-dev/krr Conversation
Contributor
SummaryAdd opt-in JSON log output (one object per line) so KRR logs are easier to index, search, and filter with log scrapers such as Filebeat. This aligns KRR with the logging approach used across the other Robusta services (runner, Holmes, relay), all driven by the same Key Changes
Notes
🤖 Generated with Claude Code https://claude.ai/code/session_01AozEpN8uwPRQuF8FPRX4Jy Generated by Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds optional JSON log formatting controlled by ChangesJSON logging configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add an opt-in ENABLE_JSON_LOGS_FORMAT toggle so KRR emits logs as JSON (one object per line) instead of the default output, matching the format used across Robusta services. This makes logs easier to index and filter with scrapers like Filebeat. - config.py set_config(): env-driven JSON branch (never a CLI flag, so the interactive CLI keeps its Rich output); used when KRR runs as an in-cluster scan job - enforcer_main.py: JSON formatter branch for the enforcer pod - helm/krr-enforcer: enableJsonLogsFormat value + env var - add python-json-logger dependency Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01AozEpN8uwPRQuF8FPRX4Jy Signed-off-by: Claude <[email protected]>
Re-lock with the same Poetry version that generated the committed lock (1.8.5) so the change is limited to adding python-json-logger instead of rewriting the whole file in the 2.x lock format. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01AozEpN8uwPRQuF8FPRX4Jy Signed-off-by: Claude <[email protected]>
The scanner and enforcer Docker images install dependencies with `pip install -r requirements.txt`, not Poetry, so adding the package to pyproject.toml/poetry.lock alone did not make it available at runtime — the scanner crashed with `ModuleNotFoundError: No module named 'pythonjsonlogger'` when ENABLE_JSON_LOGS_FORMAT was enabled. Add python-json-logger==3.3.0 to both requirements.txt (scanner) and enforcer/requirements.txt so the module is present in the images. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01AozEpN8uwPRQuF8FPRX4Jy Signed-off-by: Claude <[email protected]>
a49795e to
2657080
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Address review: import JsonFormatter at the top of enforcer_main.py and config.py instead of inside the ENABLE_JSON_LOGS_FORMAT branch. In enforcer_main.py it goes after the custom-certificate setup, since the JSON formatter does not initialize any HTTP client. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01AozEpN8uwPRQuF8FPRX4Jy Signed-off-by: Claude <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.