Skip to content

Commit 19fd03f

Browse files
itcmsgrclaude
andcommitted
fix(export): filter dot-notation metrics from Prometheus textfile output
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>
1 parent f51c4ba commit 19fd03f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cli/lib/nftban/exporters/nftban_unified_exporter_export.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ PROM_HEADER
198198
# Skip Zabbix string metrics (containing |STRING| prefix)
199199
if (index($2, "|STRING|") == 1) next
200200
201+
# Skip dot-notation metrics (Zabbix format, invalid Prometheus names)
202+
# Valid Prometheus: [a-zA-Z_:][a-zA-Z0-9_:]*
203+
if (index($1, ".") > 0) next
204+
201205
if (NF >= 2) {
202206
# Handle metrics with labels
203207
if ($1 ~ /{.*}/) {

0 commit comments

Comments
 (0)