diff --git a/internal/metrics/iptables.go b/internal/metrics/iptables.go index 14a68ce9ecf09a1cf6bf4938606450327a4ec1e5..eb16457e1c7887626ae2538c802cb497720930fd 100644 --- a/internal/metrics/iptables.go +++ b/internal/metrics/iptables.go @@ -5,7 +5,6 @@ package metrics import ( "context" - "fmt" "sync" "time" @@ -124,13 +123,13 @@ func NewIptablesCollector() *IptablesCollector { ruleBytesTotal: prometheus.NewDesc( "iptables_rule_bytes_total", "Total bytes matching a rule.", - []string{"table", "chain", "rule_index", "in_iface", "out_iface", "rule"}, + []string{"table", "chain", "in_iface", "out_iface"}, nil, ), rulePacketsTotal: prometheus.NewDesc( "iptables_rule_packets_total", "Total packets matching a rule.", - []string{"table", "chain", "rule_index", "in_iface", "out_iface", "rule"}, + []string{"table", "chain", "in_iface", "out_iface"}, nil, ), } @@ -267,10 +266,8 @@ func (c *IptablesCollector) Collect(ch chan<- prometheus.Metric) { float64(rule.Packets), table.Name, chain.Name, - fmt.Sprintf("%d", rule.Index), rule.InIface, rule.OutIface, - rule.RuleSpec, ) ch <- prometheus.MustNewConstMetric( c.ruleBytesTotal, @@ -278,10 +275,8 @@ func (c *IptablesCollector) Collect(ch chan<- prometheus.Metric) { float64(rule.Bytes), table.Name, chain.Name, - fmt.Sprintf("%d", rule.Index), rule.InIface, rule.OutIface, - rule.RuleSpec, ) } }