mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 08:09:58 +00:00
proxy/metrics: refactor nfacct metrics
Signed-off-by: Daman Arora <aroradaman@gmail.com>
This commit is contained in:
parent
09596a57de
commit
6c5dac89bc
@ -147,8 +147,7 @@ var (
|
|||||||
"kubeproxy_iptables_ct_state_invalid_dropped_packets_total",
|
"kubeproxy_iptables_ct_state_invalid_dropped_packets_total",
|
||||||
"packets dropped by iptables to work around conntrack problems",
|
"packets dropped by iptables to work around conntrack problems",
|
||||||
nil, nil, metrics.ALPHA, "")
|
nil, nil, metrics.ALPHA, "")
|
||||||
IPTablesCTStateInvalidDroppedNFAcctCounter = "ct_state_invalid_dropped_pkts"
|
IPTablesCTStateInvalidDroppedNFAcctCounter = "ct_state_invalid_dropped_pkts"
|
||||||
iptablesCTStateInvalidDroppedMetricCollector = newNFAcctMetricCollector(IPTablesCTStateInvalidDroppedNFAcctCounter, iptablesCTStateInvalidDroppedPacketsDescription)
|
|
||||||
|
|
||||||
// IPTablesRestoreFailuresTotal is the number of iptables restore failures that the proxy has
|
// IPTablesRestoreFailuresTotal is the number of iptables restore failures that the proxy has
|
||||||
// seen.
|
// seen.
|
||||||
@ -273,8 +272,7 @@ var (
|
|||||||
"kubeproxy_iptables_localhost_nodeports_accepted_packets_total",
|
"kubeproxy_iptables_localhost_nodeports_accepted_packets_total",
|
||||||
"Number of packets accepted on nodeports of loopback interface",
|
"Number of packets accepted on nodeports of loopback interface",
|
||||||
nil, nil, metrics.ALPHA, "")
|
nil, nil, metrics.ALPHA, "")
|
||||||
LocalhostNodePortAcceptedNFAcctCounter = "localhost_nps_accepted_pkts"
|
LocalhostNodePortAcceptedNFAcctCounter = "localhost_nps_accepted_pkts"
|
||||||
localhostNodePortsAcceptedMetricsCollector = newNFAcctMetricCollector(LocalhostNodePortAcceptedNFAcctCounter, localhostNodePortsAcceptedPacketsDescription)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var registerMetricsOnce sync.Once
|
var registerMetricsOnce sync.Once
|
||||||
@ -299,9 +297,11 @@ func RegisterMetrics(mode kubeproxyconfig.ProxyMode) {
|
|||||||
|
|
||||||
switch mode {
|
switch mode {
|
||||||
case kubeproxyconfig.ProxyModeIPTables:
|
case kubeproxyconfig.ProxyModeIPTables:
|
||||||
|
iptablesCTStateInvalidDroppedMetricCollector := newNFAcctMetricCollector(IPTablesCTStateInvalidDroppedNFAcctCounter, iptablesCTStateInvalidDroppedPacketsDescription)
|
||||||
if iptablesCTStateInvalidDroppedMetricCollector != nil {
|
if iptablesCTStateInvalidDroppedMetricCollector != nil {
|
||||||
legacyregistry.CustomMustRegister(iptablesCTStateInvalidDroppedMetricCollector)
|
legacyregistry.CustomMustRegister(iptablesCTStateInvalidDroppedMetricCollector)
|
||||||
}
|
}
|
||||||
|
localhostNodePortsAcceptedMetricsCollector := newNFAcctMetricCollector(LocalhostNodePortAcceptedNFAcctCounter, localhostNodePortsAcceptedPacketsDescription)
|
||||||
if localhostNodePortsAcceptedMetricsCollector != nil {
|
if localhostNodePortsAcceptedMetricsCollector != nil {
|
||||||
legacyregistry.CustomMustRegister(localhostNodePortsAcceptedMetricsCollector)
|
legacyregistry.CustomMustRegister(localhostNodePortsAcceptedMetricsCollector)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user