feat(health): allow excluding noisy LogServices in periodic log collection#3349
feat(health): allow excluding noisy LogServices in periodic log collection#3349cdraman wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
Summary by CodeRabbit
WalkthroughPeriodic log collection now supports configurable, case-sensitive substring filters for Redfish ChangesPeriodic LogService Exclusion
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PeriodicLogConfig
participant spawn_generic_redfish_collectors
participant LogsCollector
participant RedfishBMC
PeriodicLogConfig->>spawn_generic_redfish_collectors: provide exclude_services
spawn_generic_redfish_collectors->>LogsCollector: create LogsCollectorConfig
LogsCollector->>RedfishBMC: discover LogServices
LogsCollector->>LogsCollector: filter matching OData IDs
LogsCollector-->>LogsCollector: log total and excluded service counts
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/health/src/collectors/logs/periodic.rs (1)
427-481: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPrefer
check_valuesover ad-hoc#[test]functions for this matcher.
service_is_excludedis a pure validator with two inputs (pattern list, service id) and a boolean output — exactly the case the style guide calls out for table-driven tests. As per coding guidelines, "Usecheck_cases/check_valuesdirectly when a macro would obscure a table with several inputs or several expected fields per row in table-driven tests." A singlecheck_valuestable covering all five current scenarios (empty list, substring match, non-match, multi-pattern, case sensitivity) would replace the five separate#[test]functions with one enumerable table and make it trivial to add future cases.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/health/src/collectors/logs/periodic.rs` around lines 427 - 481, Replace the five ad-hoc tests in the tests module with one table-driven check_values test covering empty exclusions, substring matches, non-matches, multiple patterns, and case sensitivity. Keep each case’s pattern list, service ID, and expected boolean explicit, and use the project’s existing check_values convention while continuing to exercise service_is_excluded.Sources: Coding guidelines, Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/health/src/collectors/logs/periodic.rs`:
- Around line 417-425: Update service_is_excluded to ignore empty
exclude_services patterns before performing substring matching, ensuring only
non-empty patterns are checked against service_id.
---
Nitpick comments:
In `@crates/health/src/collectors/logs/periodic.rs`:
- Around line 427-481: Replace the five ad-hoc tests in the tests module with
one table-driven check_values test covering empty exclusions, substring matches,
non-matches, multiple patterns, and case sensitivity. Keep each case’s pattern
list, service ID, and expected boolean explicit, and use the project’s existing
check_values convention while continuing to exercise service_is_excluded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 515f362c-71e1-4934-99a0-26ac9837da9e
📒 Files selected for processing (5)
crates/health/example/config.bmc-mock-periodic.tomlcrates/health/example/config.example.tomlcrates/health/src/collectors/logs/periodic.rscrates/health/src/config.rscrates/health/src/discovery/spawn.rs
|
Lets make exclude Journal by default, seems like this behavior is not desired in vast majority of cases |
| # Typically used to drop the bmcweb "Journal" HTTP-access log (high-volume noise, | ||
| # and self-referential since polling generates Journal entries). Empty (default) | ||
| # collects from every discovered LogService. Periodic mode only. | ||
| exclude_services = [] |
There was a problem hiding this comment.
Need to also define this config attrubute on L198.
Auto mode accepts both sse and periodic config variables for fallback behavior
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/health/example/config.bmc-mock-periodic.toml`:
- Around line 55-60: Update the periodic log collection comment to describe an
empty exclude_services list as an explicit opt-out that collects from every
discovered LogService, and identify ["Journal"] as the configured default shown
in this example. Remove the contradictory “Empty (default)” wording while
preserving the existing explanation of the exclusion behavior.
In `@crates/health/example/config.example.toml`:
- Around line 213-217: Align the documented and runtime defaults for periodic
log-service exclude_services. Update the exclude_services setting in the example
configuration or the corresponding PeriodicLogConfig::default implementation so
both use the same fallback value, including the comment describing the default.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4c0c4310-d7ae-485a-894d-ad85ef8a92da
📒 Files selected for processing (5)
crates/health/example/config.bmc-mock-periodic.tomlcrates/health/example/config.example.tomlcrates/health/src/collectors/logs/periodic.rscrates/health/src/config.rscrates/health/src/discovery/spawn.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/health/src/discovery/spawn.rs
- crates/health/src/collectors/logs/periodic.rs
…ction When forge-hw-health runs in periodic log collection mode, it enumerates every Redfish LogService on the BMC — including the bmcweb Journal, which is the BMC web server's own HTTP access log. This creates a self-reinforcing noise loop: every Redfish poll we make is itself recorded as a Journal entry. The next poll collects those entries, which generates more entries. Add exclude_services to collectors.logs.periodic (and auto-mode fallback) — a list of substrings matched against each LogService odata.id. Matching services are skipped at discovery time before any entries are fetched. Defaults to [\"Journal\"] since suppressing the bmcweb HTTP-access log is the right behavior in the vast majority of deployments. Set to [] to collect from every discovered LogService." Signed-off-by: Dasa Chandramouli <dchandramoul@nvidia.com>
When
forge-hw-healthruns in periodic log collection mode, it enumeratesevery Redfish LogService on the BMC — including the bmcweb Journal, which
is the BMC web server's own HTTP access log.
This creates a self-reinforcing noise loop: every Redfish poll we make is
itself recorded as a Journal entry. The next poll collects those entries,
which generates more entries. Volume grows as a function of our own polling
rate, not real hardware events, drowning out meaningful signal like GPU XID
faults and CPER records.
Add
exclude_servicestocollectors.logs.periodic— a list of substringsmatched against each LogService
@odata.id. Matching services are skippedat discovery time before any entries are fetched.
Related issues
Closes #3344
Type of Change
Breaking Changes
Testing
Additional Notes