From 42a91c29e5903c1f93cc9399635043a14bc99715 Mon Sep 17 00:00:00 2001 From: Daman Date: Thu, 2 Mar 2023 20:56:05 +0530 Subject: [PATCH] proxier: track metrics before conntrack cleaning --- pkg/proxy/ipvs/proxier.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index ad4b1b81f5a..735554f0647 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1526,6 +1526,9 @@ func (proxier *Proxier) syncProxyRules() { klog.ErrorS(err, "Error syncing healthcheck endpoints") } + metrics.SyncProxyRulesNoLocalEndpointsTotal.WithLabelValues("internal").Set(float64(proxier.serviceNoLocalEndpointsInternal.Len())) + metrics.SyncProxyRulesNoLocalEndpointsTotal.WithLabelValues("external").Set(float64(proxier.serviceNoLocalEndpointsExternal.Len())) + // Finish housekeeping. // Clear stale conntrack entries for UDP Services, this has to be done AFTER the ipvs rules are programmed. // TODO: these could be made more consistent. @@ -1544,9 +1547,6 @@ func (proxier *Proxier) syncProxyRules() { } klog.V(4).InfoS("Deleting stale endpoint connections", "endpoints", endpointUpdateResult.StaleEndpoints) proxier.deleteEndpointConnections(endpointUpdateResult.StaleEndpoints) - - metrics.SyncProxyRulesNoLocalEndpointsTotal.WithLabelValues("internal").Set(float64(proxier.serviceNoLocalEndpointsInternal.Len())) - metrics.SyncProxyRulesNoLocalEndpointsTotal.WithLabelValues("external").Set(float64(proxier.serviceNoLocalEndpointsExternal.Len())) } // writeIptablesRules write all iptables rules to proxier.natRules or proxier.FilterRules that ipvs proxier needed