Skip to content

feat(metrics): v1.89 metrics reduction — evidence dedup + naming + safety wiring#431

Merged
itcmsgr merged 2 commits intomainfrom
feat/v1.89-metrics-reduction
Apr 16, 2026
Merged

feat(metrics): v1.89 metrics reduction — evidence dedup + naming + safety wiring#431
itcmsgr merged 2 commits intomainfrom
feat/v1.89-metrics-reduction

Conversation

@itcmsgr
Copy link
Copy Markdown
Owner

@itcmsgr itcmsgr commented Apr 16, 2026

Summary

  • Phase 1: Delete 3 legacy shell exporters (firewall, geoban, portscan) — superseded by unified exporter + Go daemon
  • Phase 2: Evidence layer refactored to consume validator output directly — ZERO direct nft calls (eliminates 19 redundant kernel queries per collection cycle)
  • Phase 3: Wire 6 disconnected safety metrics setters (SetMemoryPressureLevel, SetProtectionActive, etc.) at exactly 2 call sites (sync handler + watchdog callback)
  • Phase 4: Rename 9 watchdog metrics (go_*runtime_*, remove _total from 3 gauges) with deprecated compatibility aliases for one release cycle
  • Phase 5: Mark sampler.go DEPRECATED — no new code may use GetSampler()
  • Phase 6: VERSION 1.89.0, CHANGELOG with deprecated alias table, README observability section

Global Invariants Enforced

# Invariant
INV-M-001 Kernel read once via validator per collection cycle
INV-M-002 Evidence layer ZERO direct nft calls
INV-M-003 Each metric has ONE owner
INV-M-004 /metrics endpoint stable and available
INV-M-005 Shell exporters don't duplicate daemon collection
INV-M-006 Sampler deprecated — no new GetSampler()
INV-M-007 Renames include compat aliases (removed in v1.90)
INV-M-008 Watchdog = sole pressure writer (2 call sites)

Test plan

  • CI gates green (header validation, shellcheck, go vet)
  • go test ./internal/metrics/... passes (includes new evidence_extract_test.go)
  • go test ./internal/validator/... passes
  • go test ./internal/watchdog/... passes
  • Build on lab4, deploy, compare /metrics scrape (both old+new names present)
  • Compare evidence snapshot JSON output vs v1.88.0 baseline (schema 1.88.0 preserved)
  • Verify no legacy exporter timers active on lab hosts

🤖 Generated with Claude Code

…fety wiring

6-phase reduction-only release. No new architecture, no new metrics.

Phase 1: Delete 3 legacy shell exporters (firewall, geoban, portscan)
Phase 2: Evidence layer refactored — ZERO direct nft calls (INV-M-002).
         Imports validator.ValidateKernel() directly. Counters, sets,
         chains extracted from validator's parsed kernel data.
Phase 3: Wire 6 disconnected safety metrics setters at 2 call sites
         (sync handler + watchdog callback) per INV-M-008.
Phase 4: Rename 9 watchdog metrics (go_* → runtime_*, _total on gauges)
         with deprecated compatibility aliases (removed in v1.90).
Phase 5: Mark sampler.go DEPRECATED (INV-M-006).
Phase 6: VERSION 1.89.0, CHANGELOG, README /metrics section.

8 global invariants (INV-M-001 through INV-M-008) enforced and verified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

…n sampler.go

- FHS spec: version bump 1.88.0 → 1.89.0 in generated nftban_fhs_spec.sh
  (CI gate: FHS generated files check)
- sampler.go: move SPDX header to line 4 (within first 5 lines) so CI
  SPDX validation passes. DEPRECATED comment moved after SPDX line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@itcmsgr itcmsgr merged commit 54db2a5 into main Apr 16, 2026
48 checks passed
@itcmsgr itcmsgr deleted the feat/v1.89-metrics-reduction branch April 16, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant