Change:
function on is not being used, and kproxy metrics are not showing on endpoint. See kube-proxy related metrics. Access kube-proxy on and search for kube-proxy specific metrics. No response <detailsKube-proxy build from master </details<details</details<details</details<details</details<details</details<details</details
/sig windows
/triage accepted /priority important-soon
/milestone v1.24

Discussion:
if err != nil { return nil, fmt.Errorf("unable to create proxier: %v", err) } <ins> winkernel.RegisterMetrics() </ins> } else { klog.V(0).InfoS("Using userspace Proxier.") klog.V(0).InfoS("The userspace proxier is now deprecated and will be removed in a future release, please use 'kernelspace' instead")

import ( "sync" <del> "k8s.io/component-base/metrics" </del> "k8s.io/component-base/metrics/legacyregistry" <del> ) const kubeProxySubsystem = "kubeproxy" var ( SyncProxyRulesLatency = metrics.NewHistogram( &metrics.HistogramOpts{ Subsystem:      kubeProxySubsystem, Name:           "sync_proxy_rules_duration_seconds", Help:           "SyncProxyRules latency in seconds", Buckets:        metrics.ExponentialBuckets(0.001, 2, 15), StabilityLevel: metrics.ALPHA, }, ) // SyncProxyRulesLastTimestamp is the timestamp proxy rules were last // successfully synced. SyncProxyRulesLastTimestamp = metrics.NewGauge( &metrics.GaugeOpts{ Subsystem:      kubeProxySubsystem, Name:           "sync_proxy_rules_last_timestamp_seconds", Help:           "The last time proxy rules were successfully synced", StabilityLevel: metrics.ALPHA, }, ) </del> <ins> "k8s.io/kubernetes/pkg/proxy/metrics" </ins> ) var registerMetricsOnce sync.Once <ins> // RegisterMetrics registers kube-proxy metrics for Windows modes. </ins> func RegisterMetrics() { registerMetricsOnce.Do(func() { <del> legacyregistry.MustRegister(SyncProxyRulesLatency) legacyregistry.MustRegister(SyncProxyRulesLastTimestamp) </del> <ins> legacyregistry.MustRegister(metrics.SyncProxyRulesLatency) legacyregistry.MustRegister(metrics.SyncProxyRulesLastTimestamp) legacyregistry.MustRegister(metrics.EndpointChangesPending) legacyregistry.MustRegister(metrics.EndpointChangesTotal) legacyregistry.MustRegister(metrics.ServiceChangesPending) legacyregistry.MustRegister(metrics.ServiceChangesTotal) legacyregistry.MustRegister(metrics.SyncProxyRulesLastQueuedTimestamp) </ins> }) }

proxier.mu.Lock() defer proxier.mu.Unlock() <del> start := time.Now() defer func() { SyncProxyRulesLatency.Observe(metrics.SinceInSeconds(start)) klog.V(4).InfoS("Syncing proxy rules complete", "elapsed", time.Since(start)) }() </del> // don't sync rules till we've received services and endpoints if !proxier.isInitialized() { klog.V(2).InfoS("Not syncing hns until Services and Endpoints have been received from master") return } <ins> // Keep track of how long syncs take. start := time.Now() defer func() { metrics.SyncProxyRulesLatency.Observe(metrics.SinceInSeconds(start)) klog.V(4).InfoS("Syncing proxy rules complete", "elapsed", time.Since(start)) }() </ins> hnsNetworkName := proxier.network.name hns := proxier.hns

if proxier.healthzServer != nil { proxier.healthzServer.Updated() } <del> SyncProxyRulesLastTimestamp.SetToCurrentTime() </del> <ins> metrics.SyncProxyRulesLastTimestamp.SetToCurrentTime() </ins> // Update service healthchecks.  The endpoints list might include services that are // not "OnlyLocal", but the services list will not, and the serviceHealthServer