feat: v1.91 pipeline unification + fail2ban decommission#437
Merged
Conversation
The shell exporter collects ~25 metrics using Zabbix dot-notation (nftban.daemon.cpu_percent, nftban.server.load_1m). These are valid for Zabbix trapper but invalid Prometheus metric names — dots violate the [a-zA-Z_:][a-zA-Z0-9_:]* pattern. The export_prometheus() awk filter already strips |STRING| lines but did not filter dot-notation names. If Prometheus export is enabled, these would leak into nftban.prom and cause node_exporter parse errors. Currently a latent defect (NFTBAN_EXPORT_PROMETHEUS defaults to false), but this closes the gap before anyone enables it. Pipeline audit finding: P-8 Ref: V191_PIPELINE_INTEGRITY_AUDIT.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unify metric names across all export surfaces to match the daemon
/metrics contract frozen in v1.90.0. The shell exporter is a relay
of daemon vocabulary, not a parallel namespace.
Renames (shell/collector → daemon canonical):
- P-1: nftban_goroutines → nftban_runtime_goroutines
- P-1b: nftban_daemon_goroutines → nftban_runtime_goroutines
- P-2: nftban_conntrack_entries → nftban_conntrack_used
- P-3: nftban_memory_rss_bytes → nftban_proc_rss_bytes
- P-4: nftban_watchdog_{cpu,mem,io,net}_score → nftban_pressure_score{dim=X}
- P-5: nftban_watchdog_mode (integer) → nftban_operating_mode{mode=X} (one-hot)
- P-6: nftban_nftables_rules_total → nftban_nft_rules_total
Updated across: shell exporter, Go collector, dashboards, alerts,
metrics-registry.json, and HELP/TYPE headers.
Pipeline audit: V191_PIPELINE_INTEGRITY_AUDIT.md (P-1 through P-7)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove fail2ban as an ingestion/analytics dimension. No active code path produces fail2ban data — all references were either dead struct fields, dead parser constants, or phantom label values. Removed: - analytics/types.go: Jail field + ByJail map (zero writers) - analytics/state.go: legacy jail comment - banlog/banlog.go: SourceFail2ban constant + case "fail2ban" parser - handlers_analytics.go: case "fail2ban" display mapping - metrics-registry.json: "fail2ban" from health_status label values Kept (conflict detection — required for safe install): - nftban_firewall_conflicts.sh (~50 refs) - nftban_checks.sh, cmd_firewall.sh, cmd_health_analysis.sh - nftbanconf/services.go Fail2banService field Historical bans.log entries with source=fail2ban are preserved as raw strings — they pass through the default case in NormalizeSource(). Ref: V191_FAIL2BAN_DECOMMISSION_PLAN.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The struct literal at state.go:229 still referenced the removed Jail field, causing go vet to fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cmd_analytics.go also printed the removed Jail field in IP lookup output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…a-prometheus-filter
This was referenced Apr 16, 2026
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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
Combined v1.91 release PR — pipeline metric alignment + fail2ban cleanup.
PR-91A: P-8 dot-notation filter
PR-91C: Shell exporter alignment (P-1 through P-7)
nftban_goroutines→nftban_runtime_goroutinesnftban_conntrack_entries→nftban_conntrack_usednftban_memory_rss_bytes→nftban_proc_rss_bytesnftban_watchdog_{cpu,mem,io,net}_score→nftban_pressure_score{dim=X}nftban_watchdog_mode→nftban_operating_mode{mode=X}nftban_nftables_rules_total→nftban_nft_rules_totalPR-91D: fail2ban decommission
Jail/ByJailfields,SourceFail2banconstant, parser casesLab verification
Test plan
grep -rn 'SourceFail2ban' internal/→ 0grep -rn 'nftban_nftables_rules_total' .→ 0 active emittersSupersedes: #434, #435, #436
🤖 Generated with Claude Code