From f62989fff7025a14e359ff228d39e96fc42ffdca Mon Sep 17 00:00:00 2001 From: Alex Stockinger Date: Sat, 6 Aug 2022 12:44:19 +0200 Subject: [PATCH] Implement `Insert()` for `metricsClientWrapper` --- pkg/iptables/metrics.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/iptables/metrics.go b/pkg/iptables/metrics.go index b262937..fb99e91 100644 --- a/pkg/iptables/metrics.go +++ b/pkg/iptables/metrics.go @@ -51,6 +51,15 @@ func (m *metricsClientWrapper) AppendUnique(table string, chain string, rule ... return m.client.AppendUnique(table, chain, rule...) } +func (m *metricsClientWrapper) Insert(table string, chain string, pos int, rule ...string) error { + m.operationCounter.With(prometheus.Labels{ + "operation": "Insert", + "table": table, + "chain": chain, + }).Inc() + return m.client.Insert(table, chain, pos, rule...) +} + func (m *metricsClientWrapper) Delete(table string, chain string, rule ...string) error { m.operationCounter.With(prometheus.Labels{ "operation": "Delete",