@@ -20,14 +20,14 @@ const (
2020)
2121
2222var (
23- NfConnctrackCount = prometheus .NewGaugeVec (prometheus.GaugeOpts {
23+ NfConntrackCount = prometheus .NewGaugeVec (prometheus.GaugeOpts {
2424 Namespace : constants .MetricsNS ,
2525 Subsystem : "egress" ,
2626 Name : "nf_conntrack_entries_count" ,
2727 Help : "the number of entries in the nf_conntrack table" ,
2828 }, []string {"namespace" , "pod" , "egress" })
2929
30- NfConnctrackLimit = prometheus .NewGaugeVec (prometheus.GaugeOpts {
30+ NfConntrackLimit = prometheus .NewGaugeVec (prometheus.GaugeOpts {
3131 Namespace : constants .MetricsNS ,
3232 Subsystem : "egress" ,
3333 Name : "nf_conntrack_entries_limit" ,
@@ -71,24 +71,24 @@ type egressCollector struct {
7171}
7272
7373type nfTablesPerProtocolMetrics struct {
74- nfTablesNATPackets prometheus.Gauge
75- nfTablesNATBytes prometheus.Gauge
76- nfTablesInvalidPackets prometheus.Gauge
77- nfTablesInvalidBytes prometheus.Gauge
74+ NATPackets prometheus.Gauge
75+ NATBytes prometheus.Gauge
76+ InvalidPackets prometheus.Gauge
77+ InvalidBytes prometheus.Gauge
7878}
7979
8080func newNfTablesPerProtocolMetrics (ns , pod , egress , protocol string ) * nfTablesPerProtocolMetrics {
8181 return & nfTablesPerProtocolMetrics {
82- nfTablesNATPackets : NfTableMasqueradePackets .WithLabelValues (ns , pod , egress , protocol ),
83- nfTablesNATBytes : NfTableMasqueradeBytes .WithLabelValues (ns , pod , egress , protocol ),
84- nfTablesInvalidPackets : NfTableInvalidPackets .WithLabelValues (ns , pod , egress , protocol ),
85- nfTablesInvalidBytes : NfTableInvalidBytes .WithLabelValues (ns , pod , egress , protocol ),
82+ NATPackets : NfTableMasqueradePackets .WithLabelValues (ns , pod , egress , protocol ),
83+ NATBytes : NfTableMasqueradeBytes .WithLabelValues (ns , pod , egress , protocol ),
84+ InvalidPackets : NfTableInvalidPackets .WithLabelValues (ns , pod , egress , protocol ),
85+ InvalidBytes : NfTableInvalidBytes .WithLabelValues (ns , pod , egress , protocol ),
8686 }
8787}
8888
8989func NewEgressCollector (ns , pod , egress string , protocols []string ) (Collector , error ) {
90- NfConnctrackCount .Reset ()
91- NfConnctrackLimit .Reset ()
90+ NfConntrackCount .Reset ()
91+ NfConntrackLimit .Reset ()
9292 NfTableMasqueradeBytes .Reset ()
9393 NfTableMasqueradePackets .Reset ()
9494 NfTableInvalidPackets .Reset ()
@@ -106,8 +106,8 @@ func NewEgressCollector(ns, pod, egress string, protocols []string) (Collector,
106106
107107 return & egressCollector {
108108 conn : c ,
109- nfConnctrackCount : NfConnctrackCount .WithLabelValues (ns , pod , egress ),
110- nfConnctrackLimit : NfConnctrackLimit .WithLabelValues (ns , pod , egress ),
109+ nfConnctrackCount : NfConntrackCount .WithLabelValues (ns , pod , egress ),
110+ nfConnctrackLimit : NfConntrackLimit .WithLabelValues (ns , pod , egress ),
111111 perProtocol : perProtocols ,
112112 }, nil
113113}
@@ -135,15 +135,15 @@ func (c *egressCollector) Update(ctx context.Context) error {
135135 if err != nil {
136136 return err
137137 }
138- nfTablesMetrics .nfTablesNATPackets .Set (float64 (natPackets ))
139- nfTablesMetrics .nfTablesNATBytes .Set (float64 (natBytes ))
138+ nfTablesMetrics .NATPackets .Set (float64 (natPackets ))
139+ nfTablesMetrics .NATBytes .Set (float64 (natBytes ))
140140
141141 invalidPackets , invalidBytes , err := c .getNfTablesInvalidCounter (protocol )
142142 if err != nil {
143143 return err
144144 }
145- nfTablesMetrics .nfTablesInvalidPackets .Set (float64 (invalidPackets ))
146- nfTablesMetrics .nfTablesInvalidBytes .Set (float64 (invalidBytes ))
145+ nfTablesMetrics .InvalidPackets .Set (float64 (invalidPackets ))
146+ nfTablesMetrics .InvalidBytes .Set (float64 (invalidBytes ))
147147
148148 }
149149
0 commit comments